A decimator is a digital signal processing block that reduces the sample rate of a signal by an integer factor M, typically preceded by a low-pass filter to prevent aliasing. The combined filter-plus-downsampler is often called a decimation filter.
In practice
In FPGA designs, decimators appear wherever a high-rate data stream must be reduced to a lower rate for further processing or output. A common example is following an oversampled ADC (such as a sigma-delta converter running at several MHz) with a CIC or FIR decimation filter to produce audio- or control-bandwidth samples at rates like 48 kHz or a few kHz. Without the anti-aliasing filter stage, frequency components above half the output sample rate fold back into the passband as aliases.
The most resource-efficient decimation filter structure for large decimation ratios on FPGAs is the Cascaded Integrator-Comb (CIC) filter, which requires no multipliers and operates entirely with adders and registers. CIC filters do introduce a passband droop that steepens toward the band edge, so a compensation FIR filter is commonly added after the CIC stage to flatten the passband before final use. For modest decimation ratios (typically 2 to 16), a polyphase FIR decomposition is often more area-efficient than a CIC.
A key FPGA implementation consideration is pipelining and clock domain management. The integrator stages run at the input (high) sample rate, while the comb stages run at the decimated (low) output rate, with a rate-change element between them. Getting this boundary right in HDL is a common source of functional bugs, particularly when the decimation ratio is configurable at runtime. The output word width also grows with decimation: a CIC decimating by M with N stages widens the data path by N*log2(M) bits, which must be accounted for to avoid overflow or quantization error.
Frequently asked
What is the difference between a decimator and a downsampler?
A downsampler simply discards M-1 out of every M samples with no filtering. A decimator combines a low-pass anti-aliasing filter with the downsampling operation. The filter band-limits the signal to below half the output sample rate before samples are dropped, preventing aliasing. In practice, 'decimator' usually implies the complete filter-plus-downsampler chain.
Why is a CIC filter commonly used for decimation in FPGAs rather than a standard FIR?
CIC filters use only additions, subtractions, and registers -- no multipliers. This makes them extremely compact in logic fabric and able to run at high clock rates. For large decimation ratios (e.g., 64 to 4096), a direct FIR would require many taps and multipliers, consuming far more DSP
slices and routing resources. The tradeoff is that the CIC frequency response is not flat; it rolls off toward the band edge and must often be compensated by a follow-on FIR stage.
How do I calculate the output word width of a CIC decimation filter?
For a
CIC with N stages decimating by factor M, the maximum output word width is B_in + N*ceil(log2(M)) bits, where B_in is the input word width. This represents the worst-case signal growth through the integrator chain. In practice many implementations truncate or round intermediate results, accepting small quantization noise in exchange for narrower data paths.
Can the decimation factor M be changed at runtime in an FPGA implementation?
Yes, but it requires care. The comb section sample rate, downstream clock enables, and output word width handling all depend on M. A common approach is to keep the integrators running at the full input rate and control the comb section with a programmable clock-enable strobe that fires every M input cycles. Output word width accommodation is typically handled by either fixing it for the maximum M or using a configurable shift/truncation stage.
What is multistage decimation, and when is it used?
Multistage decimation splits a large overall decimation ratio into a cascade of smaller stages -- for example, decimating by 256 as four successive stages of 4. This is often more efficient than a single large
CIC or FIR because each stage operates on a progressively lower sample rate, reducing the total computation and storage required. It also allows mixing filter types: a CIC for the coarse initial stages followed by a compensation FIR at the final low rate.
Differentiators vs similar concepts
A decimator is often confused with a simple downsampler. Downsampling refers only to the sample-rate reduction step (keeping every Mth sample). Decimation specifically includes the mandatory anti-aliasing low-pass filter that precedes the downsampler. The term is also sometimes conflated with interpolation (the dual operation that increases sample rate); an interpolator inserts zeros between samples and filters, while a decimator filters then removes samples.