Template Class SingleChannelTransferFunctionFilter
Defined in File transfer_function.hpp
Inheritance Relationships
Base Type
public filters::FilterBase< T >
(Template Class FilterBase)
Class Documentation
-
template<typename T>
class SingleChannelTransferFunctionFilter : public filters::FilterBase<T> One-dimensional digital filter class.
This class calculates the output for \(N\) one-dimensional digital filters. The filter is described by vectors \(a\) and \(b\) and implemented using the standard difference equation:
\[\begin{eqnarray*} a[0]*y[n] = b[0]*x[n] &+& b[1]*x[n-1]+ ... + b[n_b]*x[n-n_b]\ \ &-& a[1]*y[n-1]- ... - a[n_a]*y[n-n_a] \end{eqnarray*}\]If \(a[0]\) is not equal to 1, the coefficients are normalized by \(a[0]\).
Example xml config:
<filter type=”TransferFunctionFilter” name=”filter_name”>
<params a=”1.0 0.5” b=”0.2 0.2”>
</filter>Public Functions
-
SingleChannelTransferFunctionFilter()
Construct the filter.
-
~SingleChannelTransferFunctionFilter() override
Destructor to clean up.
-
virtual bool configure() override
Configure the filter with the correct number of channels and params.
- Parameters:
number_of_channels – The number of inputs filtered.
config – The xml that is parsed to configure the filter.
Protected Attributes
-
std::unique_ptr<RealtimeCircularBuffer<T>> input_buffer_
The input sample history.
-
std::unique_ptr<RealtimeCircularBuffer<T>> output_buffer_
The output sample history.
-
std::vector<double> a_
Transfer functon coefficients (output).
-
std::vector<double> b_
Transfer functon coefficients (input).
-
SingleChannelTransferFunctionFilter()