annotate 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
rev   line source
Ulf@564 1 #ifndef AGC_H_
Ulf@564 2 #define AGC_H_
Ulf@564 3
Ulf@564 4 #include "CARFAC_common.h"
Ulf@564 5
Ulf@564 6 class AGC_parameters {
Ulf@564 7 public:
Ulf@564 8 AGC_parameters():
Ulf@564 9 n_stages_(4),
Ulf@564 10 time_constants_({0.002*1, 0.002*4, 0.002*16, 0.002*64}),
Ulf@564 11 agc_stage_gain_(2),
Ulf@564 12 decimation_({8, 2, 2, 2}),
Ulf@564 13 agc1_scales_({1.0, 1.4, 2.0, 2.8}),
Ulf@564 14 agc2_scales_({1.6, 2.25, 3.2, 4.5}),
Ulf@564 15 detect_scale_(0.25),
Ulf@564 16 agc_mix_coeff_(0.5){
Ulf@564 17 // do nothing more
Ulf@564 18 }
Ulf@564 19
Ulf@564 20 virtual ~AGC_parameters(){
Ulf@564 21 // do nothing
Ulf@564 22 }
Ulf@564 23
Ulf@564 24 int n_stages_;
Ulf@564 25 FloatArray time_constants_;
Ulf@564 26 float agc_stage_gain_;
Ulf@564 27 FloatArray decimation_;
Ulf@564 28 FloatArray agc1_scales_;
Ulf@564 29 FloatArray agc2_scales_;
Ulf@564 30 float detect_scale_;
Ulf@564 31 float agc_mix_coeff_;
Ulf@564 32 };
Ulf@564 33
Ulf@564 34 class AGC_coefficients {
Ulf@564 35 public:
Ulf@564 36 AGC_coefficients(AGC_parameters*, float, int);
Ulf@564 37 virtual ~AGC_coefficients();
Ulf@564 38
Ulf@564 39 int n_ch_;
Ulf@564 40 int n_agc_stages_;
Ulf@564 41 float agc_stage_gain_;
Ulf@564 42 FloatArray agc_epsilon_;
Ulf@564 43 FloatArray decimation_;
Ulf@564 44 FloatArray agc_polez1_;
Ulf@564 45 FloatArray agc_polez2_;
Ulf@564 46 FloatArray agc_spatial_iterations_;
Ulf@564 47 FloatMatrix agc_spatial_fir_;
Ulf@564 48 FloatArray agc_spatial_n_taps_;
Ulf@564 49 FloatArray agc_mix_coeffs_;
Ulf@564 50 float agc_gain_;
Ulf@564 51 float detect_scale_;
Ulf@564 52
Ulf@564 53 private:
Ulf@564 54 AGC_coefficients();
Ulf@564 55 FloatArray Build_FIR_coeffs(float, float, int*, int*);
Ulf@564 56 };
Ulf@564 57
Ulf@564 58 #endif /* AGC_H_ */