torstai 23. toukokuuta 2019

Stereo FM receiving with RTL-SDR and Gnuradio - part 3

This is third part of the stereo FM broadcast demodulation using rtl-sdr and GnuRadio Companion. In this part I describe another method for doing the stereo demodulation.

  • Part 1 shows how the mono signal is received and how the stereo signal is modulated.
  • Part 2 shows how I implemented a stereo demodulator.

Introduction

While investigating how to receive the stereo FM broadcast, I came across this document, which describes an FPGA implementation of a stereo receiver. Interesting part of it was how to demodulate the stereo signal.

According to the document, stereo signal can be just sampled at the positive and negative peaks of the 38 kHz carrier and then hold until next peak. Low-pass filtering this should provide the original stereo signal.

I wondered if this really was possible on night when I couldnt sleep, and came to conclusion that it is indeed possible. Considering the equation for streo modulation

Streo FM broadcast modulation


and forgetting about the 19 kHz pilot for now, we can see that when the 38 kHz carrier () is at positive peak (1.0), then the signal is 0.5*(A+B)+0.5*(A-B)=A i.e. the left channel. When the carrier is at negative peak (-1.0) the signal is 0.5*(A+B)-0.5*(A-B)=B i.e. the right channel.

I also wrote a python script to show this graphically:
Sampling the signal to regenerate left and right signals

In the figure the 38 kHz carrier is shown with cyan and the FM baseband signal in black. Blue line shows the original left channel data and red shows the original right channel data. Blue dots show signal sampling points in positive peak of the carrier and red dots at negative peak.

The figure clearly shows that the sampling indeed does recreate the original waveforms.

GRC implementation

I implemented the sampling method in GRC. Following figure shows how the demodulator looks. It is very similar to the previous method (e.g. 38 kHz carrier recovery etc), but maybe a bit simpler looking.

Sampling type stereo FM demodulator

 I also uplodaded the GRC file to GitHub.

Once again I used the python script to generate ramp signals and wav file source to test the demodulator. The "received" signals look correct with this method also.

Demodulated left and right test signals with sampling method