

If ignorance had mass, the Discovery Institute would be a black hole.
The Sensuous Curmudgeon
When you look the spectrum from one of your SDR programs, you may see several signals at the same time.
In the days of analog receivers, you could only demodulate and listen (or view) the signal at the center. And just one signal. To understand why that is, you have to understand the general flow for receiving a signal. Tuning to that signal is just the first step. The signal also has to be filtered (to remove all other signals and the ever-present noise), then demodulated (to extract the actual information from the RF signal). With analog systems, this was all done in hardware. You literally needed components, typically in the form of transistors, resistors, capacitors and inductors, for the tuning, filtering and demodulation. There's only enough hardware for receiving one signal at a time, and that signal has to be at the center frequency to which the receiver is tuned.
Fast forward to today. Maybe you've used GQRX, shown above, or one of the other programs, such as SDR#, SDRconsole, HDSDR, SDR++, or CubicSDR, and seen a similar spectrum. With these programs, you were able to literally click on any of the signals you see in the spectrum and, VIOLA! You heard audio. Have you ever wondered how these various programs were able to do that? How were they able to demodulate a signal that wasn't centered?
The answer is software tuning. We use software to tune, filter and demodulate the signal. This means we're not hardware limited; we're only limited by what the software can do and the amount of processing available.
There are several reasons why we might want or need software tuning. Let's go through some of those reasons.
The first reason is based on the question, "What if we are playing back an IQ file? And the desired signal is not already centered?" If you have a file, you don't have a SDR to tune. You just have a file of samples. Much as a captured thermal image cannot change the "FORD" (focus, thermal range, distance), a collected IQ file cannot change the center frequency at which it was recorded nor the various settings of the SDR itself, such as the gain or filtered bandwidth. The only way in which you can tune in this way is with software tuning.
This is similar to reading samples from an IQ file. But instead of the samples coming from a file, they come from the network. The software receivers cannot change the SDR hardware parameters, including the center frequency, so they have to use software to tune and process the samples.
Another possibility is that you want to listen to two radio stations at one time, just as the singer Tom Waits does. If you didn't have two SDRs to run at the same time, then this, too, would require the use of a software tuner. This is demonstrated quite nicely by the Youtube channel "Ham Radio DX" in which he uses the software "SDRconsole" to receive multiple stations at the same time.
Several SDRs, especially the less expensive ones, will have a spike at 0 Hz (DC). This is due (primarily) to the analog RF front end of these systems. The local oscillators and mixers together perform analog frequency tuning. The tuning process creates a large signal at DC, which then becomes part of the digitized spectrum. As complex signal processing is centered at DC, this could create problems for some signal processing. By offtuning from the signal being captured, the system can use software tuning to shift the signal back to DC for processing.
Hardware tuning may not allow for tuning with relatively low resolutions (perhaps down to the Hz or even sub-Hz level). With software tuning, it's possible to provide tuning down to the nanohertz (or perhaps lower) level. The resolution is dependent on the word size of the samples.
Many analog signals have subchannels, typically called "subcarriers", on them. For example, FM broadcast stations carry stereo, RDS and sometimes SCA signals. NOAA APT signals use a subcarrier to convey the video information. These, too, can use a software tuner to recover this information.
We'll go through a couple of different methods to make software tuners using Gnu Radio Companion.
The gist is this. When you multiply (mix) a sinewave with another signal, the frequency of that signal is shifted by the frequency of the sinewave.
There are already a lot of different websites, especially Youtube videos, explaining how frequency conversion works. The gist is this. When you multiply (mix) a sinewave with another signal, the frequency of that signal is shifted by the frequency of the sinewave. In other words, the frequency of the sinewave is added to the frequency of the signal. This is where some confusion may occur. I said "frequencies add". But there's also a difference frequency, meaning that the sinewave's frequency is also subtracted from the signal frequency. Why is that?
Real signals (as opposed to complex signals) always have both a negative and positive frequency component. Certain complex signals, specifically analytic signals, have only a positive frequency component. A complex signal can also have only a negative frequency component. (NOTE: One of the aspects of complex signals is that the positive and negative frequency components are unique.) If we look at the double-sided spectrum of a real sinusoid and a signal, we'll see both negative and positive components.
This is one of the key concepts for receiver operation. It's called heterodyning. The definition of "heterodyning" is to mix two signals together in a nonlinear device. I prefer to think of heterodyning as "mix two signals together". And by mixing, we're talking "multiply". When you multiply two sinusoids together, their frequencies add. (NOTE: A "signal" is really nothing more than a collection of sinusoids.) Which works perfectly for digital signals. The two signals that are mixed are typically a modulated signal at some radio frequency (RF), while the other is a sinusoid called a "local oscillator" or "LO". The output will be the RF signal shifted by the frequency of the LO. You effectively shift the frequency of the signal by the frequency of the sinusoid. Combined with this concept is the concept of superheterodyning. Superheterodyning, or "superhet" for short, means to shift the frequency of a signal to a fixed, intermediate frequency or "IF". The purpose for shifting to this fixed frequency is so that all of the follow-on processing, such as filtering and demodulation, can be designed for one frequency. This makes designing and building such circuits much easier.
Software tuning will only work on signals within +/-1/2 of the sample rate of the SDR.
Software tuning has one limitation. It only works on those signals within the instantaneous bandwidth of the SDR. In other words, it will only work on signals within +/-1/2 of the sample rate of the SDR.
But now we can add something that is difficult to do in the analog world. We can use complex sinusoids. Such a signal can have only a positive component (an analytical signal) or only a negative component (whatever that is called). With Gnu Radio, there are several ways we can create such signals. The simplest is using a Signal Source block with the "Output Type" set to "complex" and the "Waveform" set to either "Cosine" (the default) or "Sine".
We can also create such sinusoids in one of two ways. The first way is to create a real cosine and a real sine and use them as the real and imaginary components of a complex sinusoid, respectively. The second way is to create a real sinusoid, then filter out the negative frequency component using the Hilbert transform.
Regardless of how the single-sided sinusoid is created, it's useful for one thing in particular. It can be used to shift the frequency of a complex signal by simply multiplying the signal with the complex sinusoid. It is the most straightforward method for software tuning in Gnu Radio Companion. Just combine a Multiply block with a Signal Source block, with both blocks set for "complex" samples. This is a straightforward frequency shifter. This is what we discussed in the previous section.
And that is how software tuning is performed, typically. Multiply by a complex sinusoid to shift the desired signal higher or lower in frequency until it is centered, then perform the processing.
This is a basic receiver for the United States NOAA Weather Radio system. It uses a RTL-SDR, but the SDR is set to a fixed frequency. The "tuning" is all done in software. With the SDR set to the center channel (162.475 MHz) and the channel spacing of 25 kHz, the system only needs ~170 kHz of bandwidth to cover all of the channels (to include the bandwidth of the end channels due to modulation). However, I've set the RTL-SDR sample rate to 1.2 MHz. The reason is that, based on my experience, the lower sample rates (225 kHz - 300 kHz) don't tend to work as well as the higher ones. This could just be the quantization noise, or something else. Regardless, I've set the sample rate to 1.2 MHz initially, then filtered and decimated afterwards. I've used a lowpass filter set to a bandwidth of 100 kHz to provide the spectrum for tuning. Further, I've used a relatively high transition width in order to keep the amount of required processing down. The "Signal Source" block provides the complex sinusoid to tune in the desired signal. The rest is the standard processing (filtering, demodulation, sample rate adjustment, audio output). I used a "QT GUI Chooser" block to select one of the seven available channels. The QT GUI Chooser selects a frequency offset (+/-75 kHz in 25 kHz steps), which controls the Signal Source block.
Here's another method for creating a software receiver that doesn't really "tune". By "tune", I mean to perform frequency conversion. Instead, it uses complex filter taps to create a bandpass filter. Instead of shifting the signal to the filter, this shifts the filter to the signal.
A bandpass filter that uses complex taps can operate on signals either just positive or negative in frequency. A bandpass filter that uses real taps must work equally on the positive and negative frequencies. The use of a complex tap bandpass filter means that all but one signal can be filtered out. Further, because it is an FM signal, we can frequency demodulate the signal with a polar discriminator (the improperly-named "Quadrature Demod" block), except it will have a large DC offset. The DC offset can be calculated, then removed with a "Add Const" block. While this is an interesting, in my opinion, this requires more processing than the complex frequency shift flowgraph from above. This particular flowgraph is not much more processing than the one using the complex frequency shift. Based on the use of a "Null Source" block to replace the RTL-SDR, and a "Probe Rate" and "Message Debug" block to replace the "Audio Sink", the complex frequency shift provided a maximum of 10.0 MSps, while this flowgraph provided 9.5 MSps.
Here's yet another software tuner. The difference of this one is that it doesn't process just one signal; if done properly, it does them all. For this example, I've tuned a RTL-SDR to a portion of the FM broadcast band. This flowgraph makes use of the "Polyphase Channelizer" block. This makes use of a polyphase filter bank that both filters and frequency shifts the signal down to 0 Hz. Which means that every signal within the instantaneous bandwidth of the RTL-SDR can be filtered, frequency shifted, and output. The only question is "Now what?" Sure, you can demodulate and further process one station (or, again, two if you're Tom Waits), but what about the rest? One possibility is that each channel is output to a network, where other systems can process each station. Or record each station. Or record the information contained in the broadcast.
One part that must be understood in order for this to work is that the sample rate must be the channel spacing (200 kHz, in this example) multiplied by the number of channels (12). That is why the overall sample rate is set to 2.4 MHz. This could also work with other sample rates, so long as the sample rate is an integer multiple of the channel spacing.
This is something I've already covered in several posts, most recently with my post on the best RDS demodulator and decoder circuit. Those flowgraphs show a complex frequency shift for the baseband spectrum in order to tune to the 57 kHz RDS / RBDS signal.
If we were to put a "Frequency Sink" block both before and after the "Multiply" block, we would see the spectrum first unshifted (before) and shifted down by 57 kHz (after).
This hopefully gives you an idea of the many different options for performing software tuning. There are several possible options for each of these, along with things I didn't have time to cover. For example, one thing I didn't cover was the use of a "Vector Source" block to replace the "Signal Source" block. This is possible when it's possible to calculate the values of the complex sinusoids beforehand. This will save on the processing required as the "Signal Source" block calculates its values on-the-fly. If they can be calculated before the flowgraph runs, this saves on the processing.
Til next time!
The end of the telephone line that plugs into the phone plug is called a jack. The reason is that it is named after the French-Canadian inventor, Mr. Jack.
ARRL - Amateur Radio Relay League
The New Horizons Interplanetary Explorer
NRL Monterey - Satellite Meteorology
WWdN: In Exile - Wil Wheaton Blog
Calculating Volume in Horizontal Tank
March 2025 - The Five Methods for Frequency Demodulation
January 2025 - Making a "Soft" Tuner & Receiver in Gnu Radio
December 2024 - Understanding the Polar Discriminator (Finally)
September 2024 - Decoding AIS Signals
June 2024 - Programming the Arduino - Part 2
June 2024 - Setting Up the HM2004A Liquid Crystal Display
April 2024 - An Aircraft Communication Receiver
February 2024 - A Review of Dave Rowntree's Gnu Radio FM Receiver
January 2024 - A Test of Different RDS Demods using Gnu Radio
November 2023 - An Overview of SDRconnect
August 2023 - SDRuno and the "Zero IF" vs "Low IF"
July 2023 - Gigabit Ethernet and the Misunderstanding of the Fifth Level
May 2023 - Rather Deep Overview of SDRangel
April 2023 - Creating a Variable RBW Spectral Display
January 2023 - Improvement to the Zero Crossing FM Discriminator
January 2023 - Differences of Hardware and Software Radios
December 2022 - Bandwidth Limits of the Tayloe Detector
September 2022 - Linux Mint 21 and Grub
July 2022 - NOAA APT with Gnu Radio - UPDATED
June 2022 - Playing Back IQ Files with Gnu Radio
May 2022 - Assassins Creed Odyssey - in 3D
January 2022 - Gnu Radio and AM Demodulation Overview
August 2021 - Gnu Radio and RBDS Demodulation
July 2021 - Gnu Radio and Amplitude Demodulation
June 2021 - Gnu Radio and Narrow Resolution Frequency Displays
April 2021 - Gnu Radio and Sample Rates
March 2021 - SDRs and Spectral Displays
February 2021 - Assassin's Creed: Boar War
December 2020 - Demodulating NOAA APT Signals
December 2020 - Understanding Gnu Radio Blocks - Filtering
November 2020 - Hak5 and Gnu Radio
August 2020 - Gnu Radio and FM Demod - Part 3
May 2020 - Gnu Radio and FM Demod - Part 2
November 2019 - To Delay and Conjugate, or Not?
November 2019 - Gnu Radio and FM Demod - Part 1
July 2019 - Linux Mint - An Update
December 2018 - Installing Arch Linux
October 2017 - Upgrading the PS4 Hard Drive
September 2017 - Flatbed Scanner for Linux
September 2017 - The Sony ICD-PX312 and Hold Problem
January 2017 - Fixing a Boot Issue with Linux Mint
November 2016 - Using a USB Thumb Drive in a Honda Accord
September 2016 - Scribd and Open Source Material
April 2016 - Comparing Computers over Time
February 2016 - ISS Night Photo and Google Earth
January 2016 - John Scalzi's 'Old Man's War'
October 2015 - Pat Robertson and Hurricane Joaquin
September 2015 - The Nagasaki A-Bomb
March 2015 - Indiana's 'Religious Freedom'
February 2015 - Apologies to Adafruit
February 2015 - Calculating Radiation Exposure - Take 2
January 2015 - Calculating Radiation Exposure
November 2014 - Programming the Arduino - Part 1
November 2014 - Understanding the LCM1602C LCD Display - Part 2
November 2014 - Understanding the LCM1602C LCD Display - Part 1
September 2014 - Sparkfun Digital Sandbox
December 2013 - Open Letter to Lawfare Blog
December 2013 - Airdroid and Ubuntu Permissions
April 2013 - PS3 and Notworking
January 2013 - Dosbox - Playing Tie Fighter
January 2013 - Old Post on New Computer - Updated
January 2013 - Dosbox - Playing Comanche 3
January 2013 - CSS and Background Images
October 2012 - Felix Baumgartner and Joe Kittinger
September 2012 - The Seagull Thief - Staged or Not
June 2012 - And Now... For Cute Prairie Dogs
June 2012 - Sharing Firefox Profiles between Windows and Ubuntu
May 2012 - "Have Fun. Murder Your Crew." - Redshirts has Arrived!
April 2012 - From Homeserver to Namecheap: The Short Story
April 2012 - Buh-BYE Homeserver
April 2012 - The Hidden Background: The Simple Method
April 2012 - The Hidden Background: A New Method
April 2012 - The Hidden Background: Expanded and Explained
April 2012 - How to Make a Hidden Background
February 2012 - The Apple Problem
October 2011 - When PSD Meets (Turkey) Vultures
October 2011 - Cellphone Keyboard Fail
August 2011 - The New Freemat Primer is Here!
July 2011 - The New Laptop Running Ubuntu
July 2011 - The Recent Server Crash
March 2011 - Creating an Anaglyph with Gimp
December 2010 - Changing the SSH Port for IPTables
December 2010 - Another Malware Infection Report
November 2010 - Good Night, Leslie Nielsen. RIP.
November 2010 - What Just Happened (Part Deux)...?
November 2010 - Mapping My House
November 2010 - What Just Happened...?
November 2010 - My Own Microwave Range
November 2010 - The End is Nearer for Windows
November 2010 - The State of My Data
September 2010 - Engineering Trivia
September 2010 - Finishing Up Looking at our Hardware in Linux
September 2010 - Calculating the Surface Temperature of the Sun
September 2010 - Looking At Your Hardware in Linux
September 2010 - Where Is This Site Now?
September 2010 - Where's This Site Going?
August 2010 - The Digital Television Primer
August 2010 - What? This Site Has Changed AGAIN?!?!
June 2010 - How NOT To Use Advertising in a Web Page
May 2010 - Comments on Solving the Gulf Oil Spill
May 2010 - Using Gimp to Create a Fadeout
October 2009 - The Switch to Linux: Accessing a Second Hard Drive
January 2009 - Understanding Multicasting
November 2008 - IE's Lack of CSS Support
November 2008 - The Engineer's Creed
October 2008 - How to Perform an FCC ID Search
October 2008 - What's in my name?
October 2008 - Setting the KEYTIME on an HP50g
October 2008 - How to Test Your Remote Control: Method #2
October 2008 - How to Test Your Remote Controls
October 2008 - Printing with the HP50g
October 2008 - Mission: Impossible Wallpapers
Want to send me an e-mail? Just use this e-mail address and remove the part that says "no spam".
schafer AT site2241 no spam DOT net