Skip to content
Tutorials Center
My learning

Topics

Lesson 29 of 38 ยท Multirate and Adaptive Filters

Polyphase Filters and CIC Decimators

Make multirate filters efficient with polyphase decomposition, then meet the multiplier-free CIC decimator and its compensation filter, with verified Python code.

A decimator that filters first and discards afterward does a lot of useless work: it computes M outputs and throws M-1 of them away. An interpolator multiplies filter coefficients by long runs of inserted zeros. Polyphase decomposition reorganizes the filter so that no multiplication is wasted. For very high rates, the CIC filter removes multipliers altogether. Both ideas are standard building blocks in software radio, audio converters and resamplers.

Polyphase decomposition

Split an FIR filter h[n] of length N into M shorter sub-filters (phases): e_k[m] = h[mM + k] for k = 0 ... M-1. Each phase contains every M-th coefficient. A decimator by M can then be written as the sum of the phases, each working on one subsampled stream of the input, with every filter running at the low output rate. The workload drops by a factor M.

Why polyphase?

Naive decimator Computes outputs it discards
Polyphase Splits h into M short filters
Gain M times fewer operations

Same output, bit for bit.

1 / 2
Python Polyphase decimator equals filter then downsample

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The two results agree to rounding error. The naive method computes N products for every input sample (so N*M per output kept); the polyphase method computes N per output, a factor M less.

Polyphase interpolation

For an interpolator by L, the filter is split the same way, but now each phase runs at the input rate and produces one of the L interleaved output streams. Zero insertion is never performed. scipy.signal.resample_poly and upfirdn use this idea internally.

Python upfirdn: upsample, filter, downsample in one step

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

CIC filters

A cascaded integrator-comb (CIC) filter does decimation by a large factor (tens to thousands) with only additions and subtractions. It is made from three parts:

  1. N integrators running at the high rate: y[n] = y[n-1] + x[n]
  2. a downsampler by R
  3. N combs (differentiators) at the low rate: y[n] = x[n] - x[n-D] (usually D = 1)

Overall it equals N cascaded moving-average (boxcar) filters of length R. Its magnitude response is |sin(pi f R) / sin(pi f)|^N. The integrators overflow by design, but with two's-complement arithmetic and a register width of N log2(R) + input bits the final result is still exact, a neat property of modular arithmetic.

Python A CIC decimator equals cascaded boxcars

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The structure matches exactly with integer arithmetic. The DC gain is R^N, so real systems scale by it (or use a shift when R is a power of two).

CIC droop and compensation

The CIC magnitude falls like a sinc in the passband, which causes a droop at the edge of the band you want to keep. Also, aliasing from the sinc nulls protects only frequencies near multiples of fs/R. The usual remedy is a small compensation FIR at the low rate whose response rises where the CIC droops, followed by (or combined with) the final decimation.

Python Measuring CIC droop

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

At 0.4 of the output rate the loss is several dB, which a compensation filter must undo. Pick fewer stages N or keep the useful band small relative to the output rate to limit the droop.

When to use which

  • Polyphase FIR: moderate factors, need a sharp, flat passband.
  • CIC: very large rate changes at the first stage of a receiver, especially on FPGAs without multipliers.
  • Typical chain: CIC (large factor) followed by a compensation or half-band FIR (small factors). See decimation and aliasing for the multistage idea.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the main benefit of a polyphase decimator?

    Splitting the filter into phases lets each phase run at the low output rate, cutting the work by the decimation factor.
  2. 2. Which operations does a CIC filter use?

    Integrators and combs are accumulators and differences, so no multipliers are needed.
  3. 3. What is the DC gain of a CIC with decimation R and N stages?

    Each stage is a boxcar of length R with DC gain R, so N stages give R to the power N.
  4. 4. Why is a compensation filter often added after a CIC?

    The CIC response droops towards the band edge; a small FIR at the low rate boosts those frequencies back to a flat level.

Summary

  • Polyphase decomposition splits a filter into M phases so decimators and interpolators skip wasted work.
  • upfirdn and resample_poly use polyphase structures.
  • CIC filters decimate by large factors with adders only; DC gain is R^N and the passband droops.
  • A compensation FIR and multistage design complete a practical chain.

Next: The LMS Adaptive Filter