### Author Topic: How to sample FM  (Read 1006 times)

0 Members and 1 Guest are viewing this topic.

#### mariolucas75

• Contributor
• Posts: 11
• Country:
##### How to sample FM
« on: September 22, 2021, 10:45:22 am »
Dear All,

I am not sure whether this is the right place to post a question (may be it should go beginners section)...

To sample a signal it is needed to have a sampling rate at least twice as the signal frequency... suppose i want to capture high frequency signal ~ 100Mhz so what does it mean - my SDR should have 200 Ms/s (mega samples / sec) rate ?

If I have a FM signal - lets say carrier freq is 100Mhz and after modulation bandwidth  is +  - 100 Khz either side, so it means that my signal will have chunks of frequencies - min 100Mhz-100khz and max 100Mhz+100Khz... and i want to view  / visualize this signal in time domain..... in another words something like a "spring with compressed coils or stretched coils".... so to sample that signal and try to visualize it do i need sampling rate two times (~ 200 Ms /s ) more ? Or how to do it ?

Pls help

#### RoGeorge

• Super Contributor
• Posts: 3504
• Country:
##### Re: How to sample FM
« Reply #1 on: September 22, 2021, 12:43:21 pm »
If f0 is 100MHz with +/-100kHz deviation, than we can translate the spectrum around 0Hz, so we will have $\Delta f = 200kHz$ which will require a Nyquist sampling at 400 kilosamples/s (400kSa/s).

If I got your question wright, what you are looking for is decimation.

In decimation, if it were to have all the samples taken at 200 MSa/s, than we can simply keep only each 50th sample and discard the other samples.  That way we would get the same samples as if it we were sampling at 400 kSa/s (every 50th because 200 MSa/s = 200_000 kSa/s = 50 * 400 kSa/s).

Keep in mind that decimation will fold down other spectral components into the same band, so usually this is done by first applying a low pass filter over all of the high speed 200 MSa/s samples, and only after filtering we can throw away the rest of the samples and keep only each 50th sample after low pass filtering the original high speed signal.

The low pass filter in this numerical example must be at 200kHz, to cut out any higher spectral components.  This is necessary only if higher than 200kHz frequencies are present in the FM signal, because by decimation all other multiple of 200kHz bands (e.g. 400kHz-600kHz, or 91.8MHz to 92.0MHz, etc.) will be folded into the first 200kHz, too, and there is no way to distinguish which is which.
« Last Edit: September 22, 2021, 12:53:37 pm by RoGeorge »

The following users thanked this post: mariolucas75

#### mariolucas75

• Contributor
• Posts: 11
• Country:
##### Re: How to sample FM
« Reply #2 on: September 22, 2021, 12:56:20 pm »
Dear RoGeorge,

Thank you so much for your reply...
So it is possible to view real-time FM station signal obtained through rtl-sdr in time domain as a signal with chunks of different frequencies like a "spring with compressed or stretched  coils" (the way FM is symbolically drawn in books ) ?

Or how to do it....

Sorry if my question sounds silly ... i am new but desperately want to learn this.....

#### srce

• Regular Contributor
• Posts: 172
• Country:
##### Re: How to sample FM
« Reply #3 on: September 22, 2021, 12:57:49 pm »
To sample a signal it is needed to have a sampling rate at least twice as the signal frequency... suppose i want to capture high frequency signal ~ 100Mhz so what does it mean - my SDR should have 200 Ms/s (mega samples / sec) rate ?

If I have a FM signal - lets say carrier freq is 100Mhz and after modulation bandwidth  is +  - 100 Khz either side, so it means that my signal will have chunks of frequencies - min 100Mhz-100khz and max 100Mhz+100Khz... and i want to view  / visualize this signal in time domain..... in another words something like a "spring with compressed coils or stretched coils".... so to sample that signal and try to visualize it do i need sampling rate two times (~ 200 Ms /s ) more ? Or how to do it ?
You could do it by sampling at 200MS/s, but this isn't the way most radios work.

They work by mixing the received signal with a 100MHz local oscillator which downconverts the 100MHz signal to baseband, so you get a signal 200kHz wide centred at 0Hz (Or a low IF such as 1MHz). Thus your ADC only needs to run at 2 MHz not 200 MHz. The circuitry for this is inside your SDR.

Google for Superheterodyne receiver.

#### langwadt

• Super Contributor
• Posts: 2823
• Country:
##### Re: How to sample FM
« Reply #4 on: September 22, 2021, 01:16:41 pm »
If f0 is 100MHz with +/-100kHz deviation, than we can translate the spectrum around 0Hz, so we will have $\Delta f = 200kHz$ which will require a Nyquist sampling at 400 kilosamples/s (400kSa/s).

If I got your question wright, what you are looking for is decimation.

In decimation, if it were to have all the samples taken at 200 MSa/s, than we can simply keep only each 50th sample and discard the other samples.  That way we would get the same samples as if it we were sampling at 400 kSa/s (every 50th because 200 MSa/s = 200_000 kSa/s = 50 * 400 kSa/s).

Keep in mind that decimation will fold down other spectral components into the same band, so usually this is done by first applying a low pass filter over all of the high speed 200 MSa/s samples, and only after filtering we can throw away the rest of the samples and keep only each 50th sample after low pass filtering the original high speed signal.

The low pass filter in this numerical example must be at 200kHz, to cut out any higher spectral components.  This is necessary only if higher than 200kHz frequencies are present in the FM signal, because by decimation all other multiple of 200kHz bands (e.g. 400kHz-600kHz, or 91.8MHz to 92.0MHz, etc.) will be folded into the first 200kHz, too, and there is no way to distinguish which is which.

if you want the ~100MHz +/-100kHz signal from your 200MSa/s, you a bandpass filter around ~100MHz not a lowpass before decimation...

#### langwadt

• Super Contributor
• Posts: 2823
• Country:
##### Re: How to sample FM
« Reply #5 on: September 22, 2021, 01:18:47 pm »
To sample a signal it is needed to have a sampling rate at least twice as the signal frequency... suppose i want to capture high frequency signal ~ 100Mhz so what does it mean - my SDR should have 200 Ms/s (mega samples / sec) rate ?

If I have a FM signal - lets say carrier freq is 100Mhz and after modulation bandwidth  is +  - 100 Khz either side, so it means that my signal will have chunks of frequencies - min 100Mhz-100khz and max 100Mhz+100Khz... and i want to view  / visualize this signal in time domain..... in another words something like a "spring with compressed coils or stretched coils".... so to sample that signal and try to visualize it do i need sampling rate two times (~ 200 Ms /s ) more ? Or how to do it ?
You could do it by sampling at 200MS/s, but this isn't the way most radios work.

They work by mixing the received signal with a 100MHz local oscillator which downconverts the 100MHz signal to baseband, so you get a signal 200kHz wide centred at 0Hz (Or a low IF such as 1MHz). Thus your ADC only needs to run at 2 MHz not 200 MHz. The circuitry for this is inside your SDR.

Google for Superheterodyne receiver.

and if the ADC has enough analog bandwidth (fast enough sample hold) the sampling itself can do the mixing

#### srce

• Regular Contributor
• Posts: 172
• Country:
##### Re: How to sample FM
« Reply #6 on: September 22, 2021, 01:26:58 pm »

and if the ADC has enough analog bandwidth (fast enough sample hold) the sampling itself can do the mixing

It sounds like he's using an RTL SDR though - which is a superhet receiver with 2.4MSa/s ADC.

#### srce

• Regular Contributor
• Posts: 172
• Country:
##### Re: How to sample FM
« Reply #7 on: September 22, 2021, 01:29:10 pm »

So it is possible to view real-time FM station signal obtained through rtl-sdr in time domain as a signal with chunks of different frequencies like a "spring with compressed or stretched  coils" (the way FM is symbolically drawn in books ) ?

Or how to do it....
You can use the Channel Analyzer plugin in SDRangel with your RTL SDR: https://github.com/f4exb/sdrangel/blob/master/plugins/channelrx/chanalyzer/readme.md - this will of course show you the downconverted signal (but should be pretty much what you want to see)
« Last Edit: September 22, 2021, 01:31:31 pm by srce »

#### RoGeorge

• Super Contributor
• Posts: 3504
• Country:
##### Re: How to sample FM
« Reply #8 on: September 22, 2021, 01:32:43 pm »
So it is possible to view real-time FM station signal [ ... ... ] like a "spring with compressed or stretched  coils" (the way FM is symbolically drawn in books ) ?

Most probably, no.  Because the "spring stretches" would be too small to notice them, even if you somehow "freeze" the 100 MHz carrier and zoom in into the signal.

What are you trying to see, or do?
- if it's just for learning, you can use Octave, or an online tool like Geogebra to plot FM modulated signals and see for yourself how the 100MHz FM modulated carrier will look like
- if it's just to make a cool display/visualization of the live signal from an FM station, then even when sampled at 200MSa/s I think you wouldn't distinguish much details (to "see" the FM modulation).

Depending on the final goal you have, it might be either possible or impossible to see a stretching spring-like waveform with an SDR.

So what is your final goal with it?  Why do you want to see the stretching spring?  What do you hope to get out of it?

#### RoGeorge

• Super Contributor
• Posts: 3504
• Country:
##### Re: How to sample FM
« Reply #9 on: September 23, 2021, 11:06:52 am »
If f0 is 100MHz with +/-100kHz deviation, than we can translate the spectrum around 0Hz, so we will have $\Delta f = 200kHz$ which will require a Nyquist sampling at 400 kilosamples/s (400kSa/s).

If I got your question wright, what you are looking for is decimation.

In decimation, if it were to have all the samples taken at 200 MSa/s, than we can simply keep only each 50th sample and discard the other samples.  That way we would get the same samples as if it we were sampling at 400 kSa/s (every 50th because 200 MSa/s = 200_000 kSa/s = 50 * 400 kSa/s).

Keep in mind that decimation will fold down other spectral components into the same band, so usually this is done by first applying a low pass filter over all of the high speed 200 MSa/s samples, and only after filtering we can throw away the rest of the samples and keep only each 50th sample after low pass filtering the original high speed signal.

The low pass filter in this numerical example must be at 200kHz, to cut out any higher spectral components.  This is necessary only if higher than 200kHz frequencies are present in the FM signal, because by decimation all other multiple of 200kHz bands (e.g. 400kHz-600kHz, or 91.8MHz to 92.0MHz, etc.) will be folded into the first 200kHz, too, and there is no way to distinguish which is which.

if you want the ~100MHz +/-100kHz signal from your 200MSa/s, you a bandpass filter around ~100MHz not a lowpass before decimation...

I guess I was using the wrong words.  AFAIK it's a low pass filter, not a band pass, and the cutting frequency is as low as the bandwidth of interest, near zero Hz.

The signal path for decimation is like this:

1. Analog signal with spectrum between 0-100 MHz --->
2. High speed ADC sampling (200 MSa/s) --->
3. Keep only the Nth sample and make all the other samples zero (so we still have 200 MSa/s) --->
4. Apply low pass filter to keep only the bandwidth of interest (200 kHz) --->
5. Copy each Nth sample into a new array, this last array is at low sampling rate (400 kSa/s), it's the final result of the decimation.

I might have a working Python example to upload from some time ago when I was fiddling with decimation in GNU Radio.

The following users thanked this post: mawyatt, mariolucas75

#### mariolucas75

• Contributor
• Posts: 11
• Country:
##### Re: How to sample FM
« Reply #10 on: September 23, 2021, 01:23:12 pm »
Dear All,

Thank you for your valuable inputs which definitely is useful for me.
I want to learn GSM signals ... and prior to doing that i thought to learn interpretation of FM / AM signals for example.

For example when you switch mobile on it is looking for so called "frequency correction burst" - which is in fact a pure sine wave with some microseconds duration. I wanted to visualize this microseconds sine wave etc etc....

By the way don't you know any live forum where GSM technical topics are being discussed...

#### JoeyG

• Regular Contributor
• Posts: 69
• Country:
##### Re: How to sample FM
« Reply #11 on: September 23, 2021, 01:58:33 pm »
Why not mix the FM signal down to an IF frequency and a lower sampling rate will be required

#### mawyatt

• Super Contributor
• Posts: 1303
• Country:
##### Re: How to sample FM
« Reply #12 on: September 23, 2021, 03:45:33 pm »
The sampling process is fundamentally a mixing process, and as RoGeorge mentioned can be cleverly utilized as an effective downconverter eliminating the need for a traditional mixer. Also mentioned is the need for a preselect filter to isolate the band of interest. Back in the 70s we called this RF sub-sampling, bringing Microwave signals down to baseband with a sampler.

Best,
Research is like a treasure hunt, you don't know where to look or what you'll find!
~Wyatt Labs by Mike~

#### langwadt

• Super Contributor
• Posts: 2823
• Country:
##### Re: How to sample FM
« Reply #13 on: September 23, 2021, 07:49:34 pm »
If f0 is 100MHz with +/-100kHz deviation, than we can translate the spectrum around 0Hz, so we will have $\Delta f = 200kHz$ which will require a Nyquist sampling at 400 kilosamples/s (400kSa/s).

If I got your question wright, what you are looking for is decimation.

In decimation, if it were to have all the samples taken at 200 MSa/s, than we can simply keep only each 50th sample and discard the other samples.  That way we would get the same samples as if it we were sampling at 400 kSa/s (every 50th because 200 MSa/s = 200_000 kSa/s = 50 * 400 kSa/s).

Keep in mind that decimation will fold down other spectral components into the same band, so usually this is done by first applying a low pass filter over all of the high speed 200 MSa/s samples, and only after filtering we can throw away the rest of the samples and keep only each 50th sample after low pass filtering the original high speed signal.

The low pass filter in this numerical example must be at 200kHz, to cut out any higher spectral components.  This is necessary only if higher than 200kHz frequencies are present in the FM signal, because by decimation all other multiple of 200kHz bands (e.g. 400kHz-600kHz, or 91.8MHz to 92.0MHz, etc.) will be folded into the first 200kHz, too, and there is no way to distinguish which is which.

if you want the ~100MHz +/-100kHz signal from your 200MSa/s, you a bandpass filter around ~100MHz not a lowpass before decimation...

I guess I was using the wrong words.  AFAIK it's a low pass filter, not a band pass, and the cutting frequency is as low as the bandwidth of interest, near zero Hz.

The signal path for decimation is like this:

1. Analog signal with spectrum between 0-100 MHz --->
2. High speed ADC sampling (200 MSa/s) --->
3. Keep only the Nth sample and make all the other samples zero (so we still have 200 MSa/s) --->
4. Apply low pass filter to keep only the bandwidth of interest (200 kHz) --->
5. Copy each Nth sample into a new array, this last array is at low sampling rate (400 kSa/s), it's the final result of the decimation.

I might have a working Python example to upload from some time ago when I was fiddling with decimation in GNU Radio.

close but, no..

if you want to interpolate(upsample) you take your 400kSa/s stream insert zeros and lowpass filter the now 200MSa/s stream

if you want to decimate(downsample) you take your 200MSa/s stream lowpass* filter and throw away* every nth sample to get 400kSa/s stream

*using a lowpass/bandpass you pick the one image of the n*400kHz +/-200kHz that you want to keep
*if using a FIR filter only calculate the samples you want to keep

Smf