Index: Source/platform/audio/FFTFrame.cpp |
diff --git a/Source/platform/audio/FFTFrame.cpp b/Source/platform/audio/FFTFrame.cpp |
index f6de464d4bd85beb6b6d2570a308f38f91165547..e3890aa88250470945afe01e7e79490e62feaefa 100644 |
--- a/Source/platform/audio/FFTFrame.cpp |
+++ b/Source/platform/audio/FFTFrame.cpp |
@@ -34,10 +34,11 @@ |
#include "platform/audio/VectorMath.h" |
#include "platform/Logging.h" |
-#include "wtf/Complex.h" |
#include "wtf/MathExtras.h" |
#include "wtf/OwnPtr.h" |
+#include <complex> |
+ |
#ifndef NDEBUG |
#include <stdio.h> |
#endif |
@@ -100,8 +101,8 @@ void FFTFrame::interpolateFrequencyComponents(const FFTFrame& frame1, const FFTF |
int n = m_FFTSize / 2; |
for (int i = 1; i < n; ++i) { |
- Complex c1(realP1[i], imagP1[i]); |
- Complex c2(realP2[i], imagP2[i]); |
+ std::complex<double> c1(realP1[i], imagP1[i]); |
+ std::complex<double> c2(realP2[i], imagP2[i]); |
double mag1 = abs(c1); |
double mag2 = abs(c2); |
@@ -167,7 +168,7 @@ void FFTFrame::interpolateFrequencyComponents(const FFTFrame& frame1, const FFTF |
if (phaseAccum < -piDouble) |
phaseAccum += twoPiDouble; |
- Complex c = complexFromMagnitudePhase(mag, phaseAccum); |
+ std::complex<double> c = std::polar(mag, phaseAccum); |
realP[i] = static_cast<float>(c.real()); |
imagP[i] = static_cast<float>(c.imag()); |
@@ -189,7 +190,7 @@ double FFTFrame::extractAverageGroupDelay() |
// Calculate weighted average group delay |
for (int i = 0; i < halfSize; i++) { |
- Complex c(realP[i], imagP[i]); |
+ std::complex<double> c(realP[i], imagP[i]); |
double mag = abs(c); |
double phase = arg(c); |
@@ -236,13 +237,13 @@ void FFTFrame::addConstantGroupDelay(double sampleFrameDelay) |
// Add constant group delay |
for (int i = 1; i < halfSize; i++) { |
- Complex c(realP[i], imagP[i]); |
+ std::complex<double> c(realP[i], imagP[i]); |
double mag = abs(c); |
double phase = arg(c); |
phase += i * phaseAdj; |
- Complex c2 = complexFromMagnitudePhase(mag, phase); |
+ std::complex<double> c2 = std::polar(mag, phase); |
realP[i] = static_cast<float>(c2.real()); |
imagP[i] = static_cast<float>(c2.imag()); |