Audible SDR
This webpage shows the inner workings of what a basic, typical software-defined radio does, but with the frequencies shifted to be in the audible range. Instead of tuning to around 7 MHz the "RF" is a 32 kHz sampled signal with 6 transmissions between 3 and 15 kHz. Each stage is laid out as the waveform of the signals, audio, spectrum/waterfall or other display as appropriate.
On the air
The page opens as an idealized receiver, without faults or noise but once you're comfortable you can enable issues to work around. Active noise/fault panels are marked active.
ExperimentsactiveHere are some ready made experiments to try, although I'd suggest working through tuning manually first before having a look.
The play buttons should be comfortable and audible. If you want to compare levels use the spectra and look at the dB scales. Full scale is 0dB.
Antenna
analogThe entire signal arrives at the antenna at once. The chaos you hear is just what the antenna hears as a mixture of different frequencies in different patterns and encodings.
NoiseactiveIn real life, even very good setups have noise either from other signals, atmospheric noise depending on the RF band. Try adding some noise even at a low level (0.015 say).
Every real receiver adds noise, and noise is spread across the whole band while a signal sits in one place. Each filter that narrows the band removes noise but keeps the signal, so the signal-to-noise ratio improves by 10·log₁₀ of the bandwidth ratio. Going from a 2 kHz SSB-sized mask to 150 Hz for CW gains about 11 dB, which is why CW gets through when voice does not. FM behaves differently: it is clean down to a threshold and then breaks up suddenly. Try the CQ and NBFM presets as you raise the noise.
RF preselector
analogThe RF preselector is a bandpass filter before the mixer and rest of the SDR. An ideal multiplier would not need it, but real switching mixers also respond at harmonics of the LO (3×, 5×…; see the panel in section 3) and can be overloaded by strong signals far from the wanted one. The preselector stops the mixer from ever seeing them. The grey trace is the antenna signal and the green curve is the filter. Drag on the spectrum to move it. Real designs for filters quickly become cumbersome and might be impractical in terms of cost of parts, quality of parts or ease of tuning.
Local oscillator
analogOne oscillator, two outputs 90° apart: LOI = cos(2πfLOt) and LOQ = −sin(2πfLOt). Played separately they sound identical. The difference is only phase, which the X–Y plot shows as a circle; with no quadrature it would collapse to a line. The frequency is rounded to a multiple of 0.244 Hz so the loop stays seamless. You can pick between ideal sine waves, and more common square waves. Square waves are the base sine wave with odd harmonics added.
Switching mixers and LO harmonicsactiveWhy a square-wave LO also receives at 3× and 5× its frequency, and how the preselector stops it.
Many SDRs, such as the Tayloe detector in the SoftRock, use switches instead of true multipliers. Switching is the same as multiplying by a square wave, and a square wave contains odd harmonics at 3fLO, 5fLO and so on, at 1/3, 1/5… of the amplitude. Each harmonic mixes its own part of the spectrum down to baseband, on top of the wanted signal. The preselector in section 2 is what keeps those frequencies out. The square wave here is band-limited below Nyquist.
Mixers
analogEach path mixes (multiplies) the preselected signal by its LO, the result of this is signals at frequencies of sum and differences. A station at fLO + Δ lands at Δ and at 2fLO + Δ. The I output on its own cannot tell fLO + Δ from fLO − Δ: both fold onto the same audio frequency. This is called an image. With the ISB preset, play I alone and you hear the melody and the bass line on top of each other. Q has the same spectrum magnitude but a different phase, and that phase is what separates them later.
Real mixers are not perfect: the Q branch may have a little more gain than I, the LO split may not be exactly 90°, and LO leakage adds DC. Section 8 covers what that does and how to remove it digitally.
IF filter
analogThe same low-pass filter on I and on Q. In a zero-IF receiver the “IF” is baseband, so this is the channel filter and the ADC’s anti-alias filter in one. It removes the sum products near 2fLO and anything outside the channel. It is also the anti-alias filter for the ADC in the next section: switch it off there and see what folds in. Drag on the spectrum to set the cut-off.
ADC and sample rate
optionalanalog→ digitalIn the ideal receiver the ADC samples at the full 32 kHz, so it changes nothing and you can skip this section.
Sample rate and aliasingactiveWhat the ADC sample rate limits, why the IF filter must come before it, and how SDRs lower the rate.
The IF output is still a continuous voltage. A pair of ADCs samples I and Q at a rate fs, and from then on the receiver only knows the band −fs/2 … +fs/2. Anything outside it does not vanish. It folds back into the band, which is called aliasing, and once it has folded no later filter can separate it from the wanted signal. Lower the sample rate and the spectrum narrows to the green band. With the IF filter in circuit nothing harmful folds in. Switch it off and stations from all over the 16 kHz “RF” band land on top of the one you wanted.
Because I and Q are sampled together, the usable band is the full ±fs/2, twice what a single real ADC at the same rate covers. Real SDRs usually sample fast (an RTL-SDR runs at a few MS/s) and then lower the rate digitally in stages with CIC and half-band filters. Each stage follows the same rule as here: filter first, then drop samples. Lower rates make every later step cheaper.
Complex baseband, I + jQ
digitalThe samples are now numbers in a computer. Treat each pair as one complex sample z = I + jQ. Its spectrum is no longer mirror-symmetric: whatever was above the LO is now at positive frequencies and whatever was below it is at negative frequencies. The X–Y plot traces z in the complex plane.
IQ mismatch and correction
optionalanalog faultdigital fixThe ideal receiver has perfectly matched I and Q paths, so there is nothing to correct and you can skip this section on a first pass.
IQ mismatch and its correctionactiveHow imperfect mixers leak an image across 0 Hz, and how to measure and remove it using only the received signal.
Everything so far assumed a perfect quadrature mixer. Real ones have two I and Q paths built from separate parts, so they never match exactly. With a gain ratio g and a phase error φ the Q path delivers g·sin(θ − φ) instead of sin θ, and the LO leaking into the mixer adds a DC offset to each output. Look back at the LO’s X–Y plot in section 3 while you move the sliders: the circle becomes a tilted ellipse.
The damage shows up as an image. A signal at +Δ also appears, weaker, at −Δ, and the other way round. How much weaker is the image rejection ratio. A 1 dB gain error alone limits it to about 25 dB, and 1° of phase error alone to about 41 dB. That is enough to hear the lower sideband of the ISB station leak into the upper one, which is exactly the job the I + jQ receiver was meant to do.
1 · Inject the fault
These errors are applied in the analog part of the receiver: gain and phase to the Q output of the LO in section 3, and DC offsets at the mixer outputs in section 4. The image is easiest to see with the CQ preset, where two clean tones appear on the positive side, and easiest to hear with the ISB upper preset.
2 · Estimate it from the signal and correct it
The receiver cannot see the fault directly, but it can measure statistics of the received signal. The means give the DC offsets. The ratio of standard deviations gives the gain error. The correlation between I and Q gives the phase error, because ρ = sin ψ with ψ = −φ. The correction is then Q′ = (Q/g − I·sin ψ) / cos ψ. This assumes the true I and Q are uncorrelated and of equal power. That holds for most signals but not for a lone carrier at exactly 0 Hz, so try the AM preset with a fault and watch the estimate go wrong.
| Quantity | Measured from signal | Injected fault | How it is estimated |
|---|---|---|---|
| DC offset I | – | – | mean(I) |
| DC offset Q | – | – | mean(Q) |
| σI, σQ | – | – | standard deviation after removing the mean |
| Gain error | – | – | 20·log₁₀(σQ/σI) |
| Correlation ρ | – | – | mean(I·Q) / (σIσQ) |
| Phase error | – | – | −asin(ρ) |
| Image rejection | – | – | (1 + 2g cos φ + g²) / (1 − 2g cos φ + g²) |
DFT, mask and shift
digitalTake the DFT of the whole loop of z (131 072 points), multiply it by a mask that keeps only the part you want, then roll the bins to move that part along the frequency axis. Because positive and negative frequencies are now separate, the mask can pick a single sideband. The image that stage 4 could not separate is now simply somewhere else on the axis. Drag on the top spectrum to place the mask. The shift moves every component by the same number of hertz, which changes the pitch you hear, and harmonics stop being harmonic, which is why mistuned SSB sounds like Donald Duck.
- Signal
- –
- Power in the mask
- –
- SNR
- –
- Noise bandwidth
- –
The S-meter measures the power inside the mask, as a real receiver’s meter measures what gets through its IF filter, so it includes any noise. Each S-unit is 6 dB, and here S9 is −30 dBFS. It moves with the signal while audio plays. The SNR compares the signal with the noise the receiver lets through, which this simulation can work out exactly because it knows the noise it added. With noise switched on (section 1), narrow the mask and watch the SNR rise as the noise bandwidth falls, until the mask starts cutting into the signal itself.
Why Q matters: the single-mixer receiveractiveHear what a receiver with only an I channel can and cannot separate.
A single-mixer receiver only has I, a real signal whose spectrum is always mirror-symmetric. Its mask can only be mirrored too, and it cannot shift: moving a real signal’s positive half up moves its negative half down. A real direct-conversion receiver tunes with its LO instead. Try it with the ISB presets: the melody and the bass line come out together whatever you do with the mask.
Inverse DFT and detector
digitalThe inverse DFT gives a complex time signal again, but a speaker needs a real one. Turning z into audio is the detector’s job, and each mode of transmission wants a different one.
- Product detector,
Re{z} - For SSB, CW and FSK. A classic receiver multiplies by a beat-frequency oscillator (BFO) and keeps the real part. Here the shift in section 9 is the BFO.
- Envelope,
|z| - The diode detector of a crystal set. It ignores phase, so tuning errors do not matter, but it distorts when one sideband is missing or the carrier fades.
More detectors: synchronous AM and FMactiveDetectors that use the phase of z: a phase-locked loop for AM and a discriminator for FM.
- Synchronous AM,
Re{z·e−jφ̂} - A phase-locked loop follows the carrier and rotates it onto the real axis: a product detector that tunes itself. It still works on a single sideband plus carrier, which halves the noise bandwidth and lets you avoid interference on the other side. Try the “Synchronous AM” preset, then switch to the product detector.
- FM discriminator,
arg(z[n]·z*[n−1]) - The phase step between samples is the instantaneous frequency. This only works with I and Q, because a real signal has no phase to measure. On the FSK station it recovers the data bits as a square wave.