|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Stateful direct-form II transposed IIR filter. More...
#include <fft.H>
Public Member Functions | |
| LFilter ()=default | |
| Default constructor for an unconfigured LFilter. | |
| LFilter (const Array< Real > &numerator, const Array< Real > &denominator) | |
| Construct a linear filter from numerator and denominator arrays. | |
| LFilter (const IIRCoefficients &coeffs) | |
| Construct a linear filter from IIRCoefficients. | |
| LFilter (const BiquadSection §ion) | |
| Construct a linear filter from a single BiquadSection. | |
| template<typename NumContainer , typename DenContainer > requires Is_Real_Container<NumContainer> | |
| and Is_Real_Container< DenContainer > | LFilter (const NumContainer &numerator, const DenContainer &denominator) |
| Construct a linear filter from any real containers. | |
| LFilter (const LFilter &other)=default | |
| Copy the coefficients and the state of another filter. | |
| LFilter (LFilter &&other) noexcept | |
| Take the coefficients and the state of another filter, which is left unconfigured, as built by default. | |
| LFilter & | operator= (const LFilter &other)=default |
| Copy the coefficients and the state of another filter. | |
| LFilter & | operator= (LFilter &&other) noexcept |
| Exchange this filter with another, which is left with the previous coefficients and state of this one. | |
| void | swap (LFilter &other) noexcept |
| Exchange in O(1) the coefficients and the state of this filter and another. | |
| size_t | order () const noexcept |
| Returns the filter order (number of feedback coefficients - 1). | |
| bool | configured () const noexcept |
| Returns whether the filter has been initialized with coefficients. | |
| const IIRCoefficients & | coefficients () const noexcept |
| Returns the active normalized filter coefficients. | |
| const Array< Real > & | state () const noexcept |
| Returns the current internal delay-line state. | |
| void | reset () |
| Resets the delay-line state to zero. | |
| void | set_state (const Array< Real > &new_state) |
| Manually overrides the delay-line state. | |
| Array< Real > | filter (const Array< Real > &signal) |
| Processes a signal block through the stateful filter. | |
| template<typename Container > requires Is_Real_Container<Container> | |
| Array< Real > | filter (const Container &signal) |
| Processes a real-valued container through the stateful filter. | |
Private Member Functions | |
| void | require_configured (const char *ctx) const |
| void | initialize_state () |
Private Attributes | |
| IIRCoefficients | coeffs_ |
| Array< Real > | state_ |
| bool | configured_ = false |
Stateful direct-form II transposed IIR filter.
|
default |
Default constructor for an unconfigured LFilter.
|
inlineexplicit |
Construct a linear filter from numerator and denominator arrays.
The filter is normalized such that a[0] = 1.
| numerator | Feed-forward coefficients (B). |
| denominator | Feed-back coefficients (A). |
Definition at line 11749 of file fft.H.
References Aleph::FFT< Real >::LFilter::initialize_state().
|
inlineexplicit |
Construct a linear filter from IIRCoefficients.
| coeffs | IIR coefficients. |
|
inlineexplicit |
Construct a linear filter from a single BiquadSection.
| section | Biquad section. |
|
inlineexplicit |
|
default |
Copy the coefficients and the state of another filter.
| [in] | other | filter to copy. |
| std::bad_alloc | if the arrays cannot be allocated. |
|
inlinenoexcept |
Take the coefficients and the state of another filter, which is left unconfigured, as built by default.
The implicit move took the coefficients but copied the configured flag: the moved-from filter then said that it was configured, and filter() computed its order from an empty denominator.
| [in,out] | other | filter to move from. |
|
inlinenoexcept |
Returns the active normalized filter coefficients.
Definition at line 11851 of file fft.H.
References Aleph::FFT< Real >::LFilter::coeffs_.
|
inlinenoexcept |
Returns whether the filter has been initialized with coefficients.
Definition at line 11845 of file fft.H.
References Aleph::FFT< Real >::LFilter::configured_.
|
inline |
Processes a signal block through the stateful filter.
Definition at line 11882 of file fft.H.
References Aleph::FFT< Real >::LFilter::coeffs_, Aleph::FFT< Real >::IIRCoefficients::denominator, Aleph::FFT< Real >::iir_filter_impl(), Aleph::FFT< Real >::IIRCoefficients::numerator, Aleph::FFT< Real >::LFilter::require_configured(), and Aleph::FFT< Real >::LFilter::state_.
Referenced by Aleph::FFT< Real >::LFilter::filter(), Aleph::FFT< Real >::LFilterBank::filter_channel(), and Aleph::FFT< Real >::LFilterBank::filter_channel().
|
inline |
Processes a real-valued container through the stateful filter.
Definition at line 11897 of file fft.H.
References Aleph::FFT< Real >::build_real_input(), and Aleph::FFT< Real >::LFilter::filter().
|
inlineprivate |
Definition at line 11730 of file fft.H.
References Aleph::FFT< Real >::LFilter::coeffs_, Aleph::Array< T >::create(), Aleph::FFT< Real >::IIRCoefficients::denominator, Aleph::FFT< Real >::LFilter::order(), Aleph::Array< T >::size(), and Aleph::FFT< Real >::LFilter::state_.
Referenced by Aleph::FFT< Real >::LFilter::LFilter().
|
default |
Copy the coefficients and the state of another filter.
| [in] | other | filter to copy. |
| std::bad_alloc | if the arrays cannot be allocated. |
|
inlinenoexcept |
Exchange this filter with another, which is left with the previous coefficients and state of this one.
| [in,out] | other | filter to move from. |
Definition at line 11820 of file fft.H.
References Aleph::FFT< Real >::LFilter::swap().
|
inlinenoexcept |
Returns the filter order (number of feedback coefficients - 1).
Definition at line 11839 of file fft.H.
References Aleph::FFT< Real >::LFilter::coeffs_, Aleph::FFT< Real >::IIRCoefficients::denominator, Aleph::Array< T >::is_empty(), and Aleph::Array< T >::size().
Referenced by Aleph::FFT< Real >::LFilter::initialize_state().
|
inlineprivate |
Definition at line 11723 of file fft.H.
References ah_runtime_error_if, and Aleph::FFT< Real >::LFilter::configured_.
Referenced by Aleph::FFT< Real >::LFilter::filter(), Aleph::FFT< Real >::LFilter::reset(), and Aleph::FFT< Real >::LFilter::set_state().
|
inline |
Resets the delay-line state to zero.
Definition at line 11863 of file fft.H.
References Aleph::FFT< Real >::LFilter::require_configured(), Aleph::Array< T >::size(), and Aleph::FFT< Real >::LFilter::state_.
|
inline |
Manually overrides the delay-line state.
Definition at line 11871 of file fft.H.
References ah_invalid_argument_if, Aleph::FFT< Real >::LFilter::require_configured(), Aleph::Array< T >::size(), and Aleph::FFT< Real >::LFilter::state_.
|
inlinenoexcept |
Returns the current internal delay-line state.
Definition at line 11857 of file fft.H.
References Aleph::FFT< Real >::LFilter::state_.
|
inlinenoexcept |
Exchange in O(1) the coefficients and the state of this filter and another.
| [in,out] | other | filter to exchange with. |
Definition at line 11830 of file fft.H.
References Aleph::FFT< Real >::LFilter::coeffs_, Aleph::FFT< Real >::LFilter::configured_, Aleph::FFT< Real >::IIRCoefficients::denominator, Aleph::FFT< Real >::IIRCoefficients::numerator, Aleph::FFT< Real >::LFilter::state_, and Aleph::Array< T >::swap().
Referenced by Aleph::FFT< Real >::LFilter::operator=().
|
private |
Definition at line 11718 of file fft.H.
Referenced by Aleph::FFT< Real >::LFilter::coefficients(), Aleph::FFT< Real >::LFilter::filter(), Aleph::FFT< Real >::LFilter::initialize_state(), Aleph::FFT< Real >::LFilter::order(), and Aleph::FFT< Real >::LFilter::swap().
|
private |
Definition at line 11720 of file fft.H.
Referenced by Aleph::FFT< Real >::LFilter::configured(), Aleph::FFT< Real >::LFilter::require_configured(), and Aleph::FFT< Real >::LFilter::swap().
|
private |
Definition at line 11719 of file fft.H.
Referenced by Aleph::FFT< Real >::LFilter::filter(), Aleph::FFT< Real >::LFilter::initialize_state(), Aleph::FFT< Real >::LFilter::reset(), Aleph::FFT< Real >::LFilter::set_state(), Aleph::FFT< Real >::LFilter::state(), and Aleph::FFT< Real >::LFilter::swap().