Module hbf

Module hbf 

Source
Expand description

Half-band filters and cascades

Used to perform very efficient high-dynamic range rate changes by powers of two.

Symmetric and anti-symmetric FIR filter prototype.

§Generics

  • M: number of taps, one-sided. The filter has effectively 2*M DSP taps

§Half band decimation/interpolation filters

Half-band filters (rate change of 2) and cascades of HBFs are implemented in HbfDec and HbfInt etc. The half-band filter has unique properties that make it preferable in many cases:

  • only needs M multiplications (fused multiply accumulate) for 4*M taps
  • HBF decimator stores less state than a generic FIR filter
  • as a FIR filter has linear phase/flat group delay
  • very small passband ripple and excellent stopband attenuation
  • as a cascade of decimation/interpolation filters, the higher-rate filters need successively fewer taps, allowing the filtering to be dominated by only the highest rate filter with the fewest taps
  • In a cascade of HBF the overall latency, group delay, and impulse response length are dominated by the lowest-rate filter which, due to its manageable transition band width (compared to single-stage filters) can be smaller, shorter, and faster.
  • high dynamic range and inherent stability compared with an IIR filter
  • can be combined with a CIC filter for non-power-of-two or even higher rate changes

The implementations here are all no_std and no-alloc. They support (but don’t require) in-place filtering to reduce memory usage. They unroll and optimize extremely well targetting current architectures, e.g. requiring less than 4 instructions per input item for the full HbfDecCascade on Skylake. The filters are optimized for decent block sizes and perform best (i.e. with negligible overhead) for blocks of 32 high-rate items or more, depending very much on architecture.

Structs§

EvenAntiSymmetric
Linear phase FIR taps for odd = false and symmetric = false
EvenSymmetric
Linear phase FIR taps for odd = false and symmetric = true
HbfDec
Half band decimator (decimate by two) state
HbfInt
Half band interpolator (interpolation rate 2) state
OddAntiSymmetric
Linear phase FIR taps for odd = true and symmetric = false
OddSymmetric
Linear phase FIR taps for odd = true and symmetric = true

Constants§

HBF_CASCADE_BLOCK
Cascade block size
HBF_DEC_CASCADE
HBF decimation cascade
HBF_INT_CASCADE
HBF interpolation cascade
HBF_PASSBAND
Passband width in units of lowest sample rate
HBF_TAPS
Half band filters taps
HBF_TAPS_98
Half band filter cascade taps

Functions§

hbf_dec_response_length
Response length, effective number of taps
hbf_int_response_length
Response length, effective number of taps

Type Aliases§

HbfDec2
Half-band decimation filter state
HbfDec4
HBF Decimate-by-4 cascade state
HbfDec8
HBF Decimate-by-8 cascade state
HbfDec16
HBF Decimate-by-16 cascade state
HbfDec32
HBF Decimate-by-32 cascade state
HbfInt2
Half-band interpolation filter state
HbfInt4
HBF interpolate-by-4 cascade state
HbfInt8
HBF interpolate-by-8 cascade state
HbfInt16
HBF interpolate-by-16 cascade state
HbfInt32
HBF interpolate-by-32 cascade state