SPUC
3.0
|
Class for iir filter design. More...
#include <iir_coeff.h>
Public Member Functions | |
iir_coeff (long ord=1) | |
ord = Filter order More... | |
~iir_coeff () | |
Destructor. More... | |
void | bilinear () |
Do bilinear transformation. More... | |
void | bilinear2 () |
void | convert_to_ab () |
void | z_root_to_ab (std::vector< complex< float_type > > &z) |
void | pz_to_ap () |
void | ab_to_tf () |
std::vector< float_type > | p2_to_poly (const std::vector< complex< float_type > > &ab) |
std::vector< float_type > | pz_to_poly (const std::vector< complex< float_type > > &z) |
complex< float_type > | get_root (long i) |
complex< float_type > | get_zero (long i) |
float_type | get_a (long i) |
float_type | get_b (long i) |
float_type | get_coeff_a (long i) |
float_type | get_coeff_b (long i) |
float_type | max_abs_coeff () |
void | quantize (int bits) |
float_type | freqz_mag (float_type freq) |
Public Attributes | |
long | order |
long | odd |
long | n2 |
std::vector< complex < float_type > > | poles |
std::vector< complex < float_type > > | zeros |
std::vector< float_type > | a_tf |
std::vector< float_type > | b_tf |
float_type | gain |
float_type | hpf_gain |
long | state |
long | tf_state |
long | ap_state |
Class for iir filter design.
SPUC::iir_coeff::iir_coeff | ( | long | ord = 1 | ) |
SPUC::iir_coeff::~iir_coeff | ( | ) |
Destructor.
void SPUC::iir_coeff::ab_to_tf | ( | ) |
References a_tf, b_tf, p2_to_poly(), poles, state, and zeros.
Referenced by quantize().
void SPUC::iir_coeff::bilinear | ( | ) |
Do bilinear transformation.
References n2, poles, state, and zeros.
Referenced by SPUC::butterworth_iir(), SPUC::chebyshev_iir(), and SPUC::elliptic_iir().
void SPUC::iir_coeff::bilinear2 | ( | ) |
void SPUC::iir_coeff::convert_to_ab | ( | ) |
References a_tf, b_tf, gain, hpf_gain, odd, p2_to_poly(), poles, state, z_root_to_ab(), and zeros.
Referenced by SPUC::butterworth_iir(), SPUC::chebyshev_iir(), SPUC::elliptic_iir(), and SPUC::iir< Numeric, Coeff >::set_coeffs().
float_type SPUC::iir_coeff::freqz_mag | ( | float_type | freq | ) |
References a_tf, b_tf, SPUC::cos(), SPUC::magsq(), order, and SPUC::sqrt().
float_type SPUC::iir_coeff::get_a | ( | long | i | ) |
float_type SPUC::iir_coeff::get_b | ( | long | i | ) |
float_type SPUC::iir_coeff::get_coeff_a | ( | long | i | ) |
float_type SPUC::iir_coeff::get_coeff_b | ( | long | i | ) |
complex< float_type > SPUC::iir_coeff::get_root | ( | long | i | ) |
complex< float_type > SPUC::iir_coeff::get_zero | ( | long | i | ) |
float_type SPUC::iir_coeff::max_abs_coeff | ( | ) |
References SPUC::ABS(), n2, poles, and zeros.
Referenced by quantize().
std::vector< float_type > SPUC::iir_coeff::p2_to_poly | ( | const std::vector< complex< float_type > > & | ab | ) |
References n2, odd, order, and SPUC::partial_convolve().
Referenced by ab_to_tf(), and convert_to_ab().
void SPUC::iir_coeff::pz_to_ap | ( | ) |
References a_tf, ap_state, b_tf, SPUC::convolve(), SPUC::find_roots(), SPUC::fliplr(), SPUC::magsq(), order, poles, pz_to_poly(), SPUC::sqrt(), state, and zeros.
std::vector< float_type > SPUC::iir_coeff::pz_to_poly | ( | const std::vector< complex< float_type > > & | z | ) |
References SPUC::magsq(), n2, order, SPUC::partial_convolve(), and tf_state.
Referenced by pz_to_ap().
void SPUC::iir_coeff::quantize | ( | int | bits | ) |
References ab_to_tf(), max_abs_coeff(), n2, poles, and zeros.
Referenced by main().
void SPUC::iir_coeff::z_root_to_ab | ( | std::vector< complex< float_type > > & | z | ) |
References gain, hpf_gain, SPUC::magsq(), n2, odd, and state.
Referenced by convert_to_ab().
std::vector<float_type > SPUC::iir_coeff::a_tf |
Referenced by ab_to_tf(), convert_to_ab(), freqz_mag(), get_a(), main(), and pz_to_ap().
long SPUC::iir_coeff::ap_state |
Referenced by iir_coeff(), and pz_to_ap().
std::vector<float_type > SPUC::iir_coeff::b_tf |
Referenced by ab_to_tf(), convert_to_ab(), freqz_mag(), get_b(), main(), and pz_to_ap().
float_type SPUC::iir_coeff::gain |
Referenced by convert_to_ab(), SPUC::iir< Numeric, Coeff >::set_coeffs(), and z_root_to_ab().
float_type SPUC::iir_coeff::hpf_gain |
Referenced by convert_to_ab(), and z_root_to_ab().
long SPUC::iir_coeff::n2 |
long SPUC::iir_coeff::odd |
long SPUC::iir_coeff::order |
std::vector<complex<float_type> > SPUC::iir_coeff::poles |
long SPUC::iir_coeff::state |
Referenced by ab_to_tf(), bilinear(), convert_to_ab(), iir_coeff(), pz_to_ap(), SPUC::iir< Numeric, Coeff >::set_coeffs(), and z_root_to_ab().
long SPUC::iir_coeff::tf_state |
Referenced by iir_coeff(), and pz_to_poly().
std::vector<complex<float_type> > SPUC::iir_coeff::zeros |