Mercurial > hg > aimc
annotate branches/carfac_cpp/src/CARFAC.cpp @ 542:5f1f55b23301
(none)
author | Ulf.Hammarqvist@gmail.com |
---|---|
date | Wed, 28 Mar 2012 20:24:28 +0000 |
parents | da49bc37a6dd |
children | c666e8e0696a |
rev | line source |
---|---|
Ulf@538 | 1 #include "CARFAC.h" |
Ulf@538 | 2 #include "CAR.h" |
Ulf@538 | 3 #include "IHC.h" |
Ulf@538 | 4 #include "AGC.h" |
Ulf@538 | 5 |
Ulf@538 | 6 #include "CARFAC_common_typedefs.h" |
Ulf@538 | 7 |
Ulf@538 | 8 CARFAC::CARFAC(int fs = DEFAULT_FS, |
Ulf@539 | 9 CAR_parameters* _CAR_params = new CAR_parameters(), |
Ulf@539 | 10 IHC_parameters* _IHC_params = new IHC_parameters(), |
Ulf@539 | 11 AGC_parameters* _AGC_params = new AGC_parameters(), |
Ulf@538 | 12 float ERB_break_freq = DEFAULT_ERB_break_freq, |
Ulf@538 | 13 float ERB_Q = DEFAULT_ERB_Q){ |
Ulf@538 | 14 |
Ulf@541 | 15 // for now, design is to take ownership. Preferences? Make copies, call by value, etc? |
Ulf@538 | 16 CAR_params = _CAR_params; |
Ulf@538 | 17 IHC_params = _IHC_params; |
Ulf@538 | 18 AGC_params = _AGC_params; |
Ulf@538 | 19 |
Ulf@541 | 20 FloatArray pole_freqs; //TODO: do it |
Ulf@539 | 21 CAR_coeffs = new CAR_coefficients(CAR_params, fs, pole_freqs); |
Ulf@538 | 22 |
Ulf@542 | 23 int n_ch = 10; // TODO: do the design loops |
Ulf@542 | 24 AGC_coeffs = new AGC_coefficients(AGC_params, fs, n_ch); |
Ulf@542 | 25 |
Ulf@542 | 26 IHC_coeffs = new IHC_coefficients(IHC_params, fs, n_ch); |
Ulf@538 | 27 } |
Ulf@538 | 28 |
Ulf@538 | 29 CARFAC::~CARFAC() { |
Ulf@539 | 30 delete CAR_coeffs; |
Ulf@542 | 31 //delete CAR_params; |
Ulf@539 | 32 |
Ulf@539 | 33 delete IHC_coeffs; |
Ulf@542 | 34 //delete IHC_params; |
Ulf@539 | 35 |
Ulf@539 | 36 delete AGC_coeffs; |
Ulf@542 | 37 //delete AGC_params; |
Ulf@538 | 38 } |