Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/audaspace/FX/AUD_LowpassFactory.cpp')
-rw-r--r--intern/audaspace/FX/AUD_LowpassFactory.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/intern/audaspace/FX/AUD_LowpassFactory.cpp b/intern/audaspace/FX/AUD_LowpassFactory.cpp
index e2faa241ac9..bd225998392 100644
--- a/intern/audaspace/FX/AUD_LowpassFactory.cpp
+++ b/intern/audaspace/FX/AUD_LowpassFactory.cpp
@@ -29,33 +29,10 @@
#include "AUD_LowpassFactory.h"
#include "AUD_IIRFilterReader.h"
-
-#include <cmath>
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
+#include "AUD_LowpassCalculator.h"
AUD_LowpassFactory::AUD_LowpassFactory(boost::shared_ptr<AUD_IFactory> factory, float frequency,
float Q) :
- AUD_DynamicIIRFilterFactory(factory),
- m_frequency(frequency),
- m_Q(Q)
-{
-}
-
-void AUD_LowpassFactory::recalculateCoefficients(AUD_SampleRate rate,
- std::vector<float> &b,
- std::vector<float> &a)
+ AUD_DynamicIIRFilterFactory(factory, boost::shared_ptr<AUD_IDynamicIIRFilterCalculator>(new AUD_LowpassCalculator(frequency, Q)))
{
- float w0 = 2 * M_PI * m_frequency / rate;
- float alpha = sin(w0) / (2 * m_Q);
- float norm = 1 + alpha;
- float c = cos(w0);
- a.push_back(1);
- a.push_back(-2 * c / norm);
- a.push_back((1 - alpha) / norm);
- b.push_back((1 - c) / (2 * norm));
- b.push_back((1 - c) / norm);
- b.push_back(b[0]);
}