After you have run wideband_twonode_cal, it is a good idea to test and see whether the beams are being formed in the correct directions. If not, it would indicate that the calibration was done incorrectly. Run the script demo_beamforming.m
. As you can see, this script demonstrates both RX and TX beamforming.
% RX Beamforming. TX: node1, RX: node2
node_tx = node1;
node_rx = node2;
subplotIndex = 3;
demo_beamforming_rx_v2;
node2 = node_rx;
node1 = node_tx;
clear node_tx node_rx;
% RX Beamforming. TX: node2, RX: node1
node_tx = node2;
node_rx = node1;
subplotIndex = 4;
demo_beamforming_rx_v2;
node1 = node_rx;
node2 = node_tx;
clear node_tx node_rx;
% TX Beamforming. TX: node1, RX: node2
node_tx = node1;
node_rx = node2;
subplotIndex = 1;
demo_beamforming_tx_v2;
node2 = node_rx;
node1 = node_tx;
clear node_tx node_rx;
% TX Beamforming. TX: node2, RX: node1
node_tx = node2;
node_rx = node1;
subplotIndex = 2;
demo_beamforming_tx_v2;
node2 = node_tx;
node1 = node_rx;
clear node_tx node_rx;
In RX beamforming (using demo_beamforming_rx_v2.m
), the TX node uses just one antenna to transmit a wideband signal. The RX node captures and receives the signal from each of the 4 antennas. On these captured signals, it sequentially applies different beamforming vectors, corresponding to different directions. These beamforming vectors are geometrically determined. In each case, the RX measures the total power received within the band of interest. This is shown in MATLAB Figure 1. When node1
is the TX (single channel) and node2
is the RX (applying the beamforming), the results are shown in (row 2, column 1) . When node2
is the TX (single channel) and node1
is the RX (applying the beamforming), the results are shown in (row 2, column 2) . As you can see, demo_beamforming_rx_v2
runs very quickly because all the beamforming is performed in one iteration; in other words, the TX transmits omni-directionally, and the RX can look in all directions simultaneously.
Row 1 is for TX beamforming, and Row 2 is for RX beamforming. Column 1 is for the case where the signal is being sent from node1
to node2
. Column 2 is for the case where the signal is being sent from node2
to node1
. The beams indicate that the calibration is done adequately.
In TX beamforming (using demo_beamforming_tx_v2.m
), the TX sequentially applies different beamforming vectors in order to transmit in different directions (one direction at a time). The RX uses just one antenna (omni-directional), and plots the power it received in the frequency band of interest. This is shown in MATLAB Figure 1. When node1
is the TX (applying the beamforming) and node2
is the RX (single channel), the results are shown in (row 1, column 1) . When node2
is the TX (applying the beamforming) and node1
is the RX (single channel), the results are shown in (row 1, column 2) . The demonstration using demo_beamforming_tx_v2 runs rather slowly, because there is one capture cycle for each angle of departure at the TX, and the TX has to sequentially scan through all all possible beamforming directions.
This simple example (also known as spatial correlation) has shown you how to form TX and RX beams. Look at the code (demo_beamforming_rx_v2
and demo_beamforming_tx_v2
) to figure out where the beamforming vectors are actually calculated and applied. Perhaps you could try the following:
node1
by approximately 25 degrees. Rerun demo_beamforming
, and observe what happens.node2
. Or perhaps even turn both node1
and node2
.