#include <filter.h>

Public Member Functions | |
| IIR_filt () | |
| ~IIR_filt () | |
| void | clear (void) |
| void | set_coeffs (const arma::Col< T2 > &_b, const arma::Col< T2 > &_a) |
| void | update_coeffs (const arma::Col< T2 > &_b, const arma::Col< T2 > &_a) |
| T3 | operator() (const T1 &in) |
| arma::Col< T3 > | filter (const arma::Col< T1 > &in) |
Private Attributes | |
| arma::uword | M |
| arma::uword | N |
| arma::uword | b_cur_p |
| arma::uword | a_cur_p |
| arma::Col< T2 > | b |
| arma::Col< T2 > | a |
| arma::Col< T1 > | b_buf |
| arma::Col< T1 > | a_buf |
Implements IIR/ARMA filter functions as
\[ a_0y(n) = b_0x(n)+b_1x(n-1)+...+b_{M-1}x(n-(M-1))-a_1y(n-1)-...-a_{M-1}y(n-(M-1))\]
where M is the number of taps in the FIR filter part and M is the number of taps in the IIR filter. The filter order is (M-1,M-1)
|
inline |
|
inline |
|
inline |
Clears the internal states and pointers.
Definition at line 532 of file filter.h.
References sp::IIR_filt< T1, T2, T3 >::a_buf, sp::IIR_filt< T1, T2, T3 >::a_cur_p, sp::IIR_filt< T1, T2, T3 >::b_buf, and sp::IIR_filt< T1, T2, T3 >::b_cur_p.
Referenced by sp::IIR_filt< T1, T2, T3 >::set_coeffs().
|
inline |
Filter function.
| in | Input vector |
Definition at line 615 of file filter.h.
Referenced by main().
|
inline |
Filter operator.
| in | Input sample |
Definition at line 574 of file filter.h.
References sp::IIR_filt< T1, T2, T3 >::a, sp::IIR_filt< T1, T2, T3 >::a_buf, sp::IIR_filt< T1, T2, T3 >::a_cur_p, sp::IIR_filt< T1, T2, T3 >::b, sp::IIR_filt< T1, T2, T3 >::b_buf, sp::IIR_filt< T1, T2, T3 >::b_cur_p, sp::IIR_filt< T1, T2, T3 >::M, and sp::IIR_filt< T1, T2, T3 >::N.
|
inline |
Sets coefficients in IIR filter. The internal state and pointers are cleared.
| _b | Filter coefficients \( [b_0 ..b_M] \) |
| _a | Filter coefficients \( [a_0 ..a_N] \) |
Definition at line 546 of file filter.h.
References sp::IIR_filt< T1, T2, T3 >::a, sp::IIR_filt< T1, T2, T3 >::a_buf, sp::IIR_filt< T1, T2, T3 >::b_buf, sp::IIR_filt< T1, T2, T3 >::clear(), sp::IIR_filt< T1, T2, T3 >::M, and sp::IIR_filt< T1, T2, T3 >::N.
Referenced by main().

|
inline |
Updates coefficients in filter without clearing the internal states.
| _b | Filter coefficients \( [b_0 ..b_M] \) |
| _a | Filter coefficients \( [a_0 ..a_N] \) |
Definition at line 563 of file filter.h.
References sp::IIR_filt< T1, T2, T3 >::a, and sp::IIR_filt< T1, T2, T3 >::b.
|
private |
AR Filter coefficients.
Definition at line 511 of file filter.h.
Referenced by sp::IIR_filt< T1, T2, T3 >::operator()(), sp::IIR_filt< T1, T2, T3 >::set_coeffs(), and sp::IIR_filt< T1, T2, T3 >::update_coeffs().
|
private |
AR Signal buffer.
Definition at line 513 of file filter.h.
Referenced by sp::IIR_filt< T1, T2, T3 >::clear(), sp::IIR_filt< T1, T2, T3 >::operator()(), and sp::IIR_filt< T1, T2, T3 >::set_coeffs().
|
private |
Pointer to current sample in AR buffer.
Definition at line 509 of file filter.h.
Referenced by sp::IIR_filt< T1, T2, T3 >::clear(), and sp::IIR_filt< T1, T2, T3 >::operator()().
|
private |
MA Filter coefficients.
Definition at line 510 of file filter.h.
Referenced by sp::IIR_filt< T1, T2, T3 >::operator()(), and sp::IIR_filt< T1, T2, T3 >::update_coeffs().
|
private |
MA Signal buffer.
Definition at line 512 of file filter.h.
Referenced by sp::IIR_filt< T1, T2, T3 >::clear(), sp::IIR_filt< T1, T2, T3 >::operator()(), and sp::IIR_filt< T1, T2, T3 >::set_coeffs().
|
private |
Pointer to current sample in MA buffer.
Definition at line 508 of file filter.h.
Referenced by sp::IIR_filt< T1, T2, T3 >::clear(), and sp::IIR_filt< T1, T2, T3 >::operator()().
|
private |
Nr of MA filter taps.
Definition at line 506 of file filter.h.
Referenced by sp::IIR_filt< T1, T2, T3 >::operator()(), and sp::IIR_filt< T1, T2, T3 >::set_coeffs().
|
private |
Nr of AR filter taps.
Definition at line 507 of file filter.h.
Referenced by sp::IIR_filt< T1, T2, T3 >::operator()(), and sp::IIR_filt< T1, T2, T3 >::set_coeffs().