X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=filter.cpp;fp=filter.cpp;h=d737cb086565170a286bb27f9312e4a84a80c0de;hb=9b9f5c84113b8a818f296467fd2150ce6a095fbe;hp=a5cd76733f3f5325af1c511a3f4c007e6c6cf8e9;hpb=d62349fd118e89b16adfc5478c73cd8e10136364;p=nageru diff --git a/filter.cpp b/filter.cpp index a5cd767..d737cb0 100644 --- a/filter.cpp +++ b/filter.cpp @@ -11,6 +11,8 @@ #include "filter.h" +using namespace std; + #ifdef __SSE__ // For SSE, we set the denormals-as-zero flag instead. @@ -49,8 +51,8 @@ void Filter::update() float sn, cs; float cutoff_freq = omega; - cutoff_freq = std::min(cutoff_freq, (float)M_PI); - cutoff_freq = std::max(cutoff_freq, 0.001f); + cutoff_freq = min(cutoff_freq, (float)M_PI); + cutoff_freq = max(cutoff_freq, 0.001f); calcSinCos(cutoff_freq, &sn, &cs); if (resonance <= 0) resonance = 0.001f; @@ -352,9 +354,9 @@ void StereoFilter::render(float *inout_left_ptr, unsigned n_samples, float cutof we need to raise the answer to the Nth power. */ -std::complex Filter::evaluate_transfer_function(float omega) +complex Filter::evaluate_transfer_function(float omega) { - std::complex z = exp(std::complex(0.0f, omega)); - std::complex z2 = z * z; - return std::pow((b0 * z2 + b1 * z + b2) / (1.0f * z2 + a1 * z + a2), filter_order); + complex z = exp(complex(0.0f, omega)); + complex z2 = z * z; + return pow((b0 * z2 + b1 * z + b2) / (1.0f * z2 + a1 * z + a2), filter_order); }