|
| void | configure (const HalfBandIirDesign &design) noexcept |
| void | reset () noexcept |
| std::size_t | coefficient_count () const noexcept |
| std::size_t | sections_a () const noexcept |
| std::size_t | sections_b () const noexcept |
| bool | configured () const noexcept |
| | True when a valid design is loaded; an unconfigured stage emits silence.
|
| void | upsample (const SampleType *input, SampleType *output, std::size_t n) noexcept |
| | n input samples -> 2n output samples.
|
| void | downsample (const SampleType *input, SampleType *output, std::size_t n) noexcept |
| | 2n input samples -> n output samples. output may alias input.
|
template<typename SampleType = float>
class pulp::signal::HalfBandIirStageT< SampleType >
Fixed-storage polyphase half-band stage that filters whole blocks: the engine behind HalfBandUpsampler2xT, HalfBandDownsampler2xT, and the oversampler's polyphase lane.
configure() takes a HalfBandIirDesign; an invalid (empty) design leaves the stage emitting silence.
RT contract: no member allocates; configure() and reset() are control-thread setup, upsample() / downsample() are realtime safe.
The per-path section counts are template parameters inside the kernels, so the coefficients and recurrence state live in registers for the length of a block and nothing is zeroed or re-loaded per sample. Each section is evaluated as y = a*x + x1 - a*y1, which leaves a single fused multiply-add on the y1 recurrence. Up and down directions keep separate state.
template<typename SampleType = float>
Coefficients and recurrence state are kept in double even for a float stage.
The kernel is scalar and bound by the recurrence latency, and on current cores a scalar double fused multiply-add has the same latency and throughput as a float one, so the wider state is free; what it buys is a round trip whose rounding floor is the float output's own (about -153 dB) rather than the accumulated rounding of every section (about -132 to -139 dB in float). Extended-precision state is the classic remedy for roundoff noise accumulating through cascaded recursive sections (L. B. Jackson, "Roundoff-noise analysis for fixed-point
digital filters realized in cascade or parallel form", IEEE Trans. Audio Electroacoust. 18(2), 1970; N. J. Higham, "Accuracy and Stability
of Numerical Algorithms", 2nd ed., SIAM 2002, ch. 3).