Mercurial > hg > aimc
comparison branches/carfac_cpp/src/CARFAC.cpp @ 539:750075ee8e3a
rewrote CARFAC to have pointers as members
author | Ulf.Hammarqvist@gmail.com |
---|---|
date | Wed, 28 Mar 2012 16:08:11 +0000 |
parents | 81b01c88a257 |
children | da49bc37a6dd |
comparison
equal
deleted
inserted
replaced
538:81b01c88a257 | 539:750075ee8e3a |
---|---|
1 /* | |
2 * CARFAC.cpp | |
3 * | |
4 * Created on: 24 mar 2012 | |
5 * Author: ulha | |
6 */ | |
7 | |
8 #include "CARFAC.h" | 1 #include "CARFAC.h" |
9 #include "CAR.h" | 2 #include "CAR.h" |
10 #include "IHC.h" | 3 #include "IHC.h" |
11 #include "AGC.h" | 4 #include "AGC.h" |
12 | 5 |
13 #include "CARFAC_common_typedefs.h" | 6 #include "CARFAC_common_typedefs.h" |
14 | 7 |
15 CARFAC::CARFAC(int fs = DEFAULT_FS, | 8 CARFAC::CARFAC(int fs = DEFAULT_FS, |
16 CAR_parameters _CAR_params = CAR_parameters(), | 9 CAR_parameters* _CAR_params = new CAR_parameters(), |
17 IHC_parameters _IHC_params = IHC_parameters(), | 10 IHC_parameters* _IHC_params = new IHC_parameters(), |
18 AGC_parameters _AGC_params = AGC_parameters(), | 11 AGC_parameters* _AGC_params = new AGC_parameters(), |
19 float ERB_break_freq = DEFAULT_ERB_break_freq, | 12 float ERB_break_freq = DEFAULT_ERB_break_freq, |
20 float ERB_Q = DEFAULT_ERB_Q){ | 13 float ERB_Q = DEFAULT_ERB_Q){ |
21 | 14 |
22 CAR_params = _CAR_params; | 15 CAR_params = _CAR_params; |
23 IHC_params = _IHC_params; | 16 IHC_params = _IHC_params; |
24 AGC_params = _AGC_params; | 17 AGC_params = _AGC_params; |
25 | 18 |
26 FloatArray pole_freqs; //TODO: do it, or push it down to CAR_coefficients level instead | 19 FloatArray pole_freqs; //TODO: do it, or push it down to CAR_coefficients level instead |
27 CAR_coeffs = CAR_coefficients(CAR_params, fs, pole_freqs); | 20 CAR_coeffs = new CAR_coefficients(CAR_params, fs, pole_freqs); |
28 | 21 |
29 // etc ... | 22 // etc ... |
30 } | 23 } |
31 | 24 |
32 CARFAC::~CARFAC() { | 25 CARFAC::~CARFAC() { |
33 // TODO Auto-generated destructor stub | 26 delete CAR_coeffs; |
27 delete CAR_params; | |
28 | |
29 delete IHC_coeffs; | |
30 delete IHC_params; | |
31 | |
32 delete AGC_coeffs; | |
33 delete AGC_params; | |
34 } | 34 } |