# Software defined radio demodulation

I am trying to increase my knowledge on software defined radio and according to what I have read its hardware consists of three parts:

1. Amplifier
2. Tuner

I just wanted to make sure that my assumption that the filtering and demodulation is done by the computer mathematically is correct.

No, not all filtering is done in software. The ADC must be preceded by an analog low-pass anti-aliasing filter. This can be considered as being part of the ADC subsystem or part of the tuner subsystem, but it exists in either case.

That analog filter is separate from (typically) the much narrower digital filter which passes the signal to be demodulated. There may be more than one such filter depending on the modulation. (Most filtering is done in software because digital filters can have very good characteristics and be adjusted as needed, but the hardware antialiasing filter is a physical necessity.)

The demodulation is indeed done entirely in software.

It is also possible to eliminate the hardware tuner component. This requires an ADC with a sampling rate greater than the desired RF frequency, so this is a strategy typically used only by HF SDRs that operate only up to 30-50 MHz. It has the advantage of a simpler, cleaner signal path, and being able to receive at multiple widely-separated frequencies simultaneously, but requires higher performance from the ADC and DSP.

• Another note for very-wideband digital receivers is needing enough dynamic range when in the presence of strong signals in the receiving band. Jul 31 '16 at 3:18
• @user2943160 Indeed, but I think that's more detail than is really relevant to the question, so I've replaced that part with a less specific statement. Jul 31 '16 at 3:55
• @KevinReidAG6YO just another note: for direct sampling, you just need an ADC with a sampling rate high enough to cover the whole band of interest, as well as phantastic filters that get rid of the rest of the spectrum, so only that band aliases into baseband – practically, you'd mostly see direct samplers working on 0Hz – highest frequency of interest, not in undersampling modes. Jul 31 '16 at 5:32
• Ah by the way, QOTD: twitter.com/derekkozel/status/759289563546255361 "SDR: Sample first, ask later" Jul 31 '16 at 6:46
• @MaryannEthan No, the filter is designed to suit the sample rate, not vice versa. If you want to know more about filtering in SDRs you should post another question, not ask questions in comments. Aug 1 '16 at 18:13

Software defined radio depends on a signal that is well digitizable by the ADC, and that usually includes amplification in the analog domain. The typical signal chain hence would kind of look like:

Antenna ➔ RX Port ➔ LNA ➔ Mixer ➔ Low/Band pass Filter ➔ ADC ➔ DSP ➔
⮤ Synthesizer  -----------------------⭠

• Antenna: Receives EM wave
• RX Port: well, connect the antenna
• LNA (Low Noise Amplifier): The first amplifier in a receive chain dominates the noise figure, hence use a low noise one here, and sprinkle in adjustable amplifiers anywhere you see fit further down before the ADC
• Mixer: Mixes down (and up, and twice up, and...) the receive signal with the local oscillator (LO) as generated by the synthesizer. If it mixes directly to baseband, you get an I/Q "complex" baseband signal (two lines). If it is designed to mix to an IF (intermediate frequency), you just get a single signal.
• Synthesizer: In essence, a programmable oscillator. Typically uses something like fractional-N techniques to generate a lot of selectable frequencies from a single reference oscillator. Frequency error of these frequencies is defined by the reference's performance. Typically addressed by software running on the computer.
• Low pass filter: As per Nyquist you mustn't have any signal more signal than the ADC can represent unambigously; which means that you need to restrict the bandwidth of the analog signal to half the sampling rate per real channel; usually, if done in baseband, you just use a low pass filter for that with half the sampling rate as stop band edge, though it's also common to see Intermediate Frequency (IF) systems that use a Nyquist-rate band around a non-zero frequency.
• ADC (Analog to Digital Converter): Samples the signal at discrete times (dictated by the sampling rate $f_\text{sample}$), holds its value at that instant for as it takes to get a digital reading, sends that reading over to some DSP chain, usually even still on the device
• DSP (Digital Signal Processing): First of all, there's no ADC with e.g. USB, so you need some silicon to buffer samples on one end and on the other hand put them in to computer bus packets. Then, it's often desirable to do some digital signal processing already on the device. For example:
• your synthesizer can generate many frequencies, but not all; hence you still have a frequency offset that you can now get rid of by shifting the signal in frequency domaint (i.e. multiply with $e^{j2\pi f_\text{offset}}$)
• your ADC runs continuously at 2x 100MS/s for I and Q – so the spectrum your observing is $(-\frac{100\text{ MHz}}2, \frac{100\text{ MHz}}2)$ around the center frequency. Problem is: your transport (e.g. Gigabit Ethernet) cannot possibly transmit that many samples ($100\cdot 10^6 \frac{\text S}{\text s}\cdot \frac{16\text{bit [I]}16+\text{bit [I]}}{\text S}=3.2\frac{\text{ Gb}}{\text s} > 1\frac{\text{ Gb}}{\text s}$)
You hence have to filter and decimate in the DSP chain already
• You know your mixer's imperfections (different gains on I and Q), and you want to compensate for those without tasking your computer

Then comes the interconnect to whatever runs your DSP software – for example, a PC, or a single board computer like the popular Raspberry Pi.

They then get a clean sample stream representing a bandwidth "as it was on the air", and then can demodulate it to their will. Modern PC hardware is quite capable, so for example, you can take a laptop, and with something that sends 25 MS/s over network or USB3, look at all the FM broadcast radio range (87–108 MHz) at once, easily, and just pick arbitrarily many stations at once to demodulate to audio and play/save for later etc. At the same time, you could decipher the bus sign information that are present in that spectrum as well.

If the mixer and synthesizer allows, you could tune the same device to 2.4 GHz and reconstruct operation of RC cars, or what your neighbour was typing (which is not really that much of a surprising fact, but makes the round in the media lately.

Or you could receive NOAA weather images, or listen to aircraft transponders, or ship transponders, or just tune in to your friendly ham discussions :)

The nice thing about having the ADC sample a relatively high bandwidth is indeed that good filters are expensive – only in the real world.

If your ADC is not running into any clipping problems, and there's no strong nearby signals that desensitize your analog amplifiers, and let's say you've got a noise floor at -100 dBm/Hz and a CW at -93 dBm, then you'd need a 10 Hz wide filter just to get an SNR of 3dB. Which is pretty complicated and highly specific in analog electronics – but in SDR, you'd just let (if it can do that) the DSP chain give you something very easily processable with a modern CPU, e.g. 0.5MS/s, and then either apply a cascade of decimating filters to further suppress the noise, or just go another route and just estimate the power of that single tone with an algorithm whose job is nothing but to find tones within noise (that could be a so-called parametric spectrum estimator, like ESPRIT).

• +1 for mentioning band-pass filter, but -1 for spreading the misconception that "you mustn't have any signal above your sampling frequency", so total is zero. Aug 2 '16 at 19:05
• @AndrejaKo I'm fully agreeing this wording is wrong; I probably just hoped they skim through the presentation I've linked; I'll reword! Aug 2 '16 at 20:26
• @AndrejaKo better? Aug 2 '16 at 20:29
• Now it's much better! Aug 3 '16 at 6:54
• @MarcusMüller could you elaborate on "Mixer: Mixes down (and up, and twice up, and...) the receive signal with the local oscillator (LO) as generated by the synthesizer. If it mixes directly to baseband, you get an I/Q "complex" baseband signal (two lines). If it is designed to mix to an IF (intermediate frequency), you just get a single signal." ,,on gnu radio I always get to spectrums that I assume represent I and Q no matter how I do the mixing part.
– Jack
Aug 3 '16 at 14:35