Arduino Filters master
Filter library for Arduino
Public Member Functions | List of all members
IIRFilter< NB, NA, T > Class Template Reference

#include <Filters/IIRFilter.hpp>

Detailed Description

template<uint8_t NB, uint8_t NA = NB, class T = float>
class IIRFilter< NB, NA, T >

Generic Infinite Impulse Response filter class.

Uses the NormalizingIIRFilter implementation for floating point types, and NonNormalizingIIRFilter for all other types.

Implements the following difference equation using the Direct-Form 1 implementation:

\[ y[n] = \frac{1}{a_0} \left(\sum_{i=0}^{N_b-1} b_i \cdot x[n-i] - \sum_{i=1}^{N_a-1} a_i \cdot y[n-i] \right) \]

Definition at line 236 of file IIRFilter.hpp.

+ Inheritance diagram for IIRFilter< NB, NA, T >:
+ Collaboration diagram for IIRFilter< NB, NA, T >:

Public Member Functions

 IIRFilter (const AH::Array< T, NB > &b_coefficients, const AH::Array< T, NA > &a_coefficients)
 Construct a new IIR Filter object. More...
 
 IIRFilter (const TransferFunction< NB, NA, T > &tf)
 
operator() (T input)
 Update the internal state with the new input \( x[n] \) and return the new output \( y[n] \). More...
 

Constructor & Destructor Documentation

◆ IIRFilter() [1/2]

IIRFilter ( const AH::Array< T, NB > &  b_coefficients,
const AH::Array< T, NA > &  a_coefficients 
)
inline

Construct a new IIR Filter object.

The coefficients \( b \) and \( a \) can be derived from the transfer function:

\[ H(z) = \frac{b_0 + b_1 z^{-1} + \ldots + b_{N_b} z ^{-N_b}} {a_0 + a_1 z^{-1} + \ldots + a_{N_b} z ^{-N_a}} \]

Parameters
b_coefficientsThe coefficients of the transfer function numerator.
a_coefficientsThe coefficients of the transfer function denominator.

Definition at line 254 of file IIRFilter.hpp.

◆ IIRFilter() [2/2]

IIRFilter ( const TransferFunction< NB, NA, T > &  tf)
inline

Definition at line 258 of file IIRFilter.hpp.

Member Function Documentation

◆ operator()()

T operator() ( input)
inline

Update the internal state with the new input \( x[n] \) and return the new output \( y[n] \).

Parameters
inputThe new input \( x[n] \).
Returns
The new output \( y[n] \).

Definition at line 269 of file IIRFilter.hpp.


The documentation for this class was generated from the following file: