annotate include/AGC.h @ 503:83cd5bbf2a3e carfac_cpp

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