Class filter¶
class filter<T> base¶
template <typename T>
class filter { … } Abstract base class for single-argument filters, mainly intended for DSP processing.
destructor ~filter<T>() ¶
virtual ~filter() function reset() ¶
virtual void reset() Resets the internal state (such as a delay line).
The default implementation does nothing; subclasses that keep state between calls should override this.
Fully qualified name: kfr::filter<T>::reset()
Declared at base/filter.hpp:54
function apply(T (&)[Size]) ¶
template <size_t Size>
void apply(T (&buffer)[Size]) Applies the filter in-place to a fixed-size C array.
| buffer | Array to filter; the result is written back into it. |
Fully qualified name: kfr::filter<T>::apply(T (&)[Size])
Declared at base/filter.hpp:61
function apply(T (&)[Size], T (&)[Size]) ¶
template <size_t Size>
void apply(T (&dest)[Size], T (&src)[Size]) Applies the filter to a fixed-size C array and writes the result to another array.
| dest | Destination array. |
| src | Source array. |
Fully qualified name: kfr::filter<T>::apply(T (&)[Size], T (&)[Size])
Declared at base/filter.hpp:73
function apply(univector<T, Tag> &) ¶
template <univector_tag Tag>
void apply(univector<T, Tag>& buffer) Applies the filter in-place to a univector.
| buffer | Vector to filter; the result is written back into it. |
Fully qualified name: kfr::filter<T>::apply(univector<T, Tag> &)
Declared at base/filter.hpp:83
function apply(univector<T, Tag1> &, const univector<T, Tag2> &) ¶
template <univector_tag Tag1, univector_tag Tag2>
void apply(univector<T, Tag1>& dest, const univector<T, Tag2>& src) Applies the filter to a univector and writes the result to another univector.
| dest | Destination vector. Resized to match src when empty. |
| src | Source vector. |
Fully qualified name: kfr::filter<T>::apply(univector<T, Tag1> &, const univector<T, Tag2> &)
Declared at base/filter.hpp:95
function apply(T *, size_t) ¶
void apply(T* buffer, size_t size) Applies the filter in-place to a raw buffer.
| buffer | Pointer to the sample buffer. |
| size | Number of samples. |
Fully qualified name: kfr::filter<T>::apply(T *, size_t)
Declared at base/filter.hpp:107
function apply(T *, const T *, size_t) ¶
void apply(T* dest, const T* src, size_t size) Applies the filter to a raw buffer and writes the result to another buffer.
| dest | Destination buffer. |
| src | Source buffer. |
| size | Number of samples to process. |
Fully qualified name: kfr::filter<T>::apply(T *, const T *, size_t)
Declared at base/filter.hpp:116
function apply_zeros(T (&)[Size]) ¶
template <size_t Size>
void apply_zeros(T (&output)[Size]) Feeds zero-valued samples to the filter and writes its tail to a fixed-size C array.
| output | Destination array for the tail samples. |
Fully qualified name: kfr::filter<T>::apply_zeros(T (&)[Size])
Declared at base/filter.hpp:123
function apply_zeros(univector<T, Tag> &) ¶
template <univector_tag Tag>
void apply_zeros(univector<T, Tag>& output) Feeds zero-valued samples to the filter and writes its tail to a univector.
| output | Destination vector for the tail samples. |
Fully qualified name: kfr::filter<T>::apply_zeros(univector<T, Tag> &)
Declared at base/filter.hpp:133
function apply_zeros(T *, size_t) ¶
void apply_zeros(T* output, size_t size) Feeds size zero-valued samples to the filter and writes the resulting tail.
The input zeros are processed in bounded chunks, preserving the filter state between chunks.
| output | Destination buffer for the tail samples. |
| size | Number of tail samples to generate. |
Fully qualified name: kfr::filter<T>::apply_zeros(T *, size_t)
Declared at base/filter.hpp:145
function apply(univector<T, Tag> &, const expression_handle<T, 1> &) ¶
template <univector_tag Tag>
void apply(univector<T, Tag>& dest, const expression_handle<T, 1>& src) Evaluates src into dest through the filter.
| dest | Destination univector. |
| src | Source expression handle. |
Fully qualified name: kfr::filter<T>::apply(univector<T, Tag> &, const expression_handle<T, 1> &)
Declared at base/filter.hpp:164
function apply(T *, const expression_handle<T, 1> &, size_t) ¶
void apply(T* dest, const expression_handle<T, 1>& src, size_t size) Evaluates src into a raw destination buffer through the filter.
| dest | Destination buffer. |
| src | Source expression handle. |
| size | Number of samples to process. |
Fully qualified name: kfr::filter<T>::apply(T *, const expression_handle<T, 1> &, size_t)
Declared at base/filter.hpp:175
function apply(univector<T, Tag> &, const Expr &) ¶
template <univector_tag Tag, input_expression Expr>
void apply(univector<T, Tag>& dest, const Expr& src) Evaluates the 1-dimensional expression src into dest through the filter.
| dest | Destination univector. |
| src | Source expression. |
Fully qualified name: kfr::filter<T>::apply(univector<T, Tag> &, const Expr &)
Declared at base/filter.hpp:187
function apply(T *, const Expr &, size_t) ¶
template <input_expression Expr>
void apply(T* dest, const Expr& src, size_t size) Evaluates the 1-dimensional expression src into a raw destination buffer through the filter.
| dest | Destination buffer. |
| src | Source expression. |
| size | Number of samples to process. |
Fully qualified name: kfr::filter<T>::apply(T *, const Expr &, size_t)
Declared at base/filter.hpp:201
function process_buffer(T *, const T *, size_t) ¶
virtual void process_buffer(T* dest, const T* src, size_t size) = 0 Filters size samples from src into dest.
| dest | Destination buffer. |
| src | Source buffer. |
| size | Number of samples to process. |
Fully qualified name: kfr::filter<T>::process_buffer(T *, const T *, size_t)
Declared at base/filter.hpp:213
function process_expression(T *, const expression_handle<T, 1> &, size_t) ¶
virtual void process_expression(T* dest, const expression_handle<T, 1>& src, size_t size) = 0 Evaluates size samples of the expression src into dest.
| dest | Destination buffer. |
| src | Source expression handle. |
| size | Number of samples to process. |
Fully qualified name: kfr::filter<T>::process_expression(T *, const expression_handle<T, 1> &, size_t)
Declared at base/filter.hpp:220
Fully qualified name: kfr::filter<T>
Declared at base/filter.hpp:42