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

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

Post by RDPowers » Mon May 11, 2020 9:03 pm

Regarding the direct_samp values, another thread ( viewtopic.php?t=4459 ) suggests:
On keenerds driver for rtl_power its [-D direct_sampling_mode, 0 (default/off), 1 (I), 2 (Q), 3 (no-mod)]. I assume rtl_power_fftw would have something similar, if not you'd need to edit the code to add it in
And http://superkuh.com/rtlsdr.html says:
No hardware change, software mod direct sampling

It has recently become possible to use direct sampling with no hardware modifications at all. It is still very experimental and performance is bad. In Oct 2012 Anonofish on the r/rtlsdr subreddit had discovered the PLL would lock for a small ~ 3686.6 MHz - 3730 MHz range far outside the normal tuning range and there seemed to be signals there. In January 2014 ##rtlsdr IRC channel user tejeez figured out this bypassed the tuner (mixer leakage) and implemented a set of register settings (R820T IF frequency, IF filter bandwidths, r82xx_write_reg_mask(priv, 0x12, val, 0x08) replaced with r82xx_write_reg_mask(priv, 0x12, val|0x10, 0x18)) that would exploit this to enable HF reception. Shortly thereafter keenerd assembled everything into a relatively easy to use patch-set.

If you want to give HF listening a try with no risk keenerd has added these changes rtl_fm and rtl_power in his experimental rtlsdr repository. To use the no mod mode with rtl_ tools append the argument, "-E no-mod". To use the no-mod direct sampling in something that uses gr-osmosdr, like gqrx or GRC flowgraphs, add the following to the the "device string" parameters: ie "direct_samp=3". Plug your HF antenna into the normal connector, no hardware mods needed.
So if you work through the context, direct_samp=3 seems to only be relevant if you are using the V2 or older style rtl-sdr dongles, and are using the 'keenerd' code base, and are trying to use that dongle to do direct sampling without any hardware modifications. Otherwise the values 0, 1, and 2 are as I explained in my previous post.

Or, to put it another way, if you are using V3 rtl-sdr dongle and mainstream code base, direct_samp=3 doesn't do anything, which is what I observed.

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 May 12, 2020 1:25 am

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.
Thank you for your advise, it's been very helpful. I have more or less repeated what you have done.

I found gqrx was very helpful to show that the rtl-sdr V3 can receive AM broadcast signals. As above I found they need to be strong local signals for them to be received. For bonus points I used the suggestions at https://www.scivision.co/sdr-sharp-ubuntu/ so I could run sdrsharp on my linux system and it worked similarly to gqrx once I set sampling mode to Q-branch.

I also reran the VE6EY flowgraph, and tuned in to a talk radio station, and now that I knew the correct device string I could tell it was working a tiny bit, but just that. I could tell there was people talking, but that's about it. It was not decoded well enough for me to pick out any actual words. It reminded me of the time that I built a single crystal (diode) radio back when I was a kid many decades ago, only this modern equivalent wasn't as good. In short, I would not say the gnuradio version was usable even for a demo to others whereas gqrx and sdrsharp were.

VE6EY shows how to generate AM at http://play.fallows.ca/wp/radio/softwar ... -gnuradio/ -- maybe I will go through that, and see if I can hook up his AM transmitter to his AM receiver to see how good it is. Other than that, I will try to get a better antenna for the AM bands just to see if having a stronger input signal results in a useful demo.

Either that, or work through the gnuradio example ( https://wiki.gnuradio.org/index.php/Sim ... d_receiver ) where the transmitter sends to a socket and the receiver demodulates from the socket. Or keep googling till I find an example even easier to work with. Or use the working gqrx or sdrplay to save an AM signal as I/Q samples and use that to test the gnuradio AM receiver flowgraphs. I appreciate the idea of using aviation band signals to test out AM receivers. I am close enough to my local airport to hear its ATIS signal which is transmitted continuously, so that is a nice signal source to use.

So, as you say, progress. I'd like to get to the point where I had a gnuradio flowgraph that can receive my local AM broadcast station live well enough to demo it to others, i.e. get closer to gqrx and/or sdrsharp in terms of AM reception. I think I can eventually get there.

So many ideas, so little time...

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 » Sun May 24, 2020 5:52 pm

As above, I finally did use the example at https://wiki.gnuradio.org/index.php/Sim ... d_receiver and found even in this example of a locally generated signal (either via audio in or the gnuradio signal source generating a sine wave) that the receiver was really bad.

On the RX side I had to put the time sink into autorange mode to even see a signal, and then I had to allow the volume slider go beyond 10x before I could clearly hear a tone. I can't see anything on the TX side that would cause such weak signals. If so then the filtering on the RX side causes >10x loss of signal? Seems hard to imagine.

Yet this kinda meshes with sdrsharp/gqrx doing better than gnuradio when using the rtl-sdr dongle.

However, gqrx is said to use the gnuradio infrastructure.

I suppose that means that the gqrx authors understand a lot more about how to implement an AM receiver using the gnuradio run time blocks than the authors of these various examples do.

It doesn't mesh very well with the VE6EY videos on youtube showing acceptable performance using his gnuradio flow graph.

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 25, 2020 5:05 pm

So, if you start with https://wiki.gnuradio.org/index.php/Sim ... d_receiver and modify the receiver to use the gnuradio "AM Demod" block, the receiver works fine. I think the author is trying to do the demodulation by hand, but it doesn't work that well. I proved that to my own satisfaction by substituting in the "AM Demod" block. Eventually I will find some examples of how to do a better job of demodulating by hand, but for now I'm happy enough using the "AM Demod" block. I presume the gqrx authors also are just using the "AM Demod" block.

In summation, I have found if I use the rtl-sdr v3 dongle with the Ubuntu 18.04 sdr stack and use "rtl=0,direct_samp=2" and a crappy antenna, I can receive very strong local AM broadcast signals using the ve6ey flowgraph. This dongle is not very sensitive since the tuner chip and its amplification is being bypassed when you use "rtl=0,direct_samp=2" and the crappy antenna is not providing much signal. I find I have to use a headset to get intelligible speech out of it, but it definitely is working.

I realize I'm largely talking to myself on this thread for a while now, but I still want to type in what I learned for the benefit of future web searches.

Post Reply