Mercurial > hg > aimc
annotate branches/carfac_cpp/src/CARFAC.cpp @ 544:c666e8e0696a
style
author | Ulf.Hammarqvist@gmail.com |
---|---|
date | Thu, 29 Mar 2012 19:43:36 +0000 |
parents | 5f1f55b23301 |
children | e63fbe19b255 |
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@544 | 8 CARFAC::CARFAC(int fs = kDefaultFs, |
Ulf@544 | 9 CAR_parameters* car_params = new CAR_parameters(), |
Ulf@544 | 10 IHC_parameters* ihc_params = new IHC_parameters(), |
Ulf@544 | 11 AGC_parameters* agc_params = new AGC_parameters(), |
Ulf@544 | 12 float erb_break_freq = kDefaultErbBreakFreq, |
Ulf@544 | 13 float erb_q = kDefaultErbQ){ |
Ulf@538 | 14 |
Ulf@544 | 15 // for now, design is to take ownership. Preferences? Make copies, call by value, etc? |
Ulf@544 | 16 car_params_ = car_params; |
Ulf@544 | 17 ihc_params_ = ihc_params; |
Ulf@544 | 18 agc_params_ = agc_params; |
Ulf@538 | 19 |
Ulf@544 | 20 FloatArray pole_freqs; //TODO: do it |
Ulf@544 | 21 car_coeffs_ = new CAR_coefficients(car_params_, fs, pole_freqs); |
Ulf@538 | 22 |
Ulf@544 | 23 int n_ch = 10; // TODO: do the design loops |
Ulf@544 | 24 agc_coeffs_ = new AGC_coefficients(agc_params_, fs, n_ch); |
Ulf@542 | 25 |
Ulf@544 | 26 ihc_coeffs_ = new IHC_coefficients(ihc_params_, fs, n_ch); |
Ulf@538 | 27 } |
Ulf@538 | 28 |
Ulf@538 | 29 CARFAC::~CARFAC() { |
Ulf@544 | 30 delete car_coeffs_; |
Ulf@544 | 31 delete ihc_coeffs_; |
Ulf@544 | 32 delete agc_coeffs_; |
Ulf@539 | 33 |
Ulf@544 | 34 //delete car_params_; |
Ulf@544 | 35 //delete ihc_params_; |
Ulf@544 | 36 //delete agc_params_; |
Ulf@538 | 37 } |