comparison branches/carfac_cpp/include/AGC.h @ 564:9c4c3675c3f8

* Added class Ear, and moved the CARFAC members AGC CAR IHC into Ear. CARFAC now holds an array of Ear. TBD what is best. * Moved the files around, and introduced a makefile that builds unittests using GTest. (Note, GTest path is configured in makefile atm.). - two moronic tests implemented. :)
author Ulf.Hammarqvist@gmail.com
date Sun, 20 May 2012 22:36:47 +0000
parents
children f3dde307f4b8
comparison
equal deleted inserted replaced
563:fb602edc2d55 564:9c4c3675c3f8
1 #ifndef AGC_H_
2 #define AGC_H_
3
4 #include "CARFAC_common.h"
5
6 class AGC_parameters {
7 public:
8 AGC_parameters():
9 n_stages_(4),
10 time_constants_({0.002*1, 0.002*4, 0.002*16, 0.002*64}),
11 agc_stage_gain_(2),
12 decimation_({8, 2, 2, 2}),
13 agc1_scales_({1.0, 1.4, 2.0, 2.8}),
14 agc2_scales_({1.6, 2.25, 3.2, 4.5}),
15 detect_scale_(0.25),
16 agc_mix_coeff_(0.5){
17 // do nothing more
18 }
19
20 virtual ~AGC_parameters(){
21 // do nothing
22 }
23
24 int n_stages_;
25 FloatArray time_constants_;
26 float agc_stage_gain_;
27 FloatArray decimation_;
28 FloatArray agc1_scales_;
29 FloatArray agc2_scales_;
30 float detect_scale_;
31 float agc_mix_coeff_;
32 };
33
34 class AGC_coefficients {
35 public:
36 AGC_coefficients(AGC_parameters*, float, int);
37 virtual ~AGC_coefficients();
38
39 int n_ch_;
40 int n_agc_stages_;
41 float agc_stage_gain_;
42 FloatArray agc_epsilon_;
43 FloatArray decimation_;
44 FloatArray agc_polez1_;
45 FloatArray agc_polez2_;
46 FloatArray agc_spatial_iterations_;
47 FloatMatrix agc_spatial_fir_;
48 FloatArray agc_spatial_n_taps_;
49 FloatArray agc_mix_coeffs_;
50 float agc_gain_;
51 float detect_scale_;
52
53 private:
54 AGC_coefficients();
55 FloatArray Build_FIR_coeffs(float, float, int*, int*);
56 };
57
58 #endif /* AGC_H_ */