This example shows how to build an FM mono or stereo receiver using Simulink® and Communications System Toolbox™. You can either use captured signals or receive signals in real time using the Communications System Toolbox Support Package for RTL-SDR Radio.
To run this example using captured signals, you need the following software:
To receive signals in real time, you also need the following hardware:
and the following software
For a full list of Communications System Toolbox supported SDR platforms, refer to Supported Hardware section of Software Defined Radio (SDR) discovery page.
For an introduction on the FM broadcasting technology and demodulation of these signals, refer to the FM Broadcast Receiver Using MATLAB example.
To run the example using captured signals, select the
FM Broadcast Captured Signal block as the source using the
Signal Source Selector block. Then click the run button.
To run the example using the RTL-SDR radio as the source, select the
RTL-SDR Receiver block as the source using the
Signal Source Selector block. Double-click the
Center Frequency (MHz) block and select the value to the center frequency to a broadcast FM radio station near you.
If you hear some dropouts or delay in the sound, run the model in Accelerator mode. From the model menu, select Simulation->Accelerator, then click the run button. If you still experience dropouts or delay in Accelerator mode, try running the model in Rapid Accelerator mode.
The following block diagram summarizes the receiver structure. The processing has three main parts: Signal Source, FM broadcast demodulation, and audio output.
This example can use two signal sources:
''Captured Signal'': Over-the-air signals written to a file and sourced using a baseband file reader block at 240e3 samples/sec.
''RTL-SDR Radio'': RTL-SDR radio at 240e3 samples/sec. Set the center frequency to a broadcast FM radio station near you.
FM Broadcast Demodulation
The baseband samples received from the signal source are processed by the
FM Broadcast Demodulation Baseband block. This 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 de-emphasis lowpass filter time constant is set to 75 microseconds. This example processes received stereo signals. The demodulator can also process mono signals.
To perform stereo decoding, the FM Broadcast Demodulator Baseband object 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 FM Broadcast Demodulator Baseband 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 de-emphasis filter . The FM Broadcast Demodulator Baseband block separates the L and R signals and converts them to the 48 kHz audio signal.
Audio Device Writer
Play the demodulated audio signals through your computer's speakers using the
Audio Device Writer block.
To further explore the example, you can vary the center frequency of the RTL-SDR radio and listen to other radio stations using the
Center Frequency (MHz) block.
You can set the Stereo property of the
FM Broadcast Demodulator Baseband block to false to process the signals in mono fashion and compare the sound quality.