Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: third_party/WebKit/Source/platform/audio/Biquad.h

Issue 2862373002: Compute tail time from Biquad coefficients (Closed)
Patch Set: Initialize tail_time_ in constructor Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
73 // Filter response at a set of n frequencies. The magnitude and 80 // Filter response at a set of n frequencies. The magnitude and
74 // phase response are returned in magResponse and phaseResponse. 81 // phase response are returned in magResponse and phaseResponse.
75 // The phase response is in radians. 82 // The phase response is in radians.
76 void GetFrequencyResponse(int n_frequencies, 83 void GetFrequencyResponse(int n_frequencies,
77 const float* frequency, 84 const float* frequency,
78 float* mag_response, 85 float* mag_response,
79 float* phase_response); 86 float* phase_response);
80 87
81 private: 88 private:
82 void SetNormalizedCoefficients(int, 89 void SetNormalizedCoefficients(int,
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // Filter memory 123 // Filter memory
117 double x1_; // input delayed by 1 sample 124 double x1_; // input delayed by 1 sample
118 double x2_; // input delayed by 2 samples 125 double x2_; // input delayed by 2 samples
119 double y1_; // output delayed by 1 sample 126 double y1_; // output delayed by 1 sample
120 double y2_; // output delayed by 2 samples 127 double y2_; // output delayed by 2 samples
121 }; 128 };
122 129
123 } // namespace blink 130 } // namespace blink
124 131
125 #endif // Biquad_h 132 #endif // Biquad_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/BiquadDSPKernel.cpp ('k') | third_party/WebKit/Source/platform/audio/Biquad.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698