Before this:Sample rate, bandwidth & Nyquist
Filtering & decimation
Key takeaways A wide IQ capture contains far more than the one channel you want. Digital filtering keeps a chosen slice of spectrum and rejects the rest; decimation then lowers the sample rate to match that narrow slice, slashing the data the rest of the pipeline must handle. The order matters — filter first, then decimate — or out-of-band energy aliases back in. Doing this per channel (“channelising”) is how one SDR feeds many decoders at once.
You’ve captured a couple of megahertz of IQ. Now you need one 12.5 kHz channel out of it, running cheaply enough to do several at a time. That’s filtering and decimation — the first real DSP step in the demodulation pipeline.
What a digital filter does
A digital filter is just arithmetic on the sample stream that passes some frequencies and attenuates others. No physical components — it’s math applied to the IQ. The two kinds you’ll meet:
- Low-pass — keeps frequencies below a cutoff, removes those above.
- Band-pass — keeps a chosen band, rejects everything outside it.
In an SDR, the workhorse is a channel filter: a narrow filter that isolates one signal (say, a single control channel) and discards its neighbours and the noise around them. To centre the channel first, the SDR digitally shifts it to zero frequency (the mixer step) so a simple low-pass filter can do the isolating.
Decimation: lowering the sample rate
Once you’ve filtered down to a narrow channel, you no longer need millions of samples a second to represent it — a 12.5 kHz channel needs only a small fraction of the original rate. Decimation drops the rate by keeping, say, every 100th sample. The result is a much smaller stream that still contains your channel in full.
Why bother? Because every later stage — demodulation, clock recovery, decoding — does work per sample. Fewer samples = far less CPU.
Worked example. Capture at 2.4 MSa/s but you only need a single 12.5 kHz channel. Filter to that channel, then decimate by a factor of 100 to 24 kSa/s — still well above Nyquist for a 12.5 kHz signal, but a hundredth of the data. Run that for ten channels at once and you’re still processing far less than the single raw stream. The decimation factor is yours to choose: just keep the result comfortably wider than the channel you kept.
Why filter before decimating?
Order is everything. Decimation reduces the representable bandwidth (it’s the Nyquist limit in reverse). If any energy still sits outside that smaller bandwidth when you decimate, it folds back as aliasing and contaminates your channel — a phantom signal landing right on top of the one you want.
So you filter first to remove everything outside the channel, then decimate to throw away the now-unnecessary samples. Filter-then-decimate is the universal pattern.
How this fits the demodulation pipeline
Filtering and decimation are the front of every channel’s demodulation pipeline: shift the channel to centre, filter it, decimate. Because it’s all arithmetic on the shared IQ stream, GopherTrunk runs many of these in parallel — one for the control channel and one for each voice channel it’s following — from a single capture. That parallel channelising is exactly how it can track several calls at once.
Quick check: why must you filter before decimating?
Recap
- Digital filters keep a chosen band and reject the rest (low-pass, band-pass, channel).
- Decimation lowers the sample rate to match a narrow channel, saving CPU.
- Always filter then decimate to avoid aliasing.
- Channelising the shared IQ lets one SDR feed many parallel decoders.
Next: the whole chain assembled — the demodulation pipeline from tune to decoded bits.
Frequently asked questions
What is decimation in DSP?
Decimation is reducing a signal’s sample rate by keeping only every Nth sample after filtering out the frequencies that would otherwise alias. It’s how an SDR narrows a wide capture down to just one channel’s worth of bandwidth, which dramatically cuts the amount of data the rest of the pipeline has to process.
Why filter before decimating?
Decimation lowers the sample rate, which shrinks the bandwidth that can be represented. Any energy outside that new, smaller bandwidth would fold back as aliasing and corrupt the signal. Filtering first removes that out-of-band energy, so decimation only throws away samples you no longer need. Filter-then-decimate is the standard order for this reason.
What does a digital filter actually do?
A digital filter passes some frequencies and attenuates others, working on the stream of samples with arithmetic. A low-pass filter keeps low frequencies and removes high ones; a band-pass filter keeps a chosen band and rejects everything outside it. In an SDR, a channel filter isolates one narrow signal from a wide capture.
How does an SDR follow many channels from one capture?
It channelises — for each channel of interest, it digitally shifts that channel to centre, applies a filter to isolate it, and decimates to a low sample rate suited to that one signal. Because this is just math on the shared IQ stream, the SDR can run several of these in parallel, which is how GopherTrunk follows a control channel and multiple voice channels at once.