Apply an Infinite Impulse Response (IIR) Filter. More...

Modules

 iir
 C++ interface for Infinite Impulse Response.
 
 filter1D
 C interface for Impulse Response.
 

Detailed Description

Apply an Infinite Impulse Response (IIR) Filter.

Apply an infinite impulse response filter (transposed Direct Form II implementation).

If a is scalar this defaults to the faster Finite Impulse Response, i.e. fir. The IIR is defined as:

\[ a_0*y_{n-1} = b_0*x_{n-1} + b_1*x_{n-2} + \ldots + b_{nb-1}*x_{n-nb-1} - a_1*y_{n-2} - \ldots - a_{na-1}*y_{n-na-1} \]

array a = seq(1, 8);
a = a / 10.0f;
print(a);
// a = 0.1000
// 0.2000
// 0.3000
// 0.4000
// 0.5000
// 0.6000
// 0.7000
// 0.8000
array b = seq(1, 8);
print(b);
// b = 1.0000
// 2.0000
// 3.0000
// 4.0000
// 5.0000
// 6.0000
// 7.0000
// 8.0000
array x = randn(8, 1);
array f = iir(b, a, x);
print(f);
// f = 2.9254
// -7.1836
// 1.0000
// -3.9320
// 25.4702
// -0.0344
// 0.0829
// -2.5098