Main Content

Capture RF Data to Baseband File Using ADALM-PLUTO Radio

Use the capture function and an ADALM-PLUTO radio to record RF signals for post-capture processing in MATLAB®. Save an FM broadcast signal to a file as baseband samples. Read the file containing the recorded signal and demodulate the baseband samples.

Configure SDR Hardware

To configure your ADALM-PLUTO radio for host-radio communication, see Guided Host-Radio Hardware Setup.

Attach an antenna suitable for the 88-108 MHz band to the first RX channel. The FM radio band is outside the default tuning range for the ADALM-PLUTO radio. The configurePlutoRadio function enables you to extend the frequency range and use your ADALM-PLUTO radio outside the qualified tuning range. The extended frequency range includes the full FM radio band.

configurePlutoRadio('AD9364');
## Establishing connection to hardware. This process can take several seconds.

Configure Receiver System Object

Create an SDR receiver System object with the specified properties. The specified center frequency corresponds to a local FM station.

deviceName = 'Pluto';
samplerate = 528e3;
fmStationFrequency = 88.9e6; % Adjust to select an FM station nearby
rx = sdrrx(deviceName,'BasebandSampleRate',samplerate, ...
    'CenterFrequency',fmStationFrequency,'OutputDataType','double');

Initiate Data Capture to File

Call the capture function, specifying the receiver object, capture duration, and file name. After capturing the FM signal, unlock the receiver object using the release function.

capture(rx,5,'Seconds','Filename','FMRecording.bb');
## Establishing connection to hardware. This process can take several seconds.
release(rx);

Demodulate FM Recording

Create a comm.BasebandFileReader System object to read the captured signal and extract frames of data from the file. Set baseband file reader to take 4400 samples per frame when reading the saved baseband signal.

bbr = comm.BasebandFileReader('FMRecording.bb');
bbr.SamplesPerFrame = 4400;

Use the BasebandSampleRate field of the baseband file reader object to set the SampleRate property of the demodulator. Find the BasebandSampleRate field in the MetaData structure. Create a comm.FMBroadcastDemodulator System object. Demodulate and play back each frame of the FM data. Use a while loop to read all frames of the captured data.

fmbDemod = comm.FMBroadcastDemodulator('AudioSampleRate',48e3, ...
    'SampleRate',bbr.Metadata.BasebandSampleRate,'PlaySound',true);
while ~isDone(bbr)
    fmbDemod(bbr());
end