Main Content

Capture Over-the-Air Signals

You can use theCommunications Toolbox™ Support Package for Xilinx®Zynq®-Based Radiotogether with a supported SDR device to capture over-the-air signals to the MATLAB®workspace.

Capture RF Data to Baseband File Using Analog Devices AD9361/AD9364

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

If your radio hardware is already configured for host-radio communication, skip this section. To configure your radio hardware for host-radio communication, follow the steps in theGuided Host-Radio Hardware Setup. Attach an antenna suitable for the 88–108 MHz band to the first RX channel.

Configure Receiver System Object

创建一个receiver System object with the specified properties. The specified center frequency corresponds to a local FM station. If you have an FMCOMMS5 radio hardware, set设备名称to'FMCOMMS5'.

stationCenterFrequency = 95 e6;设备名称='AD936x'; rx = sdrrx(deviceName,'BasebandSampleRate',528e3,...'CenterFrequency',stationCenterFrequency,'OutputDataType','Double');

Initiate Data Capture to File

Call thecapturefunction, specifying the receiver object, a capture duration, and a file name. The function returns the captured data in a file named "FMRecording.bb". After capturing the FM signal, unlock the receiver object by using thereleasefunction.

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

Demodulate FM Recording

创建一个comm.BasebandFileReaderSystem object to read the captured signal and extract frames of data from the file. Set the baseband file reader to take 4400 samples per frame when reading the saved baseband signal.

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

Use theBasebandSampleRatefield of the baseband file reader object to set theSampleRateproperty of the demodulator. You can find theBasebandSampleRatefield in theMetaDatastructure. Create acomm.FMBroadcastDemodulatorSystem object. Demodulate and play back each frame of the FM data. Use awhileloop 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

See Also

Functions

Objects