From 0e2cb4c001c67735fa8b37c6de5c46764e66e3b9 Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Thu, 8 Aug 2013 21:37:36 +1200 Subject: [PATCH] b=865241 don't try to compute a phase for group delay from the DC and nyquist components of the DFT r=ehsan Given imagP[0] is really realP[halfSize], it doesn't make sense to calculate a phase from placing the DC and Nyquist components in different directions. The DC component doesn't have a phase offset and lastPhase is already initialized to zero. This makes extractAverageGroupDelay() consistent with addConstantGroupDelay() and to some extent interpolateFrequencyComponents(). The effect of the bug would have been small for reasonably sized FFTs. --HG-- extra : rebase_source : b2931d625bd7e014f123b576f28aad7f719c585d --- content/media/webaudio/blink/FFTFrame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/media/webaudio/blink/FFTFrame.cpp b/content/media/webaudio/blink/FFTFrame.cpp index 35d73b1152b..00d6de2dcc5 100644 --- a/content/media/webaudio/blink/FFTFrame.cpp +++ b/content/media/webaudio/blink/FFTFrame.cpp @@ -193,7 +193,7 @@ double FFTFrame::extractAverageGroupDelay() const double kSamplePhaseDelay = (2.0 * piDouble) / double(fftSize()); // Calculate weighted average group delay - for (int i = 0; i < halfSize; i++) { + for (int i = 1; i < halfSize; i++) { Complex c(realP[i], imagP[i]); double mag = abs(c); double phase = arg(c);