Mercurial > hg > aimc
comparison src/Modules/NAP/ModuleHCL.cc @ 8:fcbf85ce59fb
- Lots of changes to make cpplint happy. It still complains about header guards, but that's pretty much it now.
author | tomwalters |
---|---|
date | Thu, 18 Feb 2010 21:12:41 +0000 |
parents | decdac21cfc2 |
children | bd370910aa05 |
comparison
equal
deleted
inserted
replaced
7:1a1988ec40e7 | 8:fcbf85ce59fb |
---|---|
78 if (input[c][i] < 0.0f) { | 78 if (input[c][i] < 0.0f) { |
79 output_.set_sample(c, i, 0.0f); | 79 output_.set_sample(c, i, 0.0f); |
80 } else { | 80 } else { |
81 float s = input[c][i]; | 81 float s = input[c][i]; |
82 if (do_log_) { | 82 if (do_log_) { |
83 s *= pow(2.0f,15); | 83 s *= pow(2.0f, 15); |
84 if (s < 1.0f) s = 1.0f; | 84 if (s < 1.0f) s = 1.0f; |
85 s = 20.0f * log10(s); | 85 s = 20.0f * log10(s); |
86 } | 86 } |
87 output_.set_sample(c, i, s); | 87 output_.set_sample(c, i, s); |
88 } | 88 } |
89 } | 89 } |
90 if (do_lowpass_) { | 90 if (do_lowpass_) { |
91 float b = exp( -1.0f / (input.sample_rate() * time_constant_)); | 91 float b = exp(-1.0f / (input.sample_rate() * time_constant_)); |
92 float gain = 1.0f / (1.0f - b); | 92 float gain = 1.0f / (1.0f - b); |
93 for (int j = 0; j < lowpass_order_; j++) { | 93 for (int j = 0; j < lowpass_order_; j++) { |
94 for (int k = 0; k < output_.buffer_length(); ++k) { | 94 for (int k = 0; k < output_.buffer_length(); ++k) { |
95 xn_ = output_[c][k]; | 95 xn_ = output_[c][k]; |
96 yn_ = xn_ + b * yns_[c][j]; | 96 yn_ = xn_ + b * yns_[c][j]; |