Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IIRFilter_h | 5 #ifndef IIRFilter_h |
| 6 #define IIRFilter_h | 6 #define IIRFilter_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/audio/AudioArray.h" | 9 #include "platform/audio/AudioArray.h" |
| 10 #include "platform/wtf/Vector.h" | 10 #include "platform/wtf/Vector.h" |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 | 23 |
| 24 void Process(const float* source_p, float* dest_p, size_t frames_to_process); | 24 void Process(const float* source_p, float* dest_p, size_t frames_to_process); |
| 25 | 25 |
| 26 void Reset(); | 26 void Reset(); |
| 27 | 27 |
| 28 void GetFrequencyResponse(int n_frequencies, | 28 void GetFrequencyResponse(int n_frequencies, |
| 29 const float* frequency, | 29 const float* frequency, |
| 30 float* mag_response, | 30 float* mag_response, |
| 31 float* phase_response); | 31 float* phase_response); |
| 32 | 32 |
| 33 // Compute the tail time of the IIR filter | |
| 34 double TailTime(double sample_rate); | |
|
hongchan
2017/05/12 16:24:05
What's the frequency of this computation?
On a re
Raymond Toy
2017/05/12 17:33:18
I don't quite understand this question? The TailT
hongchan
2017/05/12 17:36:45
You answered this above. We compute just once.
| |
| 35 | |
| 36 // Reset the internal state of the IIR filter to the initial state. | |
| 37 void ResetState(); | |
| 38 | |
| 33 private: | 39 private: |
| 34 // Filter memory | 40 // Filter memory |
| 35 // | 41 // |
| 36 // For simplicity, we assume |m_xBuffer| and |m_yBuffer| have the same length, | 42 // For simplicity, we assume |m_xBuffer| and |m_yBuffer| have the same length, |
| 37 // and the length is a power of two. Since the number of coefficients has a | 43 // and the length is a power of two. Since the number of coefficients has a |
| 38 // fixed upper length, the size of xBuffer and yBuffer is fixed. |m_xBuffer| | 44 // fixed upper length, the size of xBuffer and yBuffer is fixed. |m_xBuffer| |
| 39 // holds the old input values and |m_yBuffer| holds the old output values | 45 // holds the old input values and |m_yBuffer| holds the old output values |
| 40 // needed to compute the new output value. | 46 // needed to compute the new output value. |
| 41 // | 47 // |
| 42 // m_yBuffer[m_bufferIndex] holds the most recent output value, say, y[n]. | 48 // m_yBuffer[m_bufferIndex] holds the most recent output value, say, y[n]. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 54 | 60 |
| 55 // Coefficients of the IIR filter. To minimize storage, these point to the | 61 // Coefficients of the IIR filter. To minimize storage, these point to the |
| 56 // arrays given in the constructor. | 62 // arrays given in the constructor. |
| 57 const AudioDoubleArray* feedback_; | 63 const AudioDoubleArray* feedback_; |
| 58 const AudioDoubleArray* feedforward_; | 64 const AudioDoubleArray* feedforward_; |
| 59 }; | 65 }; |
| 60 | 66 |
| 61 } // namespace blink | 67 } // namespace blink |
| 62 | 68 |
| 63 #endif // IIRFilter_h | 69 #endif // IIRFilter_h |
| OLD | NEW |