Capture 1.6 GHz Bandwidth Spectrum Using Multiple Antennas
This example shows how to configure a USRP™ X410 radio as a baseband receiver to capture and plot a spectrum with a 1.6 GHz bandwidth by combining data from multiple antennas.
Introduction
Next generation wireless communication technologies utilize bandwidths in excess of 1 GHz. To capture wide bandwidths with a software-defined radio (SDR), you can use multiple antennas that capture the maximum bandwidth at different center frequencies, then combine the captured data. In this example, you use the baseband receiver object to capture a 1.6 GHz frequency bandwidth by combining data from four radio antennas with different center frequencies. Then, you combine the data and plot a spectrogram.
Set Up Radio
Call the radioConfigurations
function. The function returns all available radio setup configurations that you saved using the Radio Setup wizard.
savedRadioConfigurations = radioConfigurations;
To update the dropdown menu with your saved radio setup configuration names, click Update. Then select the radio to use with this example.
savedRadioConfigurationNames = [string({savedRadioConfigurations.Name})]; radio =savedRadioConfigurationNames(1)
; if(~strcmp(hRadioHardware(radio),'USRP X410')) error("Radio not supported. To run this example, use a USRP X410 radio.") end
Configure Baseband Receiver
Create a basebandReceiver
object with the specified radio. Because the object requires exclusive access to radio hardware resources, before running this example for the first time, clear any other object associated with the specified radio. In subsequent runs, to speed up the execution time of the example, reuse your new workspace object.
if ~exist("bbrx","var") bbrx = basebandReceiver(radio); end
To capture the largest possible combined bandwidth, set the SampleRate property to the maximum supported value, which is 500 MHz. Set the single antenna bandwidth to the maximum supported instantaneous bandwidth, which is 400 MHz.
bbrx.SampleRate = 500e6; singleAntennaBandwidth = 400e6;
Set the Antennas property to a value that corresponds to the four capture radio antennas.
bbrx.Antennas = ["DB0:RF0:RX1", "DB0:RF1:RX1", "DB1:RF0:RX1", "DB1:RF1:RX1"];
Configure the baseband receiver to return the captured data in single precision.
bbrx.CaptureDataType = "single";
Set the radio gain according to the local signal strength.
bbrx.RadioGain =
40;
Set the center frequency for each antenna by shifting the center frequency of the combined band by half of the single antenna bandwidth.
centerFrequency =2.45e9; bbrx.CenterFrequency = centerFrequency + ... [-3*singleAntennaBandwidth/2, -singleAntennaBandwidth/2, ... singleAntennaBandwidth/2, 3*singleAntennaBandwidth/2];
Capture IQ Data
To capture IQ data from the specified antennas, call the capture
function on the basebandReceiver
object, bbrx
. Specify a capture length of 50 ms.
captureLength = milliseconds(
50);
data = capture(bbrx,captureLength);
Resample and Combine Captured Data
Use the hResampleX410Data
helper function to resample the captured data and combine the data from each antenna. The helper function does the following:
Performs a fast Fourier transform (FFT) on the data from each antenna to convert it to the frequency domain.
Removes the frequency components outside the desired bandwidth.
Combines the filtered signal into a single time-domain signal.
data = hResampleX410Data(data);
Plot Spectrogram
Plot the spectrogram of the resampled data. This example uses 4096 FFT points and a 50% overlapping Hann window of length equal to the length of the resampled data divided by 4096. Alternatively, you can experiment with custom values.
nFFT =4096; window =
hann(floor(length(data)/4096)); nOverlap =
floor(length(window)/2); combinedBandwidth = numel(bbrx.Antennas)*singleAntennaBandwidth; spectrogram(data,window,nOverlap,nFFT,combinedBandwidth,"centered"); colormap turbo
To call the capture function again and to update the spectrum analyzer by rerunning the current section, click Capture and plot frequency spectrum.