| Index: Source/platform/audio/FFTFrame.cpp
|
| diff --git a/Source/platform/audio/FFTFrame.cpp b/Source/platform/audio/FFTFrame.cpp
|
| index e7e51c354f7a8743e4039e531a942762f13e3277..58df785fbd2f3cb7da97c2625d5ba5c05b34e670 100644
|
| --- a/Source/platform/audio/FFTFrame.cpp
|
| +++ b/Source/platform/audio/FFTFrame.cpp
|
| @@ -151,21 +151,21 @@ void FFTFrame::interpolateFrequencyComponents(const FFTFrame& frame1, const FFTF
|
|
|
| // Unwrap phase deltas
|
| if (deltaPhase1 > piDouble)
|
| - deltaPhase1 -= 2.0 * piDouble;
|
| + deltaPhase1 -= twoPiDouble;
|
| if (deltaPhase1 < -piDouble)
|
| - deltaPhase1 += 2.0 * piDouble;
|
| + deltaPhase1 += twoPiDouble;
|
| if (deltaPhase2 > piDouble)
|
| - deltaPhase2 -= 2.0 * piDouble;
|
| + deltaPhase2 -= twoPiDouble;
|
| if (deltaPhase2 < -piDouble)
|
| - deltaPhase2 += 2.0 * piDouble;
|
| + deltaPhase2 += twoPiDouble;
|
|
|
| // Blend group-delays
|
| double deltaPhaseBlend;
|
|
|
| if (deltaPhase1 - deltaPhase2 > piDouble)
|
| - deltaPhaseBlend = s1 * deltaPhase1 + s2 * (2.0 * piDouble + deltaPhase2);
|
| + deltaPhaseBlend = s1 * deltaPhase1 + s2 * (twoPiDouble + deltaPhase2);
|
| else if (deltaPhase2 - deltaPhase1 > piDouble)
|
| - deltaPhaseBlend = s1 * (2.0 * piDouble + deltaPhase1) + s2 * deltaPhase2;
|
| + deltaPhaseBlend = s1 * (twoPiDouble + deltaPhase1) + s2 * deltaPhase2;
|
| else
|
| deltaPhaseBlend = s1 * deltaPhase1 + s2 * deltaPhase2;
|
|
|
| @@ -173,9 +173,9 @@ void FFTFrame::interpolateFrequencyComponents(const FFTFrame& frame1, const FFTF
|
|
|
| // Unwrap
|
| if (phaseAccum > piDouble)
|
| - phaseAccum -= 2.0 * piDouble;
|
| + phaseAccum -= twoPiDouble;
|
| if (phaseAccum < -piDouble)
|
| - phaseAccum += 2.0 * piDouble;
|
| + phaseAccum += twoPiDouble;
|
|
|
| Complex c = complexFromMagnitudePhase(mag, phaseAccum);
|
|
|
| @@ -195,7 +195,7 @@ double FFTFrame::extractAverageGroupDelay()
|
|
|
| int halfSize = fftSize() / 2;
|
|
|
| - const double kSamplePhaseDelay = (2.0 * piDouble) / double(fftSize());
|
| + const double kSamplePhaseDelay = (twoPiDouble) / double(fftSize());
|
|
|
| // Calculate weighted average group delay
|
| for (int i = 0; i < halfSize; i++) {
|
| @@ -208,9 +208,9 @@ double FFTFrame::extractAverageGroupDelay()
|
|
|
| // Unwrap
|
| if (deltaPhase < -piDouble)
|
| - deltaPhase += 2.0 * piDouble;
|
| + deltaPhase += twoPiDouble;
|
| if (deltaPhase > piDouble)
|
| - deltaPhase -= 2.0 * piDouble;
|
| + deltaPhase -= twoPiDouble;
|
|
|
| aveSum += mag * deltaPhase;
|
| weightSum += mag;
|
| @@ -240,7 +240,7 @@ void FFTFrame::addConstantGroupDelay(double sampleFrameDelay)
|
| float* realP = realData();
|
| float* imagP = imagData();
|
|
|
| - const double kSamplePhaseDelay = (2.0 * piDouble) / double(fftSize());
|
| + const double kSamplePhaseDelay = (twoPiDouble) / double(fftSize());
|
|
|
| double phaseAdj = -sampleFrameDelay * kSamplePhaseDelay;
|
|
|
|
|