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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/IIRDSPKernel.cpp

Issue 2389253002: reflow comments in modules/{webaudio,vr} (Closed)
Patch Set: . Created 4 years, 2 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 // 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 #include "modules/webaudio/IIRDSPKernel.h" 5 #include "modules/webaudio/IIRDSPKernel.h"
6 6
7 #include "wtf/MathExtras.h" 7 #include "wtf/MathExtras.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 22 matching lines...) Expand all
33 // Convert from frequency in Hz to normalized frequency (0 -> 1), 33 // Convert from frequency in Hz to normalized frequency (0 -> 1),
34 // with 1 equal to the Nyquist frequency. 34 // with 1 equal to the Nyquist frequency.
35 for (int k = 0; k < nFrequencies; ++k) 35 for (int k = 0; k < nFrequencies; ++k)
36 frequency[k] = clampTo<float>(frequencyHz[k] / nyquist); 36 frequency[k] = clampTo<float>(frequencyHz[k] / nyquist);
37 37
38 m_iir.getFrequencyResponse(nFrequencies, frequency.data(), magResponse, 38 m_iir.getFrequencyResponse(nFrequencies, frequency.data(), magResponse,
39 phaseResponse); 39 phaseResponse);
40 } 40 }
41 41
42 double IIRDSPKernel::tailTime() const { 42 double IIRDSPKernel::tailTime() const {
43 // TODO(rtoy): This is true mathematically (infinite impulse response), but pe rhaps it should be 43 // TODO(rtoy): This is true mathematically (infinite impulse response), but
44 // limited to a smaller value, possibly based on the actual filter coefficient s. To do that, we 44 // perhaps it should be limited to a smaller value, possibly based on the
45 // would probably need to find the pole, r, with largest magnitude and select some threshold, 45 // actual filter coefficients. To do that, we would probably need to find the
46 // eps, such that |r|^n < eps for all n >= N. N is then the tailTime for the filter. If the 46 // pole, r, with largest magnitude and select some threshold, eps, such that
47 // the magnitude of r is greater than or equal to 1, the infinity is the right answer. (There is 47 // |r|^n < eps for all n >= N. N is then the tailTime for the filter. If the
48 // no constraint on the IIR filter that it be stable.) 48 // the magnitude of r is greater than or equal to 1, the infinity is the right
49 // answer. (There is no constraint on the IIR filter that it be stable.)
49 return std::numeric_limits<double>::infinity(); 50 return std::numeric_limits<double>::infinity();
50 } 51 }
51 52
52 double IIRDSPKernel::latencyTime() const { 53 double IIRDSPKernel::latencyTime() const {
53 return 0; 54 return 0;
54 } 55 }
55 56
56 } // namespace blink 57 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/GainNode.cpp ('k') | third_party/WebKit/Source/modules/webaudio/IIRFilterNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698