GNU Radio AM broadcast rx example not working with rtl-sdr blog v3 dongle

Need help installing or figuring out something about your SDR? Ask here.
RDPowers
Posts: 11
Joined: Mon Apr 27, 2020 9:41 pm

GNU Radio AM broadcast rx example not working with rtl-sdr blog v3 dongle

Post by RDPowers » Mon Apr 27, 2020 10:14 pm

So there are many FM broadcast radio flowgraphs for GNU Radio and rtl-sdr source out there and I've been able to get them to work. I haven't had luck with an AM broadcast radio flowgraph with rtl-sdr blog dongle.

I found a great blog at http://play.fallows.ca/wp/radio/softwar ... -receiver/ that has a "download grc file" button that does as it says, gives you the .grc file needed to run the flowgraph for an AM broadcast radio. There is also a youtube video at https://www.youtube.com/watch?v=7Do_X4LaX4M with the same guy doing the same flowgraph.

The tricky bit is he is using an upconverter in front of rtl-sdr. I presume he is using rtl-sdr v2 or older without direct sample mode so needs an upconverter.

I have rtl-sdr blog v3 dongle and have read the stuff about it using direct sample mode at https://www.rtl-sdr.com/rtl-sdr-blog-v- ... ser-guide/ and want to see if I can make that work.

So I took the ,grc file and modified it in two ways:

1) Opened the block for variable 'convert' and changed it from 125e6 to 0 because I don't have an upconverter; if you look at the uses of that variable it seems to do the right thing everywhere when it is set to 0 for no upconverter, it should now have no offset which is what we want for direct sampling

2) Opened the rtl-sdr source block and based on the https://www.rtl-sdr.com/rtl-sdr-blog-v- ... ser-guide/ page added "rtl=0,direct_samp=2" (without the quotes) to the "Device Arguments" field.

When I run the flowgraph I see it is using my device argument correctly:

gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.11
built-in source types: file osmosdr fcd rtl rtl_tcp uhd miri hackrf bladerf rfspace airspy airspyhf soapy redpitaya freesrp
Using device #0 Realtek RTL2838UHIDIR SN: 00000001
Detached kernel driver
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Enabled direct sampling mode, input 2
Exact sample rate is: 2000000.052982 Hz
gr::log :INFO: audio source - Audio sink arch: alsa

Yet the FFT graph shows nothing that looks like an AM signal, nor do I see anything else in the FFT that makes me think it is looking at the AM broadcast band, I just see noise.

So I am doing this on Ubuntu 18.04.4 with gnuradio 3.7.11-10 and rtl-sdr 0.5.3-13 ...

In theory I should be able to make a flow graph with (1) a rtl-sdr source with device argument as above and centered in the AM broadcast band with 2M sample rate, and (2) a FFT sink, and the FFT sink should show a bunch of spikes corresponding to the AM stations in my area, no?

Thanks!
RDP

tim_rtd
Posts: 180
Joined: Fri Jun 30, 2017 11:34 am

Re: GNU Radio AM broadcast rx example not working with rtl-sdr blog v3 dongle

Post by tim_rtd » Tue Apr 28, 2020 11:44 am

I have a spin of GQRX which is based on GNURADIO in which I need to use direct_samp=3. Try that...

RDPowers
Posts: 11
Joined: Mon Apr 27, 2020 9:41 pm

Re: GNU Radio AM broadcast rx example not working with rtl-sdr blog v3 dongle

Post by RDPowers » Tue Apr 28, 2020 6:41 pm

tim_rtd wrote:
Tue Apr 28, 2020 11:44 am
I have a spin of GQRX which is based on GNURADIO in which I need to use direct_samp=3. Try that...
I just tried that (and 0..4 as well) and, unfortunately, none worked.

Thanks, and I'm open to trying other suggestions.

tim_rtd
Posts: 180
Joined: Fri Jun 30, 2017 11:34 am

Re: GNU Radio AM broadcast rx example not working with rtl-sdr blog v3 dongle

Post by tim_rtd » Tue Apr 28, 2020 11:28 pm

I see your working to get down in the AM, but how about trying to see up in the 7 and 14 Mhz area using direct sampling 2 or 3 and see if there is anything there. Direct sampling is not as sensitive as quadrature mode so a good antenna is recommended. I don't suppse your using any high pass filtering in your antenna yet....

RDPowers
Posts: 11
Joined: Mon Apr 27, 2020 9:41 pm

Re: GNU Radio AM broadcast rx example not working with rtl-sdr blog v3 dongle

Post by RDPowers » Wed Apr 29, 2020 11:19 pm

tim_rtd wrote:
Tue Apr 28, 2020 11:28 pm
I see your working to get down in the AM, but how about trying to see up in the 7 and 14 Mhz area using direct sampling 2 or 3 and see if there is anything there. Direct sampling is not as sensitive as quadrature mode so a good antenna is recommended. I don't suppse your using any high pass filtering in your antenna yet....
OK, I will try other bands when I am back home. My antenna is just the short dipole that came with the rtl-sdr v3 maybe one meter long so not a "good antenna". Yet AM broadcast stations are transmitting with many kilowatts of energy, and the one I tuned is line of sight from my home so I was hoping it would appear. I doubt any signals in the 7 MHz band will be stronger.

Thanks!
RDP

tim_rtd
Posts: 180
Joined: Fri Jun 30, 2017 11:34 am

Re: GNU Radio AM broadcast rx example not working with rtl-sdr blog v3 dongle

Post by tim_rtd » Thu Apr 30, 2020 12:52 am

Sorry to say , but that's a very poor antenna for those bands.....Even a 1960's transistor radio had a better antenna.

RDPowers
Posts: 11
Joined: Mon Apr 27, 2020 9:41 pm

Re: GNU Radio AM broadcast rx example not working with rtl-sdr blog v3 dongle

Post by RDPowers » Thu Apr 30, 2020 4:36 pm

tim_rtd wrote:
Thu Apr 30, 2020 12:52 am
Sorry to say , but that's a very poor antenna for those bands.....Even a 1960's transistor radio had a better antenna.
Thanks. A long wire is out of the question for my current situation. I suppose I can find a vintage radio that has a ferrite loop antenna that I can salvage. Still I would think I would be seeing some energy from the line of sight broadcast transmitter.

Your earlier post made me think a bit and I can generate some signals in the 40m ham band and check to see if I see them with the rtl-sdr dongle. Then I will know if the issue is related to direct mode sampling working or not versus my gnuradio flowgraph decoding AM correctly or not.

I should have thought of this earlier but was so fixated on the gnuradio aspects of the problem, so thanks for triggering the thoughts that should be able to break down the problem further.

I can't do it today but hopefully will get to it tomorrow.

Thanks!
RDP

IyoKobat
Posts: 2
Joined: Tue May 05, 2020 1:09 am

Re: GNU Radio AM broadcast rx example not working with rtl-sdr blog v3 dongle

Post by IyoKobat » Tue May 05, 2020 1:39 am

I'm also struggling to get this to work with GNU Radio in the AM broadcast band.

A little background: I have a suitable dipole antenna and the RTL2832U V3 chipset. Previously, I got this working using gqrx, just by adding the direct_samp=2 argument. AM and HF Amateur bands all work well.

For the GNU Radio effort, I built a flow following the VE6EY video, but with QT Gui controls (for Mac). I could not get any AM broadcast content or any discernible signal. I agree that VE6EY's design was likely for v2 or older and needed an upconverter. Switching to my VHF antenna, and removing the upconvert, I was able to demodulate AM Air traffic at around 119 MHz, so I am confident that the basic design is valid. Going back to the original design (with and without the upconverter), I tried adding the direct_samp=2 as a 'Device argument' to the RTL source. It did not throw any errors, but also did not seem to change the results. Same goes for different values of direct_samp (0, 1, 3, & 4). Even tried adding quotes to the argument.

Watching this thread closely for success. Thanks in advance!!

IyoKobat
Posts: 2
Joined: Tue May 05, 2020 1:09 am

Re: GNU Radio AM broadcast rx example not working with rtl-sdr blog v3 dongle

Post by IyoKobat » Thu May 07, 2020 1:23 am

Made some good progress today. The Device Arguments need to be "rtl=0,direct_samp=2" without the quotes. I did not need upconvert or correction values (both = 0) like VE6EY did for his video. The reception and sound quality do not match my gqrx binary app, but this may be due to a need for different filtering or rf gain.

RDPowers
Posts: 11
Joined: Mon Apr 27, 2020 9:41 pm

Re: GNU Radio AM broadcast rx example not working with rtl-sdr blog v3 dongle

Post by RDPowers » Mon May 11, 2020 5:25 pm

IyoKobat wrote:
Thu May 07, 2020 1:23 am
Made some good progress today. The Device Arguments need to be "rtl=0,direct_samp=2" without the quotes. I did not need upconvert or correction values (both = 0) like VE6EY did for his video. The reception and sound quality do not match my gqrx binary app, but this may be due to a need for different filtering or rf gain.
I was able to repeat your success with gqrx.

I used the same value in the device string as you did.

It is interesting that threads here ( viewtopic.php?t=4427 ) and other places suggest using direct_samp=3 instead of direct_samp=2 . One page ( https://06816143288477446433.googlegrou ... 9NJ8ylsulY ) even shows a screen shot of direct_samp=3 working.

In my case, direct_samp=3 just produced no output at all.

https://adrianchadd.blogspot.com/2017/0 ... ation.html suggests the values are:

0 = no direct sampling; 1 = direct sampling on I, 2 = direct sampling on Q

So there is no mapping for 3, unless the software interprets it as "direct sampling on I and Q".

Anyway, thanks for the tip. I will progress on to gnuradio_companion a bit later, and am hopeful I can make progress there now that I know the settings that work for gqrx.

One thing I noticed that when I tuned into 1.590 MHz for my local AM station, gqrx chose to tune to 1.987 MHz and then use an offset to get to 1.590 MHz, something the VE6EY flow graph doesn't do. Do you know if this is significant or not?

And yes, the signal is pretty weak, but I am using the ~1 meter telescoping dipole that came with the kit I bought on Amazon.

Post Reply