annotate branches/carfac_cpp/include/CAR.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 CAR_H_
Ulf@564 2 #define CAR_H_
Ulf@564 3
Ulf@564 4 #include "CARFAC_common.h"
Ulf@564 5 #include <cmath>
Ulf@564 6
Ulf@564 7 const double kDefaultErbBreakFreq = 165.3;
Ulf@564 8 const double kDefaultErbQ = 1000/(24.7*4.37);
Ulf@564 9
Ulf@564 10 class CAR_parameters{
Ulf@564 11 public:
Ulf@564 12 CAR_parameters():
Ulf@564 13 velocity_scale_(0.2),
Ulf@564 14 v_offset_(0.01),
Ulf@564 15 v2_corner_(0.2),
Ulf@564 16 v_damp_max_(0.01),
Ulf@564 17 min_zeta_(0.10),
Ulf@564 18 first_pole_theta_(0.085*kPi),
Ulf@564 19 zero_ratio_(sqrt(2)),
Ulf@564 20 high_f_damping_compression_(0.5),
Ulf@564 21 erb_per_step_(0.5),
Ulf@564 22 min_pole_hz_(30),
Ulf@564 23 erb_break_freq_(kDefaultErbBreakFreq),
Ulf@564 24 erb_q_(kDefaultErbQ)
Ulf@564 25 {
Ulf@564 26 // do nothing more
Ulf@564 27 }
Ulf@564 28
Ulf@564 29 virtual ~CAR_parameters(){
Ulf@564 30 // do nothing
Ulf@564 31 }
Ulf@564 32
Ulf@564 33 float velocity_scale_;
Ulf@564 34 float v_offset_;
Ulf@564 35 float v2_corner_;
Ulf@564 36 float v_damp_max_;
Ulf@564 37 float min_zeta_;
Ulf@564 38 float first_pole_theta_;
Ulf@564 39 float zero_ratio_;
Ulf@564 40 float high_f_damping_compression_;
Ulf@564 41 float erb_per_step_;
Ulf@564 42 float min_pole_hz_;
Ulf@564 43 float erb_break_freq_;
Ulf@564 44 float erb_q_;
Ulf@564 45 };
Ulf@564 46
Ulf@564 47 class CAR_coefficients{
Ulf@564 48 public:
Ulf@564 49 CAR_coefficients(CAR_parameters*, float, FloatArray);
Ulf@564 50 virtual ~CAR_coefficients();
Ulf@564 51
Ulf@564 52 FloatArray r1_coeffs_;
Ulf@564 53 FloatArray a0_coeffs_;
Ulf@564 54 FloatArray c0_coeffs_;
Ulf@564 55 FloatArray h_coeffs_;
Ulf@564 56 FloatArray g0_coeffs_;
Ulf@564 57 FloatArray zr_coeffs_;
Ulf@564 58
Ulf@564 59 private:
Ulf@564 60 CAR_coefficients();
Ulf@564 61 };
Ulf@564 62
Ulf@564 63 #endif /* CAR_H_ */