# Problem using fm\_demod.py

**URL:** <https://www.ruby-forum.com/t/problem-using-fm-demod-py/242287>\
**Category:** GNU Radio\
**Created:** [June 12, 2015, 1:06am UTC](https://www.ruby-forum.com/t/problem-using-fm-demod-py/242287 "2015-06-12T01:06:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [June 12, 2015, 1:06am UTC](https://www.ruby-forum.com/t/problem-using-fm-demod-py/242287/1 "2015-06-12T01:06:02Z")

</div>

Hi everyone,

I recently started playing around with gnuradio, and being the beginner  
that I am, wanted to begin by listening to a close by radio station. I  
basically followed the instruction on  
[http://www.trondeau.com/gr-tutorial/](http://www.trondeau.com/gr-tutorial/)  
and used the uhd\_rx\_cfile with the following command:

_uhd\_rx\_cfile -a “addr=192.168.10.2” -g 0 -f 97.1M --samp-rate=500k -N  
5000000 radio\_sample\_97.1Mhz.32fc_  
Below you can find the image of the IQ data and the PSD that I got when  
I  
used \*gr\_plot\_psd\_c \*  
[http://imgur.com/kFpqK25](http://imgur.com/kFpqK25)

But when I used the fm\_demod.py to playback the captured data, it comes  
out  
completely scrambled. Am I missing something here?

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [June 12, 2015, 1:18am UTC](https://www.ruby-forum.com/t/problem-using-fm-demod-py/242287/2 "2015-06-12T01:18:18Z")

</div>

Hi everyone,

I recently started playing around with gnuradio, and being the beginner  
that I am, wanted to begin by listening to a close by radio station. I  
basically followed the instructions on  
[http://www.trondeau.com/gr-tutorial/](http://www.trondeau.com/gr-tutorial/)  
and used the uhd\_rx\_cfile with the following command:

_uhd\_rx\_cfile -a “addr=192.168.10.2” -g 0 -f 97.1M --samp-rate=500k -N  
5000000 radio\_sample\_97.1Mhz.32fc_  
Below you can find the image of the IQ data and the PSD that I got when  
I  
used \*gr\_plot\_psd\_c \*  
[http://imgur.com/kFpqK25](http://imgur.com/kFpqK25)

But when I used the fm\_demod.py to playback the captured data, it comes  
out  
completely scrambled. Am I missing something here?

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [June 12, 2015, 3:40pm UTC](https://www.ruby-forum.com/t/problem-using-fm-demod-py/242287/3 "2015-06-12T15:40:00Z")

</div>

On Thu, Jun 11, 2015 at 7:17 PM, Nick H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> 5000000 radio\_sample\_97.1Mhz.32fc\*  
> Below you can find the image of the IQ data and the PSD that I got when I  
> used \*gr\_plot\_psd\_c \*  
> [http://imgur.com/kFpqK25](http://imgur.com/kFpqK25)
> 
> But when I used the fm\_demod.py to playback the captured data, it comes  
> out completely scrambled. Am I missing something here?

What do you mean by “scrambled”? That can mean a handful of different  
things in this domain.

Also, you set the gain to 0; you might want to increase that, though it  
looks like the PSD is showing a decent amount of signal.

When plotting the image the way you did, skip into the file a few  
thousand  
samples (pass -s 4000 to the gr\_plot\_psd\_c script) to skip the start-up  
transients, which are obscuring the signal.

You also are bringing the signal in at 500 ksps. Make sure that the  
script  
to play back the FM signal is set up for that (it should be based on  
that  
tutorial page, but you’ll want to verify).

Tom

---

<div class="post-metadata">

**Author:** ![nickh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/7ea924/32.png) [@nickh](https://www.ruby-forum.com/u/nickh)\
**Post date:** [June 15, 2015, 11:08pm UTC](https://www.ruby-forum.com/t/problem-using-fm-demod-py/242287/4 "2015-06-15T23:08:40Z")

</div>

Hey Tom,

I guess “scrambled” wasn’t really the best word to describe the problem.  
🙂  
What I basically meant was that there was a lot of static, and I  
couldn’t  
really differentiate the radio signal from the noise when I played it  
back.  
Apparently, I hadn’t set up the script to the correct sampling rate, but  
once I got that fixed, the script worked like a charm.

Thank you!
