|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Stateful cascade of second-order sections. More...
#include <fft.H>
Public Member Functions | |
| SOSFilter ()=default | |
| Default constructor for an unconfigured SOSFilter. | |
| SOSFilter (const Array< BiquadSection > §ions) | |
| Construct a cascade of second-order sections (SOS). | |
| template<typename SectionsContainer > requires Is_Biquad_Container<SectionsContainer> | |
| SOSFilter (const SectionsContainer §ions) | |
| Construct a cascade of SOS from any biquad container. | |
| SOSFilter (const SOSFilter &other)=default | |
| Copy the sections and the states of another cascade. | |
| SOSFilter (SOSFilter &&other) noexcept | |
| Take the sections and the states of another cascade, which is left unconfigured, as built by default. | |
| SOSFilter & | operator= (const SOSFilter &other)=default |
| Copy the sections and the states of another cascade. | |
| SOSFilter & | operator= (SOSFilter &&other) noexcept |
| Exchange this cascade with another, which is left with the previous sections and states of this one. | |
| void | swap (SOSFilter &other) noexcept |
| Exchange in O(1) the sections and the states of this cascade and another. | |
| size_t | num_sections () const noexcept |
| Returns the number of sections in the cascade. | |
| bool | configured () const noexcept |
| Returns whether the filter has been configured. | |
| const Array< Real > & | state (const size_t index) const |
Returns the current delay-line state of section index. | |
| void | reset () |
| Resets all internal delay lines to zero. | |
| Array< Real > | filter (const Array< Real > &signal) |
| Processes a signal block through the stateful SOS cascade. | |
| template<typename Container > requires Is_Real_Container<Container> | |
| Array< Real > | filter (const Container &signal) |
| Processes a real-valued container through the stateful SOS cascade. | |
Private Member Functions | |
| void | require_configured (const char *ctx) const |
| void | initialize_states () |
Private Attributes | |
| Array< BiquadSection > | sections_ |
| Array< IIRCoefficients > | coeffs_ |
| Array< Array< Real > > | states_ |
| bool | configured_ = false |
Stateful cascade of second-order sections.
|
default |
Default constructor for an unconfigured SOSFilter.
|
inlineexplicit |
Construct a cascade of second-order sections (SOS).
| sections | Array of biquad sections. |
Definition at line 11938 of file fft.H.
References ah_invalid_argument_if, Aleph::FFT< Real >::SOSFilter::coeffs_, Aleph::FFT< Real >::SOSFilter::initialize_states(), Aleph::FFT< Real >::normalize_iir_coefficients(), and Aleph::FFT< Real >::SOSFilter::sections_.
|
inlineexplicit |
Construct a cascade of SOS from any biquad container.
| SectionsContainer | Container of BiquadSection. |
| sections | Biquad sections. |
|
default |
Copy the sections and the states of another cascade.
| [in] | other | cascade to copy. |
| std::bad_alloc | if the arrays cannot be allocated. |
|
inlinenoexcept |
Take the sections and the states of another cascade, which is left unconfigured, as built by default.
The implicit move took the sections but copied the configured flag: the moved-from cascade then said that it was configured, and filter() returned its input unchanged, through no section.
| [in,out] | other | cascade to move from. |
|
inlinenoexcept |
Returns whether the filter has been configured.
Definition at line 12023 of file fft.H.
References Aleph::FFT< Real >::SOSFilter::configured_.
|
inline |
Processes a signal block through the stateful SOS cascade.
Definition at line 12049 of file fft.H.
References Aleph::FFT< Real >::SOSFilter::coeffs_, Aleph::FFT< Real >::iir_filter_impl(), Aleph::FFT< Real >::SOSFilter::require_configured(), and Aleph::FFT< Real >::SOSFilter::states_.
Referenced by Aleph::FFT< Real >::SOSFilter::filter(), Aleph::FFT< Real >::SOSFilterBank::filter_channel(), Aleph::FFT< Real >::SOSFilterBank::filter_channel(), and Aleph::FFT< Real >::sosfilt().
|
inline |
Processes a real-valued container through the stateful SOS cascade.
Definition at line 12071 of file fft.H.
References Aleph::FFT< Real >::build_real_input(), and Aleph::FFT< Real >::SOSFilter::filter().
|
inlineprivate |
Definition at line 11919 of file fft.H.
References Aleph::FFT< Real >::SOSFilter::coeffs_, Aleph::Array< T >::create(), Aleph::Array< T >::size(), Aleph::FFT< Real >::SOSFilter::state(), and Aleph::FFT< Real >::SOSFilter::states_.
Referenced by Aleph::FFT< Real >::SOSFilter::SOSFilter().
|
inlinenoexcept |
Returns the number of sections in the cascade.
Definition at line 12017 of file fft.H.
References Aleph::FFT< Real >::SOSFilter::sections_.
|
default |
Copy the sections and the states of another cascade.
| [in] | other | cascade to copy. |
| std::bad_alloc | if the arrays cannot be allocated. |
|
inlinenoexcept |
Exchange this cascade with another, which is left with the previous sections and states of this one.
| [in,out] | other | cascade to move from. |
Definition at line 11998 of file fft.H.
References Aleph::FFT< Real >::SOSFilter::swap().
|
inlineprivate |
Definition at line 11912 of file fft.H.
References ah_runtime_error_if, and Aleph::FFT< Real >::SOSFilter::configured_.
Referenced by Aleph::FFT< Real >::SOSFilter::filter(), and Aleph::FFT< Real >::SOSFilter::reset().
|
inline |
Resets all internal delay lines to zero.
Definition at line 12039 of file fft.H.
References Aleph::FFT< Real >::SOSFilter::require_configured(), and Aleph::FFT< Real >::SOSFilter::states_.
|
inline |
Returns the current delay-line state of section index.
Definition at line 12030 of file fft.H.
References ah_out_of_range_error_if, Aleph::Array< T >::size(), and Aleph::FFT< Real >::SOSFilter::states_.
Referenced by Aleph::FFT< Real >::SOSFilter::initialize_states().
|
inlinenoexcept |
Exchange in O(1) the sections and the states of this cascade and another.
| [in,out] | other | cascade to exchange with. |
Definition at line 12008 of file fft.H.
References Aleph::FFT< Real >::SOSFilter::coeffs_, Aleph::FFT< Real >::SOSFilter::configured_, Aleph::FFT< Real >::SOSFilter::sections_, and Aleph::FFT< Real >::SOSFilter::states_.
Referenced by Aleph::FFT< Real >::SOSFilter::operator=().
|
private |
Definition at line 11907 of file fft.H.
Referenced by Aleph::FFT< Real >::SOSFilter::SOSFilter(), Aleph::FFT< Real >::SOSFilter::filter(), Aleph::FFT< Real >::SOSFilter::initialize_states(), and Aleph::FFT< Real >::SOSFilter::swap().
|
private |
Definition at line 11909 of file fft.H.
Referenced by Aleph::FFT< Real >::SOSFilter::configured(), Aleph::FFT< Real >::SOSFilter::require_configured(), and Aleph::FFT< Real >::SOSFilter::swap().
|
private |
Definition at line 11906 of file fft.H.
Referenced by Aleph::FFT< Real >::SOSFilter::SOSFilter(), Aleph::FFT< Real >::SOSFilter::num_sections(), and Aleph::FFT< Real >::SOSFilter::swap().
|
private |
Definition at line 11908 of file fft.H.
Referenced by Aleph::FFT< Real >::SOSFilter::filter(), Aleph::FFT< Real >::SOSFilter::initialize_states(), Aleph::FFT< Real >::SOSFilter::reset(), Aleph::FFT< Real >::SOSFilter::state(), and Aleph::FFT< Real >::SOSFilter::swap().