| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 void SetBandpassParams(int, double frequency, double q); | 63 void SetBandpassParams(int, double frequency, double q); |
| 64 void SetLowShelfParams(int, double frequency, double db_gain); | 64 void SetLowShelfParams(int, double frequency, double db_gain); |
| 65 void SetHighShelfParams(int, double frequency, double db_gain); | 65 void SetHighShelfParams(int, double frequency, double db_gain); |
| 66 void SetPeakingParams(int, double frequency, double q, double db_gain); | 66 void SetPeakingParams(int, double frequency, double q, double db_gain); |
| 67 void SetAllpassParams(int, double frequency, double q); | 67 void SetAllpassParams(int, double frequency, double q); |
| 68 void SetNotchParams(int, double frequency, double q); | 68 void SetNotchParams(int, double frequency, double q); |
| 69 | 69 |
| 70 // Resets filter state | 70 // Resets filter state |
| 71 void Reset(); | 71 void Reset(); |
| 72 | 72 |
| 73 // Compute tail frame based on the filter coefficents at index | |
| 74 // |coef_index|. The tail frame is the frame number where the | |
| 75 // impulse response of the filter falls below a threshold value. | |
| 76 // The maximum allowed frame value is given by |max_frame|. This | |
| 77 // limits how much work is done in computing the frame numer. | |
| 78 double TailFrame(int coef_index, double max_frame); | |
| 79 | |
| 80 // Filter response at a set of n frequencies. The magnitude and | 73 // Filter response at a set of n frequencies. The magnitude and |
| 81 // phase response are returned in magResponse and phaseResponse. | 74 // phase response are returned in magResponse and phaseResponse. |
| 82 // The phase response is in radians. | 75 // The phase response is in radians. |
| 83 void GetFrequencyResponse(int n_frequencies, | 76 void GetFrequencyResponse(int n_frequencies, |
| 84 const float* frequency, | 77 const float* frequency, |
| 85 float* mag_response, | 78 float* mag_response, |
| 86 float* phase_response); | 79 float* phase_response); |
| 87 | 80 |
| 88 private: | 81 private: |
| 89 void SetNormalizedCoefficients(int, | 82 void SetNormalizedCoefficients(int, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // Filter memory | 116 // Filter memory |
| 124 double x1_; // input delayed by 1 sample | 117 double x1_; // input delayed by 1 sample |
| 125 double x2_; // input delayed by 2 samples | 118 double x2_; // input delayed by 2 samples |
| 126 double y1_; // output delayed by 1 sample | 119 double y1_; // output delayed by 1 sample |
| 127 double y2_; // output delayed by 2 samples | 120 double y2_; // output delayed by 2 samples |
| 128 }; | 121 }; |
| 129 | 122 |
| 130 } // namespace blink | 123 } // namespace blink |
| 131 | 124 |
| 132 #endif // Biquad_h | 125 #endif // Biquad_h |
| OLD | NEW |