Executes a bounded cascade of normalized second-order sections (SOS). More...
#include <sos_cascade.hpp>
Public Types | |
| using | Coefficients = BiquadCoefficientsT<SampleType> |
Public Member Functions | |
| bool | prepare (std::size_t section_capacity) noexcept |
| Select the usable prefix of fixed storage and clear the active cascade. | |
| bool | prepared () const noexcept |
| std::size_t | capacity () const noexcept |
| std::size_t | size () const noexcept |
| template<typename CoefficientType, std::size_t Extent> | |
| SosCascadeInstallStatus | set_coefficients (std::span< BiquadCoefficientsT< CoefficientType >, Extent > coefficients, SosCascadeTransition transition=SosCascadeTransition::reset_state) noexcept |
| Install one complete SOS cascade. | |
| template<typename CoefficientType, std::size_t Extent> | |
| SosCascadeInstallStatus | set_coefficients (std::span< const BiquadCoefficientsT< CoefficientType >, Extent > coefficients, SosCascadeTransition transition=SosCascadeTransition::reset_state) noexcept |
| SampleType | process (SampleType input) noexcept |
| void | process (SampleType *buffer, std::size_t num_samples) noexcept |
| Process a buffer in place through BiquadT::process_chain(). | |
| void | reset () noexcept |
| Coefficients | coefficients (std::size_t index) const noexcept |
Static Public Member Functions | |
| static constexpr std::size_t | storage_capacity () noexcept |
| static void | process_stereo (SosCascadeT &left, SosCascadeT &right, SampleType *left_buffer, SampleType *right_buffer, std::size_t num_samples) noexcept |
| Process two channels in place, each through its own cascade, with the two channels in vector lanes (BiquadT::process_chain_stereo()). | |
Executes a bounded cascade of normalized second-order sections (SOS).
This class deliberately accepts only BiquadCoefficientsT sections. It is not an arbitrary-order direct-form IIR implementation. Call prepare() on a control thread, then install a complete coefficient span at a block boundary. Validation is whole-cascade transactional: a rejected span leaves both the active coefficients and every recursive state unchanged.
RT contract: storage is a fixed std::array. process(), reset(), prepare(), and coefficient installation perform bounded work and allocate no memory.
| using pulp::signal::SosCascadeT< SampleType, MaxSections >::Coefficients = BiquadCoefficientsT<SampleType> |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Select the usable prefix of fixed storage and clear the active cascade.
Invalid capacities are rejected without changing the object.
|
inlinenoexcept |
|
inlinenoexcept |
Process a buffer in place through BiquadT::process_chain().
The output matches the sample path to the Biquad block path's accuracy contract (see BiquadT::process_chain()): it is not bit-identical, but its error against an exact cascade is never more than 3 dB (RMS) above the sample path's.
|
inlinenoexcept |
|
inlinestaticnoexcept |
Process two channels in place, each through its own cascade, with the two channels in vector lanes (BiquadT::process_chain_stereo()).
Each channel's output is bit-identical to that cascade's block process(); the cascades may hold different coefficients. Cascades of different lengths are processed one after the other, and one cascade passed as both channels runs the left buffer and then the right through it.
|
inlinenoexcept |
|
inlinenoexcept |
Install one complete SOS cascade.
An empty span is a valid bypass.
With preserve_state, sections that remain at the same ordinal keep their recursive tail; newly activated and removed sections are cleared. With reset_state, every section is cleared after the coefficients commit.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticconstexprnoexcept |