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_HighpassFactory.cpp')
-rw-r--r--intern/audaspace/FX/AUD_HighpassFactory.cpp26
1 files changed, 2 insertions, 24 deletions
diff --git a/intern/audaspace/FX/AUD_HighpassFactory.cpp b/intern/audaspace/FX/AUD_HighpassFactory.cpp
index ba5297d21ed..2456085a8a1 100644
--- a/intern/audaspace/FX/AUD_HighpassFactory.cpp
+++ b/intern/audaspace/FX/AUD_HighpassFactory.cpp
@@ -29,33 +29,11 @@
#include "AUD_HighpassFactory.h"
#include "AUD_IIRFilterReader.h"
-
-#include <cmath>
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
+#include "AUD_HighpassCalculator.h"
AUD_HighpassFactory::AUD_HighpassFactory(boost::shared_ptr<AUD_IFactory> factory, float frequency,
float Q) :
- AUD_DynamicIIRFilterFactory(factory),
- m_frequency(frequency),
- m_Q(Q)
+ AUD_DynamicIIRFilterFactory(factory, boost::shared_ptr<AUD_IDynamicIIRFilterCalculator>(new AUD_HighpassCalculator(frequency, Q)))
{
}
-void AUD_HighpassFactory::recalculateCoefficients(AUD_SampleRate rate,
- std::vector<float> &b,
- std::vector<float> &a)
-{
- float w0 = 2.0 * M_PI * (AUD_SampleRate)m_frequency / rate;
- float alpha = (float)(sin(w0) / (2.0 * (double)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]);
-}