FM Receiver with USRP® Hardware
This model shows how to use the Universal Software Radio Peripheral® (USRP®) device with Simulink® to build an FM receiver.
In order to run this model, you need a USRP® board with an appropriate receiver daughterboard that supports the FM band (e.g., TVRX or WBX). Please refer to the Setup and Configuration section of Documentation for USRP® Radio for details on configuring your host computer to work with the SDRu Receiver block.
Structure of the Example
This is the top-level block diagram of the model.
The SDRu Receiver block takes in the baseband discrete-time complex samples from the USRP® hardware. The master clock rate and decimation factor are set to obtain sample rate of 200 kHz at the output of the SDRu Receiver block. For example, for a B210 radio, set MasterClockRate to 20 MHz and DecimationRate to 100. For N200, N210, and USRP2 radios master clock rate is fixed at 100 MHz.
The FM Broadcast Demodulator Baseband block converts the sampling rate of 240 kHz to 48 kHz, a native sampling rate for your host computer's audio device. According to the FM broadcast standard in the United States, the deemphasis lowpass filter time constant is set to 75 microseconds.
To perform stereo decoding, the FM Broadcast Demodulator Baseband block uses a peaking filter which picks out the 19 kHz pilot tone from which the 38 kHz carrier is created. Using the obtained carrier signal, the block downconverts the L-R signal, centered at 38 kHz, to baseband. Afterwards, the L-R and L+R signals pass through a 75 microsecond deemphasis filter . The FM Broadcast Demodulator Baseband block separates the L and R signals and converts them to the 48 kHz audio signal. Note that, if you uncheck the Stereo audio parameter of the block, the demodulator process the signals in a mono fashion.
Set the Center Frequency to a local FM radio station, click the run button, and listen to the sound from the audio device. Change the Center Frequency to listen to a different station.
If you hear some dropouts or delay in the sound, run the model under Accelerator mode. From the model menu, select Simulation->Accelerator, then click the run button.
Exploring the Example
If you have your own FM transmitter that can transmit .wma files, you can duplicate the test that shows the channel separation result above. Load the sdruFMStereoTestSignal.wma file into your transmitter. The channel separation can be easily observed from the Spectrum Scope block and heard from the audio device. You can also adjust the Gain Compensation to see its effect on stereo separation.
MIDI Controller for Station Selection
The FM Receiver with USRP® Hardware and MIDI Controller example includes a MIDI Controls block. If you have a MIDI controller connected to your computer, you can change the center frequency, i.e. FM radio station, using the controller.
USRP® is a trademark of National Instruments Corp.