WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2018-Jun-28 02:37:13

Chandan
Member
Registered: 2018-May-23
Posts: 3

full_duplex

https://warpproject.org/trac/browser/Re … sic_txrx.m ,    this example is for basic tx and rx between two warp boards we modified this code to observe 2.4G signal generated from warp v3 board  on spectrum analyzer.when we saw output on spectrum analyzer we observed peak at 2.45G  but its power level is -23dbm. why we are getting negative power level???? Is this code fine ???

MODIFIED CODE:


clear;

%create vector of node objects
nodes = wl_initNodes(1);

%setup the transmit node
node_tx = nodes(1);

%setup trigger manager
eth_trig = wl_trigger_eth_udp_broadcast;
wl_triggerManagerCmd(nodes, 'add_ethernet_trigger', [eth_trig]);

%read trigger IDs
trig_in_ids  = wl_getTriggerInputIDs(nodes(1));
trig_out_ids = wl_getTriggerOutputIDs(nodes(1));

%Ethernate will trigger the baseband buffer of the node
wl_triggerManagerCmd(nodes, 'output_config_input_selection', [trig_out_ids.BASEBAND], [trig_in_ids.ETH_A]);

%Get the IDs for interface on the board
ifc_ids = wl_getInterfaceIDs(node_tx);

%Set the RF center frequency
    % Frequency = 2.4 GHz
    % Channel = 11
wl_interfaceCmd(nodes, ifc_ids.RF_ALL, 'channel', 2.4, 11);

%Set the Tx gain
wl_interfaceCmd(nodes, ifc_ids.RF_ALL, 'tx_gains', 3, 63);

%Get the baseband sampling frequency
ts_tx   = 1 / (wl_basebandCmd(nodes(1), 'tx_buff_clk_freq'));

%Get maximum I/Q buffer length
maximum_buffer_len = wl_basebandCmd(node_tx, ifc_ids.RF_A, 'tx_buff_max_num_samples');

%Set the transmission length in samples
tx_length    = 2^12;

% Check the transmission length
if (tx_length > maximum_buffer_len)
    error('Node supports max transmission length of %d samples.  Requested %d samples.', maximum_buffer_len, tx_length);
end

% Set the length for the transmit buffer based on the transmission length
wl_basebandCmd(nodes, 'tx_length', tx_length);

% Create the IQ data payload
t = [0:ts_tx:((tx_length - 1) * ts_tx)].';                      % Create time vector (Sample Frequency is ts_tx (Hz))

sinusoid_1    = 0.6 * exp(j*2*pi * 1e6 * t);                    % Create  1 MHz sinusoid
% sinusoid_2    = 0.6 * exp(j*2*pi * 5e4 * t);                    % Create 50 kHz sinusoid to transmit on RF_B

tx_data       = [sinusoid_1];                                   % Create the data to transmit on RF_A

% Transmit IQ data to the TX node
wl_basebandCmd(node_tx, [ifc_ids.RF_A], 'write_IQ', tx_data);

% Enabled the RF interfaces for TX
wl_interfaceCmd(node_tx, ifc_ids.RF_A, 'tx_en');

% Enable the buffer for TX
wl_basebandCmd(node_tx, ifc_ids.RF_A, 'tx_buff_en');

% Send the Ethernet trigger to start the TX
eth_trig.send();

% Disable the buffer and RF interfaces for TX
wl_basebandCmd(nodes, ifc_ids.RF_A, 'tx_rx_buff_dis');

%Visualize result
figure(1);clf;

% Plot IQ Data
%
ax(1) = subplot(3, 2, 1);
plot(0:(length(tx_data) - 1), real(tx_data(:, 1)))
xlabel('Sample Index')
title('Node 1 RFA: Transmitted I')
axis([1 tx_length -1 1])

ax(2) = subplot(3, 2, 2);
plot(0:(length(tx_data) - 1), imag(tx_data(:, 1)))
xlabel('Sample Index')
title('Node 1 RFA: Transmitted Q')
axis([1 tx_length -1 1])

Offline

 

#2 2018-Jun-28 02:50:12

Chandan
Member
Registered: 2018-May-23
Posts: 3

Re: full_duplex

ON WARP V3 BOARD we are trying to get 2.4G  transmitted signal through RF_A  and same signal with 180 phase shift through RF_B. For that we used below code. We get 2.4G signal through RF_A but we are not getting any signal from RF_B. for 180 phase shift we included j*pi term in the code. is this way correct to get phase shif for the signal through RF_B interface on warp v3 board???

CODE:

clear;

%create vector of node objects
nodes = wl_initNodes(2);

%setup the transmit node
node_tx_a = nodes(1);
node_tx_b = nodes(2);

%setup trigger manager
eth_trig = wl_trigger_eth_udp_broadcast;
wl_triggerManagerCmd(nodes, 'add_ethernet_trigger', [eth_trig]);

%read trigger IDs
trig_in_ids_a  = wl_getTriggerInputIDs(nodes(1));
trig_out_ids_a = wl_getTriggerOutputIDs(nodes(1));
trig_in_ids_b  = wl_getTriggerInputIDs(nodes(2));
trig_out_ids_b = wl_getTriggerOutputIDs(nodes(2));

%Ethernate will trigger the baseband buffer of the node
wl_triggerManagerCmd(nodes, 'output_config_input_selection', [trig_out_ids_a.BASEBAND], [trig_in_ids_a.ETH_A]);
wl_triggerManagerCmd(nodes, 'output_config_input_selection', [trig_out_ids_b.BASEBAND], [trig_in_ids_b.ETH_A]);

%Get the IDs for interface on the board
ifc_ids_a = wl_getInterfaceIDs(node_tx_a);
ifc_ids_b = wl_getInterfaceIDs(node_tx_b);

%Set the RF center frequency
    % Frequency = 2.4 GHz
    % Channel = 11
wl_interfaceCmd(nodes, ifc_ids_a.RF_ALL, 'channel', 2.4, 11);
wl_interfaceCmd(nodes, ifc_ids_b.RF_ALL, 'channel', 2.4, 11);

%Set the Tx gain
wl_interfaceCmd(nodes, ifc_ids_a.RF_ALL, 'tx_gains', 3, 63);
wl_interfaceCmd(nodes, ifc_ids_b.RF_ALL, 'tx_gains', 3, 63);


%Get the baseband sampling frequency
ts_tx_a = 1 / (wl_basebandCmd(nodes(1), 'tx_buff_clk_freq'));
ts_tx_b = 1 / (wl_basebandCmd(nodes(2), 'tx_buff_clk_freq'));

%Get maximum I/Q buffer length
maximum_buffer_len_a = wl_basebandCmd(node_tx_a, ifc_ids_a.RF_A, 'tx_buff_max_num_samples');
maximum_buffer_len_b = wl_basebandCmd(node_tx_b, ifc_ids_b.RF_A, 'tx_buff_max_num_samples');

%Set the transmission length in samples
tx_length    = 2^12;

% Check the transmission length
if (tx_length > maximum_buffer_len_a)
    error('Node supports max transmission length of %d samples.  Requested %d samples.', maximum_buffer_len_a, tx_length);
end

% Check the transmission length
if (tx_length > maximum_buffer_len_b)
    error('Node supports max transmission length of %d samples.  Requested %d samples.', maximum_buffer_len_b, tx_length);
end

% Set the length for the transmit buffer based on the transmission length
wl_basebandCmd(nodes, 'tx_length', tx_length);

% Create the IQ data payload
t_a = [0:ts_tx_a:((tx_length - 1) * ts_tx_a)].';                      % Create time vector (Sample Frequency is ts_tx (Hz))
t_b = [0:ts_tx_b:((tx_length - 1) * ts_tx_b)].';                      % Create time vector (Sample Frequency is ts_tx (Hz))

sinusoid_1    = 0.6 * exp(j*2*pi * 1e6 * t_a);                    % Create  1 MHz sinusoid
% sinusoid_2    = 0.6 * exp(j*2*pi * 5e4 * t);                    % Create 50 kHz sinusoid to transmit on RF_B

sinusoid_2    = 0.6 * exp(j*2*pi * 1e6 * t_b + j*pi);

tx_data_a       = [sinusoid_1];                                   % Create the data to transmit on RF_A
tx_data_b       = [sinusoid_2];

% Transmit IQ data to the TX node
wl_basebandCmd(node_tx_a, [ifc_ids_a.RF_A], 'write_IQ', tx_data_a);
wl_basebandCmd(node_tx_b, [ifc_ids_b.RF_A], 'write_IQ', tx_data_b);

% Enabled the RF interfaces for TX
wl_interfaceCmd(node_tx_a, ifc_ids_a.RF_A, 'tx_en');
wl_interfaceCmd(node_tx_b, ifc_ids_b.RF_A, 'tx_en');

% Enable the buffer for TX
wl_basebandCmd(node_tx_a, ifc_ids_a.RF_A, 'tx_buff_en');
wl_basebandCmd(node_tx_b, ifc_ids_b.RF_A, 'tx_buff_en');

% Send the Ethernet trigger to start the TX
eth_trig.send();

% Disable the buffer and RF interfaces for TX
wl_basebandCmd(nodes, ifc_ids_a.RF_A, 'tx_rx_buff_dis');
wl_basebandCmd(nodes, ifc_ids_b.RF_A, 'tx_rx_buff_dis');

%Visualize result
figure(1);clf;

% Plot IQ Data
%
ax(1) = subplot(3, 2, 1);
plot(0:(length(tx_data_a) - 1), real(tx_data_a(:, 1)))
xlabel('Sample Index')
title('Node 1 RFA: Transmitted I')
axis([1 tx_length -1 1])

ax(2) = subplot(3, 2, 2);
plot(0:(length(tx_data_a) - 1), imag(tx_data_a(:, 1)))
xlabel('Sample Index')
title('Node 1 RFA: Transmitted Q')
axis([1 tx_length -1 1])

ax(1) = subplot(3, 2, 3);
plot(0:(length(tx_data_b) - 1), real(tx_data_b(:, 1)))
xlabel('Sample Index')
title('Node 1 RFA: Transmitted I')
axis([1 tx_length -1 1])

ax(3) = subplot(3, 2, 4);
plot(0:(length(tx_data_b) - 1), imag(tx_data_b(:, 1)))
xlabel('Sample Index')
title('Node 1 RFA: Transmitted Q')
axis([1 tx_length -1 1])

Offline

 

#3 2018-Jun-28 09:24:12

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 4924

Re: full_duplex

this example is for basic tx and rx between two warp boards we modified this code to observe 2.4G signal generated from warp v3 board  on spectrum analyzer.when we saw output on spectrum analyzer we observed peak at 2.45G  but its power level is -23dbm. why we are getting negative power level???? Is this code fine ???

That WARPLab script will transmit a 4096-sample (2^12) waveform once. To observe this signal on a spectrum analyzer you would need to configure the analyzer's trigger to detect the short (4096 samples @ 40MSps = 102usec) burst. Otherwise the analyzer will plot the spectrum of noise, plus whatever signal leaks from the WARP v3 RF interface (i.e. the sinusoid at -23dBm could be Tx LO leakage).

The better alternative would be WARPLab's continuous Tx mode. This will output a signal continuously which is much easier to detect and analyze with external test equipment.

Offline

 

#4 2018-Jun-28 09:26:00

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 4924

Re: full_duplex

ON WARP V3 BOARD we are trying to get 2.4G  transmitted signal through RF_A  and same signal with 180 phase shift through RF_B. For that we used below code. We get 2.4G signal through RF_A but we are not getting any signal from RF_B. for 180 phase shift we included j*pi term in the code. is this way correct to get phase shif for the signal through RF_B interface on warp v3 board???

You need to examine your code more carefully. Your code is initializing two WARP v3 nodes and transmitting on RF A from both nodes.

Offline

 

#5 2018-Jun-29 00:55:37

Chandan
Member
Registered: 2018-May-23
Posts: 3

Re: full_duplex

sorry, the below code we used for 180 phase shit through RF_B interface, but we are getting error how to solve this???

code:
clear;

% Create a vector of node objects
nodes = wl_initNodes(1);

% Set up transmit and receive nodes
node_tx = nodes(1);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set up Trigger Manager
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Create a UDP broadcast trigger and tell each node to be ready for it
%     NOTE:  This will allow us to trigger both nodes to begin transmission / reception of IQ data
%
eth_trig = wl_trigger_eth_udp_broadcast;
wl_triggerManagerCmd(nodes, 'add_ethernet_trigger', [eth_trig]);

% Read Trigger IDs into workspace
trig_in_ids  = wl_getTriggerInputIDs(nodes(1));
trig_out_ids = wl_getTriggerOutputIDs(nodes(1));

% For both nodes, we will allow Ethernet A to trigger the baseband buffers
wl_triggerManagerCmd(nodes, 'output_config_input_selection', [trig_out_ids.BASEBAND], [trig_in_ids.ETH_A]);

% Set up the Interface parameters
ifc_ids = wl_getInterfaceIDs(nodes(1));

% Set the RF center frequency on all interfaces
%     - Frequency Band  :  Must be 2.4 or 5, to select 2.4GHz or 5GHz channels
%     - Channel         :  Must be an integer in [1,11] for BAND = 2.4; [1,23] for BAND = 5
%
wl_interfaceCmd(nodes, ifc_ids.RF_ALL, 'channel', 2.4, 11);

% Set the TX gains on all interfaces
wl_interfaceCmd(nodes, ifc_ids.RF_ALL, 'tx_gains', 3, 63);

% Get the baseband sampling frequencies from the board
ts_tx   = 1 / (wl_basebandCmd(nodes(1), 'tx_buff_clk_freq'));

% Get the maximum I/Q buffer length
maximum_buffer_len = wl_basebandCmd(node_tx, ifc_ids.RF_ALL, 'tx_buff_max_num_samples');

% Set the transmission / receptions lengths (in samples)
tx_length    = 2^12;

% Check the transmission length
if (tx_length > maximum_buffer_len)
    error('Node supports max transmission length of %d samples.  Requested %d samples.', maximum_buffer_len, tx_length);
end

% Set the length for the transmit and receive buffers based on the transmission length
wl_basebandCmd(nodes, 'tx_length', tx_length);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Signal processing to generate transmit signal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Create the IQ data payload
t = [0:ts_tx:((tx_length - 1) * ts_tx)].';                      % Create time vector (Sample Frequency is ts_tx (Hz))

sinusoid_1    = 0.6 * exp(j*2*pi * 1e6 * t);                    % Create  1 MHz sinusoid
sinusoid_2    = 0.6 * exp(j*2*pi * 1e6 * t + j*pi);                    % Create 50 kHz sinusoid to transmit on RF_B

% tx_data       = [sinusoid_1];                                   % Create the data to transmit on RF_A
tx_data       = [sinusoid_1, sinusoid_2];                       % Create the data to transmit on both RF_A and RF_B

% Transmit IQ data to the TX node
wl_basebandCmd(node_tx, [ifc_ids.RF_A, ifc_ids.RF_B], 'write_IQ', tx_data);                      % Write each sinusoid to a different interface

% Enable the buffers for TX / RX
wl_basebandCmd(node_tx, ifc_ids.RF_ON_BOARD, 'tx_buff_en');   % Enable both RF_A and RF_B

% Send the Ethernet trigger to start the TX / RX
eth_trig.send();

% Disable the buffers and RF interfaces for TX / RX
wl_basebandCmd(nodes, ifc_ids.RF_ON_BOARD, 'tx_rx_buff_dis');           % Disable both RF_A and RF_B
wl_interfaceCmd(nodes, ifc_ids.RF_ON_BOARD, 'tx_rx_dis');               % Disable both RF_A and RF_B


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Visualize results
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

figure(1);clf;

% Plot IQ Data
%
ax(1) = subplot(3, 2, 1);
plot(0:(length(tx_data) - 1), real(tx_data(:, 1)))
xlabel('Sample Index')
title('Node 1 RFA: Transmitted I')
axis([1 tx_length -1 1])

ax(2) = subplot(3, 2, 2);
plot(0:(length(tx_data) - 1), imag(tx_data(:, 1)))
xlabel('Sample Index')
title('Node 1 RFA: Transmitted Q')
axis([1 tx_length -1 1])




Error:


>> basic_phase_shift_tx
Error using wl_baseband_buffers/procCmd (line 394)
tx_buff_max_num_samples: buffer selection must be singular. Use vector notation for reading from multiple buffers e.g. [RFA, RFB]

Error in wl_baseband_buffers/subsref (line 142)
            varargout{:} = builtin('subsref', obj, S);

Error in wl_node/wl_basebandCmd (line 298)
                    out(n) = currNode.baseband.procCmd(n, currNode, varargin{:});

Error in basic_phase_shift_tx (line 42)
maximum_buffer_len = wl_basebandCmd(node_tx, ifc_ids.RF_ALL, 'tx_buff_max_num_samples');

Offline

 

#6 2018-Jun-29 14:01:49

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 4924

Re: full_duplex

Error using wl_baseband_buffers/procCmd (line 394)
tx_buff_max_num_samples: buffer selection must be singular. Use vector notation for reading from multiple buffers e.g. [RFA, RFB]

This error message is clear - you need to use the correct format for the arguments.

You need to attempt to solve these sort of errors yourself before asking us to solve them for you. Posting your entire script every time you get an error is not an effective use of these forums.

Offline

 

Board footer