annotate src/CAR.h @ 496:5a5fc3a6051b
carfac_cpp
* SUGGESTED re-factor of the FIR_coeffs calls (old code remains in commented out form for easy comparison).
* Minor changes to CARFAC and IHC corresponding to MATLAB refactoring
author |
Ulf.Hammarqvist@gmail.com |
date |
Mon, 09 Apr 2012 09:43:02 +0000 |
parents |
24828350536a |
children |
|
rev |
line source |
Ulf@477
|
1 #ifndef CAR_H_
|
Ulf@477
|
2 #define CAR_H_
|
Ulf@477
|
3
|
Ulf@484
|
4 #include "CARFAC_common.h"
|
Ulf@483
|
5 #include <cmath>
|
Ulf@477
|
6
|
Ulf@494
|
7 const double kDefaultErbBreakFreq = 165.3;
|
Ulf@494
|
8 const double kDefaultErbQ = 1000/(24.7*4.37);
|
Ulf@494
|
9
|
Ulf@484
|
10 class CAR_parameters{
|
Ulf@477
|
11 public:
|
Ulf@484
|
12 CAR_parameters():
|
Ulf@484
|
13 velocity_scale_(0.2),
|
Ulf@484
|
14 v_offset_(0.01),
|
Ulf@484
|
15 v2_corner_(0.2),
|
Ulf@484
|
16 v_damp_max_(0.01),
|
Ulf@484
|
17 min_zeta_(0.10),
|
Ulf@484
|
18 first_pole_theta_(0.085*kPi),
|
Ulf@484
|
19 zero_ratio_(sqrt(2)),
|
Ulf@484
|
20 high_f_damping_compression_(0.5),
|
Ulf@484
|
21 erb_per_step_(0.5),
|
Ulf@494
|
22 min_pole_hz_(30),
|
Ulf@494
|
23 erb_break_freq_(kDefaultErbBreakFreq),
|
Ulf@494
|
24 erb_q_(kDefaultErbQ)
|
Ulf@494
|
25 {
|
Ulf@484
|
26 // do nothing more
|
Ulf@483
|
27 }
|
Ulf@479
|
28
|
Ulf@484
|
29 virtual ~CAR_parameters(){
|
Ulf@484
|
30 // do nothing
|
Ulf@484
|
31 }
|
Ulf@479
|
32
|
Ulf@483
|
33 float velocity_scale_;
|
Ulf@483
|
34 float v_offset_;
|
Ulf@483
|
35 float v2_corner_;
|
Ulf@483
|
36 float v_damp_max_;
|
Ulf@483
|
37 float min_zeta_;
|
Ulf@483
|
38 float first_pole_theta_;
|
Ulf@483
|
39 float zero_ratio_;
|
Ulf@483
|
40 float high_f_damping_compression_;
|
Ulf@483
|
41 float erb_per_step_;
|
Ulf@484
|
42 float min_pole_hz_;
|
Ulf@494
|
43 float erb_break_freq_;
|
Ulf@494
|
44 float erb_q_;
|
Ulf@477
|
45 };
|
Ulf@477
|
46
|
Ulf@477
|
47 class CAR_coefficients{
|
Ulf@477
|
48 public:
|
Ulf@483
|
49 CAR_coefficients(CAR_parameters*, float, FloatArray);
|
Ulf@483
|
50 virtual ~CAR_coefficients();
|
Ulf@486
|
51
|
Ulf@487
|
52 FloatArray r1_coeffs_;
|
Ulf@487
|
53 FloatArray a0_coeffs_;
|
Ulf@487
|
54 FloatArray c0_coeffs_;
|
Ulf@487
|
55 FloatArray h_coeffs_;
|
Ulf@487
|
56 FloatArray g0_coeffs_;
|
Ulf@487
|
57 FloatArray zr_coeffs_;
|
Ulf@486
|
58
|
Ulf@478
|
59 private:
|
Ulf@484
|
60 CAR_coefficients();
|
Ulf@477
|
61 };
|
Ulf@477
|
62
|
Ulf@477
|
63 #endif /* CAR_H_ */
|