comparison trunk/carfac/agc.h @ 688:e50aee5046b1

Style fixes. - Fix most lint errors found by http://google-styleguide.googlecode.com/svn/trunk/cpplint/cpplint.py - Clean up commenting style. - Alphabetize #includes and using statements.
author ronw@google.com
date Tue, 11 Jun 2013 20:41:15 +0000
parents d0612798f6de
children
comparison
equal deleted inserted replaced
687:972dd2e721f7 688:e50aee5046b1
22 22
23 #ifndef CARFAC_AGC_H 23 #ifndef CARFAC_AGC_H
24 #define CARFAC_AGC_H 24 #define CARFAC_AGC_H
25 25
26 #include <vector> 26 #include <vector>
27
27 #include "common.h" 28 #include "common.h"
28 29
30 // Automatic gain control (AGC) parameters, which are used to design the AGC
31 // filters.
29 struct AGCParams { 32 struct AGCParams {
30 AGCParams() { 33 AGCParams() {
31 num_stages = 4; 34 num_stages = 4;
32 agc_stage_gain = 2.0; 35 agc_stage_gain = 2.0;
33 time_constants.resize(num_stages); 36 time_constants.resize(num_stages);
51 std::vector<int> decimation; 54 std::vector<int> decimation;
52 std::vector<FPType> agc1_scales; 55 std::vector<FPType> agc1_scales;
53 std::vector<FPType> agc2_scales; 56 std::vector<FPType> agc2_scales;
54 }; 57 };
55 58
59 // Automatic gain control filter coefficients, which are derived from a set of
60 // AGCParams.
56 struct AGCCoeffs { 61 struct AGCCoeffs {
57 int num_agc_stages; 62 int num_agc_stages;
58 FPType agc_stage_gain; 63 FPType agc_stage_gain;
59 FPType agc_epsilon; 64 FPType agc_epsilon;
60 int decimation; 65 int decimation;
69 FPType agc_gain; 74 FPType agc_gain;
70 FPType detect_scale; 75 FPType detect_scale;
71 FPType decim; 76 FPType decim;
72 }; 77 };
73 78
79 // Automatic gain control filter state.
74 struct AGCState { 80 struct AGCState {
75 ArrayX agc_memory; 81 ArrayX agc_memory;
76 ArrayX input_accum; 82 ArrayX input_accum;
77 int decim_phase; 83 int decim_phase;
78 }; 84 };