A Software Based VGA AGC Implementation for the RTL-SDR

Thank you to Chris G for writing in and sharing with us his software VGA ADC controller for the RTL-SDR. AGC or 'automatic gain control' is an algorithm that attempts to automatically adjust the gain on the RTL-SDR in order to maximize the signal to noise ratio. The built in hardware AGC's on the RTL-SDR are intended for wideband TV signals, and work poorly with the narrower signals that SDR users typically deal with. However, it's possible that a software AGC implementation could be used instead.

Initially, I wanted to see how well things would work if I could manually control the VGA gain to avoid A/D overload within the 2832 chip.

I liked how things worked so I said: let's make things automatic! I implemented two variants of my AGC. One variant (my favorite) is an implementation of an AGC by Harris and Smith. It is an LMS algorithm that has equal transient response to a sudden increase in input signal magnitude and a sudden decrease in signal magnitude.

Since I'm doing this stuff in software, I operate on blocks of IQ data rather than operating on a sample by sample basis.

Initially, I observed limit cycles for at least two reasons:

  1.  The (approximately) 3.5dB step size in VGA gain adjust.
  2. The fact that when I receive a block of IQ data, another block is in transit.

This resulted me adjusting the gain while a block of data was in transit.

For item 1, I allow the deadband go be settable.

For item 2, I allow a "blanking time" to be settable. For my use case, If the AGC just made an adjustment, I skip making an adjustment while the next black is in transit.

Here is output of my 'get agcinfo' command.

--------------------------------------------
AGC Internal Information
--------------------------------------------
AGC Emabled : Yes
AGC Type : Harris
Blanking Counter : 0 ticks
Blanking Limit : 1 ticks
Lowpass Filter Coefficient: 0.800
Deadband : 1 dB
Operating Point : -12 dBFs
IF Gain : 11 dB
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Signal Magnitude : 27
RSSI (After Mixer) : -24 dBFs
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

Note that my setpoint and gain adjustment works in decibels. That way, I treat the AGC as a linear system (it's actually uses an LMS algorithm) to simplify processing.

Now, I have used the same algorithm for my HackRF software.

I should mention that I implemented a pretty nice software squelch system for the rtl-sdr (and HackRF of course) if you have any interest in that.

I have a github repository at github.com/wizardyesterday/RtlSdrDiags.

I've thought about adding an I2C DAC whose output is connected to the VGA analog gain control line, but I really hate to butcher my v3 dongle. Having 1dB (or less) gain resolution would be nice though.

Another thing that I noticed is that, when writing to the tuner registers, the I2C repeater is enabled and you hear a spike in the demodulated audio. This may also occur (I haven't done that experiment) when disabling the repeater. Maybe not......

I have composed a report in, github.com/wizardyesterday/RtlSdrDiags/blob/master/doc/agcResearch/README.txt

If you get curious how I implemented my AGC, you can look at the file, github.com/wizardyesterday/RtlSdrDiags/blob/master/radioDiags/src_diags/AutomaticGainControl.cc.

The header file is in radioDiags/hdr_diags/AutomaticGainControl.h.

RTL-SDR Blog L-Band Patch, Bullseye, YouLoop Sale

This Black Friday we are offering a discount on our L-Band Patch, Bullseye and YouLoop antennas in our store and marketplace listings! The sale will run until the end of November.

Our L-Band patch is an active design for receiving L-band satellites such as Inmarsat, Iridium, GPS and other satellites that transmit between 1525 - 1660 MHz (please note that you cannot use it for weak signals that require a dish like HRPT or GOES).

The Bullseye LNB is a TCXO stabilized LNB for the QO-100 geostationary amateur satellite and other Ku-band satellites.

The YouLoop is a super portable passive HF/VHF loop antenna designed for super low NF/MDS receivers like the Airspy HF+ Discovery.

  • L-Band Patch Antenna: US $59.95 $49.95
  • Bullseye LNB: US $29.95 $24.95
  • YouLoop: US $39.95 $31.96

Pricing includes free shipping to most countries. Please note that pricing does not include VAT and/or taxes which may be added for your country.

SDRplay RSPdx Black Friday and Holiday Season Sale Now Active

SDRplay have today announced a sale on their "RSPdx" product which runs from today until December 31st. The new pricing is  £130/€156/$169.95 plus shipping and any applicable taxes. This pricing is available for direct sales from SDRplay, and at any participating resellers. The pricing on SDRplay's direct sales platform before the sale was US$214 plus shipping.

Note that individual resellers may be offering slightly different prices depending on if free shipping is offered. For example Ham Radio Outlet in the USA is offering the RSPdx for $179.95 including free shipping.

The RSPdx is designed for high performance DX reception and SDRplay note that it achieves this with additional filtering, improved intermodulation performance, a DAB notch filter, additional attenuation steps, and high dynamic range enhancements for frequencies under 2 MHz.

At SDRplay, we recognise that times are very tough for a lot of people. In view of the economic pressures that people are facing, we want to lend a helping hand by offering the very popular RSPdx at a special low price for this holiday buying season. After discussions with our dealer network, from Black Friday until the 31st December, we (along with participating dealers) plan to offer the RSPdx at a holiday discounted suggested retail price of £130/€156/$169.95 plus shipping and any applicable taxes. This represents a substantial discount of more than one fifth when compared to the normal retail price.

Starting midnight EST, Thursday November 24th visit https://www.sdrplay.com/purchasehome/  to purchase an RSPdx at the special price or contact your local SDRplay dealer for more details.  Please also note that stocks are limited and this offer will certainly end on the 31st December and prices will revert to normal commercial levels thereafter.

This is a great opportunity to get the RSPdx as a gift for a newcomer or a returning radio enthusiast at a price which won’t be repeated, as our suppliers are already increasing their prices for the new year.

  • Prices shown are prices offered when buying direct from SDRplay. Shipping and taxes are extra.  SDRplay ships from the UK to most countries in the world.  However some countries will require import duty to be paid on top.
  • SDRplay dealers who usually include free shipping will adjust the prices accordingly
  • Check with your local dealer to see if they are participating.
  • Links to both the SDRplay direct purchasing page and our list of authorised resellers can be found here
SDRplay - Special RSPdx Holiday Promotion

Airspy and YouLoop Black Friday Sale Now Active: 20% OFF

Airspy is holding their annual Black Friday sale, this year offering 20% off their range of products. The sale is active at all participating resellers, which includes our own store where we have the YouLoop on sale for US$31.96 including free shipping to most countries in the world, instead of the usual US$39.95. Please note that due to EU VAT collection laws, EU customers must purchase the discounted YouLoop from our eBay or Aliexpress stores. 

The YouLoop is a low cost passive loop antenna for HF and VHF. It is based on the Möbius loop design which results in a high degree of noise cancelling. However the main drawback is that it is a non-resonant design, which means that it works best when used with ultra sensitive receivers like the Airspy HF+ Discovery. 

Some good reviews include the YouTube videos done by Frugal Radio where he reviews HF reception and VLF & LF reception with an Airspy HF+, and later tests it with an RTL-SDR Blog V3 using direct sampling. Techminds also has an excellent review on his YouTube channel. We also have a product release overview on this post from March 2020.

During the sale the price of Airspy SDRs and their upconverters are:

  • Airspy R2: $160.00 $135.20
  • Airspy Mini: $99.00 $79.20
  • Airspy HF+ Discovery: $169.00 $135.20
  • Airspy SpyVerter: $49.00 $39.20

Raspberry NOAA V2 Edition 2023 Image Released

Thank you to Manuel Lausmann for submitting news about the release of the "Raspberry NOAA V2 Edition 2023" image for Raspberry Pi's. This image has been created by Jochen Köster (DC9DD), and contains a few enhancements over the previous image, mainly by including a program that allows users to create composite images of images from the Meteor weather satellites. Manuel writes:

This is based on the well-known Raspberry Noaa V2. In this image, however, the latest MeteorDemod has been added, which makes it possible to generate composite images, which was previously only possible under Windows with Meteorgis.

Furthermore, the image has an additional FTP uploader. The image was created by Jochen Köster DC9DD. It's available from today. This image is also part of my off-grid station in Northern Norway.

Download link for the image: https://www.qsl.net/do3mla/raspberry-pi-images.html

Here is a link to the Facebook group for the image: https://www.facebook.com/groups/raspberrynoaav2edition

Here is a link to ranged from my off-grid station where this image is running: https://usradioguy.com/science/off-grid-apt-lrpt-satellite-ground-station

An example of a composite image from multiple Meteor satellite images.

GNU Radio Conference 2022 Talks Available on YouTube

During September 26 - 30 GNU Radio Conference 2022 was held in Washington DC. GNU Radio Conference (aka GRCon) is an annual conference centered around the GNU Radio Project and community, and is one of the premier software defined radio industry events. GNU Radio is an open source digital signals processing (DSP) tool which is used often with SDRs.

A few days ago videos of all the presentations were released on their YouTube channels, and all the talks can be found on this playlist. The videos contain a mix of in person and remote talks. A schedule of all talks can be found on the GNU Radio website.

GRCon22 - GNU Radio Project Update

Car Hacking in the Mr Robot TV Show Explained

Over on YouTube David Bombal has uploaded a video titled "Warning! This is how cars are hacked. Just like in Mr Robot." which explains how the car hacking scenes in Mr Robot worked. Mr Robot is a TV drama series about cybersecurity hackers, and it is known for portraying realistic hacks and scenarios. Back in 2019 we posted about an episode where they used a HackRF and Raspberry Pi to jam a garage door, before using the HackRF as an IMSI catcher. RTL-SDRs were also briefly used in some episodes.

David's video goes into greater detail about how realistic the hacking concepts displayed in the Mr Robot series are and if they would work in real time. In this video he goes into particular detail about car hacking. He uses a HackRF and RTL-SDR and demonstrates attacks like jamming, and signal replay.

This video is a part of a series exploring the hacks shown on Mr Robot. The full playlist can be found here.

Warning! This is how cars are hacked. Just like in Mr Robot.

TechMinds: Reviewing the RX888 MK2 Software Defined Radio

The RX888 MK2 is a software defined radio with 1 kHz - to 1.7 GHz tuning range and up to 64 MHz of real time bandwidth between 1 kHz and 64 MHz and 10 MHz real time bandwidth between 64 MHz - 1.7 GHz. It is available on sites like Aliexpress for about US$170.

Previously we posted about how a number of SDR software developers issued a warning about the RX888, noting that it has very poor driver support, and very poor developer support.

However, in his video Matt reviews the RX888 MK2 and has a favorable opinion of the device. The video begins with an overview of the RX888, shows the driver installation process and then demonstrates the device operating in SDR Console V3 in HF reception mode.

RX888 MK2 16BIT Software Defined Radio