Index: Source/platform/audio/Biquad.cpp |
diff --git a/Source/platform/audio/Biquad.cpp b/Source/platform/audio/Biquad.cpp |
index 21df7745a9eb198b30491638b5b968fa59a220fb..e614c7c1b62b604727e02254a9f2105b8ef4f914 100644 |
--- a/Source/platform/audio/Biquad.cpp |
+++ b/Source/platform/audio/Biquad.cpp |
@@ -524,7 +524,7 @@ void Biquad::setBandpassParams(double frequency, double Q) |
} |
} |
-void Biquad::setZeroPolePairs(const Complex &zero, const Complex &pole) |
+void Biquad::setZeroPolePairs(const std::complex<double>&zero, const std::complex<double>&pole) |
{ |
double b0 = 1; |
double b1 = -2 * zero.real(); |
@@ -539,9 +539,9 @@ void Biquad::setZeroPolePairs(const Complex &zero, const Complex &pole) |
setNormalizedCoefficients(b0, b1, b2, 1, a1, a2); |
} |
-void Biquad::setAllpassPole(const Complex &pole) |
+void Biquad::setAllpassPole(const std::complex<double>&pole) |
{ |
- Complex zero = Complex(1, 0) / pole; |
+ std::complex<double> zero = std::complex<double>(1, 0) / pole; |
setZeroPolePairs(zero, pole); |
} |
@@ -575,10 +575,11 @@ void Biquad::getFrequencyResponse(int nFrequencies, |
for (int k = 0; k < nFrequencies; ++k) { |
double omega = -piDouble * frequency[k]; |
- Complex z = Complex(cos(omega), sin(omega)); |
- Complex numerator = b0 + (b1 + b2 * z) * z; |
- Complex denominator = Complex(1, 0) + (a1 + a2 * z) * z; |
- Complex response = numerator / denominator; |
+ std::complex<double> z = std::complex<double> (cos(omega), sin(omega)); |
+ std::complex<double> numerator = b0 + (b1 + b2 * z) * z; |
+ std::complex<double> denominator = |
+ std::complex<double>(1, 0) + (a1 + a2 * z) * z; |
+ std::complex<double> response = numerator / denominator; |
magResponse[k] = static_cast<float>(abs(response)); |
phaseResponse[k] = static_cast<float>(atan2(imag(response), real(response))); |
} |