Signals and spectra
The signal processing every radio engineer uses daily. Complex baseband and IQ samples, sampling and aliasing, reading a spectrum, filters, pulse shaping and working in decibels.
Overview
Almost everything a modern radio does after the ADC is discrete-time signal processing on complex numbers. A receiver that tunes to 3.5 GHz does not process a 3.5 GHz waveform. It processes a stream of complex samples that describe how the amplitude and phase of that carrier change over time. Once you are fluent with that representation, with the FFT that shows its spectrum and with the filters that shape it, the rest of the physical layer becomes a set of variations on a few operations.
This hub collects those operations. It is for engineers who can write Python or C but have not worked with IQ data, and for RF engineers who want the DSP vocabulary that baseband teams use.
Key ideas
Complex baseband and IQ
A passband signal can be written as x(t) = Re[s(t) exp(j2π fc t)], where fc is the carrier frequency and s(t) is the complex baseband signal. The real part of s(t) is the in-phase component I and the imaginary part is the quadrature component Q. A quadrature mixer recovers them by multiplying the received signal by a cosine and a sine at fc and low-pass filtering both products, as the diagram below shows.
Because s(t) is complex, its spectrum need not be symmetric about 0 Hz. Negative frequencies are real information: they are the part of the band below the carrier. A stream of IQ samples at sample rate fs describes a band fs wide, from −fs/2 to +fs/2 around the tuned frequency. Analogue imperfections show up in characteristic ways. A DC offset gives a spike at 0 Hz, and gain or phase mismatch between I and Q gives a mirror image of each signal reflected about 0 Hz.
Sampling and aliasing
The sampling theorem says that a signal limited to bandwidth B is fully described by 2B real values per second. For a real signal this means sampling faster than twice its highest frequency, the Nyquist rate. For complex sampling, fs complex samples per second cover fs of bandwidth, because each sample carries two real numbers. Any energy outside the band folds back on top of the wanted signal as aliasing. It cannot be removed afterwards, so an analogue anti-alias filter sits before every ADC, and a digital low-pass filter must come before every decimation.
In practice the usable bandwidth is somewhat less than fs, because real filters need a transition band. When you record IQ data, store the sample rate, centre frequency and sample format with it. SigMF defines a metadata file for exactly that purpose.
Spectra, windows and decibels
The discrete Fourier transform, computed with the FFT, turns N samples into N frequency bins spaced fs/N apart. At 1 MHz sample rate and N = 1024 the bins are about 977 Hz wide. A finite block of samples is implicitly multiplied by a rectangular window, which smears a pure tone across many bins. Tapered windows such as Hann reduce that leakage at the cost of a wider main lobe and a lower peak. A Hann window lowers a tone’s FFT peak by about 6 dB and widens the effective noise bandwidth to about 1.5 bins. Averaging many FFTs (Welch’s method) steadies the noise floor.
Spectra are read in decibels. A ratio in dB is 10 log10 of a power ratio, so 3 dB is roughly a factor of 2 and 10 dB a factor of 10. Gains and losses in dB add. Powers do not: two signals at −80 dBm and −90 dBm sum to about −79.6 dBm, computed in milliwatts and converted back. An FFT of raw samples is in dB relative to full scale (dBFS). It only becomes dBm after calibration against a known source.
Filters and pulse shaping
Finite impulse response (FIR) filters can have exactly linear phase, so they delay every frequency equally and do not distort symbol shapes. Infinite impulse response (IIR) filters reach a given selectivity with fewer coefficients but distort phase. Most radio baseband chains use FIR filters, often in polyphase form for resampling.
Pulse shaping decides how much bandwidth each symbol uses. A raised-cosine spectrum with roll-off β occupies (1 + β) times the symbol rate and, sampled at the right instants, gives zero intersymbol interference. Systems split it into two root-raised-cosine filters, one in the transmitter and one in the receiver, so that the receive filter is also the matched filter that maximises SNR at the decision point. The eye diagram shows whether that worked.
Where to start
Begin with /learn/beginner/02-complex-baseband-and-iq/, then /learn/beginner/06-pulse-shaping-and-matched-filters/. /learn/beginner/10-recording-and-reading-iq/ shows how to store and reload IQ files, and /learn/beginner/03-decibels-and-link-budgets/ drills dB arithmetic. Intermediate lessons on multirate filtering are in preparation.
Tools and platforms
| Tool | What it is for | Licence | Platform |
|---|---|---|---|
| NumPy FFT | FFTs and spectra of IQ arrays | BSD-3-Clause | /platforms/opensource/ |
| scipy.signal | Filter design, windows, Welch spectra, resampling | BSD-3-Clause | /platforms/opensource/ |
| GNU Radio | Streaming filters, resamplers and FFT blocks, simulated or live | GPL-3.0 | /platforms/gnuradio/ |
| liquid-dsp | C library of filters, resamplers, NCOs and modems for SDR | MIT | /platforms/opensource/ |
| SigMF | Metadata format for recorded IQ files | Specification under CC-BY-SA-4.0 | /platforms/opensource/ |
For the same filters in fixed-point hardware, see the FPGA Guide hub on DSP on FPGA.
Common mistakes
- Plotting an FFT without
numpy.fft.fftshift, so 0 Hz appears at the left edge and negative frequencies at the right. - Swapping I and Q, which mirrors the spectrum about 0 Hz.
- Decimating by keeping every Nth sample without a low-pass filter first.
- Reading dBFS as dBm, or comparing spectra taken with different FFT sizes, windows or averaging.
- Adding powers in dB. Convert to linear, add, convert back.
- Confusing sample rate with occupied bandwidth.
Going deeper
- H. Nyquist, Certain topics in telegraph transmission theory, Transactions of the AIEE 47(2), 1928.
- C. E. Shannon, Communication in the presence of noise, Proceedings of the IRE 37(1), 1949.
- J. W. Cooley and J. W. Tukey, An algorithm for the machine calculation of complex Fourier series, Mathematics of Computation 19(90), 1965.
- F. J. Harris, On the use of windows for harmonic analysis with the discrete Fourier transform, Proceedings of the IEEE 66(1), 1978.
- The scipy.signal reference and the SigMF specification.