# Decimation to listen to FM radio with gnu radio

I am trying to listen to FM station using an SDR and GNU radio. I have followed this procedure

Is there a reason that the decimation is done gradually? For example would it make a difference if I change audio decimation to 1 in WBFM Receive and change the decimation to 50 in rational resampler block?

One reason in general to perform decimation in multiple steps is it reduces the computational requirements of the low-pass filtering. To achieve a sharp transition width in the filter requires a longer convolution kernel and thus, more computation. Also the sample rate is very high before decimation, requiring yet more computational power.

So generally, we want the sample rate to be as low as possible at each stage. The minimum sample rate will be dictated by the Nyquist Theorem.

What we can do instead is use a less sharp filter, then decimate, then another less sharp filter, then decimate again, and so on. There's a further advantage here in that the tails of the filter can extend beyond the output bandwidth such that they alias or "wrap around", since further filtering and decimation steps will remove that aliasing. The filter just needs to be narrow enough to avoid aliasing into what will eventually be the passband.

Thus by filtering and decimating in multiple stages we can use fast filters where the sample rate is high, and put the more expensive filters with the sharper transition where the sample rate is low.

In this particular case, the aim was to get from a sample rate of 20M to 480k. That's a ratio of:

$$20000000 / 480000 \approx 41.666$$

We can't decimate by fractional samples, so we must write that as a ratio of integers:

$${20000000 \over 480000} = {500 \over 12}$$

GNU Radio's low-pass filter block can perform decimation but not interpolation, so we can refactor that fraction as:

$${20000000 \over 480000} = {100 \over 1} \cdot {5 \over 12}$$

Since 5 is prime, that 5/12 fraction can't be refactored any more. We usually don't want to interpolate any more than we need to since that just creates more data that must be processed, so this is the cheapest way to do it. And you'll notice these numbers (100, 5, 12) match the parameters in your blocks.

The FM demodulator further decimates its audio output after demodulation by a factor of 10 to get 48kHz since this is a common audio rate, and covers the entire range of human hearing.

would it make a difference if I change audio decimation to 1 in WBFM Receive and change the decimation to 50 in rational resampler block?

This would reduce the sample rate into the WBFM demodulator to 48k. On the plus side, it will require less computational power with the lower sample rate.

However, the passband of the low-pass filter upstream is 75k, with a transition of 25k. That means the signal coming out of that filter has a bandwidth of:

$$2(75 + 25) = 200\:\mathrm{kHz}$$

Thus, it can't be represented with a sample rate less that 200k. If you were to decimate this to 48k the excess bandwidth would cause aliasing, and you'd be feeding the demodulator garbage.

• thank you but I think the aim is to get from 20M to 48K and not 480K. In that case my question is why we don't decimate by 50 instead of 5 and then set FM demodulator decimation value to 1.
– Jack
Aug 4 '16 at 14:30
• How are you going to fit a 150KHz wide modulated FM signal in a sample rate of 48k? Aug 4 '16 at 14:42
• Got it, thanks. Should always pay attention to Nyquist!
– Jack
Aug 4 '16 at 15:24
• I am still confused a bit. Where did 150 KHz come from? Is 480 K a fixed value that has to be input for the FM demodulator?
– Jack
Aug 11 '16 at 23:55
• 150 kHz is the width of the pass-band (from -75 kHz to +75 kHz) of your low-pass filter, which implies your FM signal is at most 150 kHz wide. 150 kHz wide signals, on a 200 kHz channel spacing (to allow for some guard band between stations) seems reasonable for commercial FM broadcasts in many parts of the world. Aug 12 '16 at 14:51

For example would it make a difference if I change Audio Decimation to 1 in WBFM Receive and change the Decimation to 50 in Rational Resampler block?

Why don't you try? GNU Radio lends itself very well to experimentation, and by attaching signal visualizations (mainly, frequency sinks), you could combine your theoretical with your practical knowledge.

However, this will not really work. For frequency modulation, you can't have a input signal bandwidth equal to the output signal bandwidth (decimation is the ratio $\frac{\text{input sampling rate}}{\text{output sampling rate}}$); in "which" spectrum would the modulation take place?

Your question shows that you might want to brush up your knowledge on what FM is, and how signals are represented in digital signal processing.

I've seen you ask similar question; I'd strongly suggest going through the official guided GNU Radio tutorials. They really explain a lot of the concepts you're missing here. Also, things like "Great Scott's Gadgets introduction to complex numbers (signals)" is a great starting point for SDR adventures!

• ups, misread a "5" for a "1" in your flow graph. Aug 3 '16 at 18:25
• It is working fine, you forgot to do the decimation for rational resampler block your answer should decide by 5
– Jack
Aug 3 '16 at 18:25
• I got the flow graph from great Scott gadget!!
– Jack
Aug 3 '16 at 18:30