49 for (
int n = 0; n < N; n++)
51 Y[n] = fir_filt(X[n]);
54 std::cout <<
"Filter coeffs: \n" << b.t() << std::endl;
55 std::cout <<
"Impulse response:\n" << Y.t() << std::endl;
60 b << 0.25 << 0.5 << 0.25 << endr;
61 a << 1.0 << -0.9 << endr;
66 <<
"IIR theor. impulse response: \n 0.2500 0.7250 0.9025 0.8123 " 67 " 0.7310 0.6579 0.5921 0.5329 0.4796 0.4317 0.3885 ..." 69 std::cout <<
"IIR output: \n" << Y.t() << std::endl;
72 std::cout <<
"Delay three samples:\n" << del.
delay(Y).t() << std::endl;
arma::Col< T1 > delay(const arma::Col< T1 > &in)
A delay operator (vector version).
arma_inline arma::vec fir1(const arma::uword M, const double f0)
FIR lowpass design function. FIR lowpassdesign using windows method (hamming window). NB! Returns size M+1.
void set_coeffs(const arma::Mat< T2 > &_b)
Sets coefficients in FIR filter. The internal state and pointers are cleared.
void set_coeffs(const arma::Col< T2 > &_b, const arma::Col< T2 > &_a)
Sets coefficients in IIR filter. The internal state and pointers are cleared.
arma::Col< T3 > filter(const arma::Col< T1 > &in)
Filter function.