Mercurial > hg > aimc
comparison src/CAR.cpp @ 489:20de0b60b694 carfac_cpp
Added the initialization of g0, but parting from the MATLAB way of doing it. (temporary measure)
author | Ulf.Hammarqvist@gmail.com |
---|---|
date | Sat, 07 Apr 2012 09:52:04 +0000 |
parents | af4bc33b2e1c |
children | 24828350536a |
comparison
equal
deleted
inserted
replaced
488:af4bc33b2e1c | 489:20de0b60b694 |
---|---|
35 (CARFAC::ERB_Hz(pole_freqs[i])/pole_freqs[i]-car_params->min_zeta_)); | 35 (CARFAC::ERB_Hz(pole_freqs[i])/pole_freqs[i]-car_params->min_zeta_)); |
36 r1_coeffs_[i] = 1-zr_coeffs_[i]*min_zeta_mod; | 36 r1_coeffs_[i] = 1-zr_coeffs_[i]*min_zeta_mod; |
37 | 37 |
38 h_coeffs_[i] = c0_coeffs_[i] * f; | 38 h_coeffs_[i] = c0_coeffs_[i] * f; |
39 | 39 |
40 g0_coeffs_[i] = 0; // TODO: matlab design a bit hacky - think for bit | 40 //TODO: g0_coeffs_ calculated here for now. Let's talk about this, need |
41 // to see the whole picture of what makes sense. | |
42 // Related: I believe CAR, IHC and AGC classes would be beneficial! | |
43 float tmp = 1 - 2*r1_coeffs_[i]*a0_coeffs_[i] + r1_coeffs_[i]*r1_coeffs_[i]; | |
44 g0_coeffs_[i] = tmp / ( tmp + h_coeffs_[i]*r1_coeffs_[i]*c0_coeffs_[i]); | |
41 } | 45 } |
42 | 46 |
43 } | 47 } |
44 | 48 |
45 CAR_coefficients::~CAR_coefficients(){ | 49 CAR_coefficients::~CAR_coefficients(){ |