C++ interface for Finite Impulse Response. More...

array fir (int nb, const float *h_b, const array &x)
 
array fir (const array &b, const array &x)
 Finite impulse response filtering. More...
 

Detailed Description

C++ interface for Finite Impulse Response.

Applies a Finite impulse response filter to an array. This filter is used in digital signal processing and is called finite (as opposed to iir) because the impulse response settles to zero in a fixed number of steps.

The FIR is defined as:

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

array x = randu(5);
// x = 0.3194
// 0.8109
// 0.1541
// 0.4452
// 0.2080
float h_b[] = {0.1,0.2,0.3,0.4,0.5};
array f = fir(5, h_b, x);
// f = 0.0319
// 0.1450
// 0.2734
// 0.4464
// 0.6401

Function Documentation

array af::fir ( int  nb,
const float *  h_b,
const array &  x 
)
Parameters
[in]nblength of h_b
[in]h_bhost-array of filter coefficients
[in]x
Returns
filtered signal (y) same size as x
array af::fir ( const array &  b,
const array &  x 
)

Finite impulse response filtering.

Parameters
[in]bfilter
[in]xsignal
Returns
filtered signal (y) same size as x