This model shows how to use the Universal Software Radio Peripheral® (USRP®) device with Simulink® to build an FM stereo receiver. The model plays out the left and right channels.
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 Getting Started for details on configuring your host computer to work with the SDRu Receiver block.
|On this page…|
This is the top-level block diagram of the model.
The USRP® hardware samples its received signal at 100 Msps, then decimates by a factor of 500 for a resultant sample rate of 200 kHz. Prior to FM demodulation, a rate converter resamples the signal again to a rate of 152 kHz. This sample rate is convenient for downstream processing in the stereo decoder. An FM demodulator follows the 152 kHz resampler, and is implemented in the same fashion as the one described in FM Monophonic Receiver with USRP® Hardware.
Below is the block diagram of the stereo decoder inside the FM Receiver subsystem.
The peaking filter picks out the 19 kHz pilot tone, from which a 38 kHz carrier is created via an open loop technique. The technique exploits trigonometric identities and the fact that the 19 kHz tone is sampled precisely eight times per cycle. The carrier is used to downconvert the L-R signal, centered at 38 kHz, to baseband. The Gain Compensation is to compensate for the L-R signal loss during the transmission. A resampler then converts the sampling rate to 48 kHz. This rate is one of the native sampling rates of the output audio device. During the rate conversion, the resampling filter removes the undesirable signals above 15 kHz. Next, the baseband L+R and L-R signals pass through a 75 microsecond deemphasis filter [ 1 ]. Finally, a MATLAB® Function block separates the L and R signals, and the audio device plays them out.
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.
If you insert a Spectrum Scope block right before the 19n/6 resampler, the spectrum looks like the following. The black spectrum contains L+R at baseband, L-R at 38 kHz, and the 19 kHz tone. The red spectrum is the downconverted signal with L-R at baseband.
The figure below shows the spectrum of the left (black) and the right (red) channel corresponding to the spectrum above. This spectrum represents music from a broadcast FM station. There is some stereo separation between the left and the right channel up to 20 kHz.
The figure below illustrates the separation between left and right channels achieved by the model with a known, controlled source. It shows the spectrum of the left (black) and the right (red) channel for a stereo test signal transmitted by a hand-held FM transmitter. The test signal consists of a single 500 Hz tone in the left channel and a single 1 kHz tone in the right channel. The model achieves approximately 20 dB separation between left and right channels.
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.
To optimize the filtering speed, you can combine the resampling filter in the 19n/6 resampler and the deemphasis filter into a single filter.
MIDI Controller for Station Selection
The FM Stereo Receiver with USRP® Hardware and MIDI ControllerFM Stereo 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.