Skip to main content

Module half_band

Module half_band 

Source
Expand description

Half-band filters and factor-of-two decimation and interpolation.

A half-band low-pass has its cutoff at a quarter of the sample rate and a response symmetric about it, H(f) + H(½ − f) = 1. Its impulse response is then zero at every even offset from the centre except the centre itself (½), so nearly half the taps vanish, and a decimator or interpolator by two needs only about N/4 multiplies per output.

See the book entry Resampling: polyphase, half-band and CIC filters.

Structs§

HalfBandDecimator
Streaming decimation by two with a half-band filter: computes only every other output and skips the zero taps.
HalfBandInterpolator
Streaming interpolation by two with a half-band filter (gain two to preserve the level): the even phase is the delayed input times 2·h_c, the odd phase uses only the odd taps.

Functions§

halfband_lowpass
A half-band low-pass of num_taps = 4k + 3 taps by the Kaiser-windowed sinc h[n] = ½ sinc(n/2) w[n] (centred). Larger beta gives more stopband attenuation and a wider transition (β ≈ 0.1102 (A − 8.7) for an attenuation of A dB).