26constexpr auto minimumDecibels = -300.0f;
37 memcpy (coefficients, other.coefficients,
sizeof (coefficients));
42 memcpy (coefficients, other.coefficients,
sizeof (coefficients));
47 double c4,
double c5,
double c6)
noexcept
49 const auto a = 1.0 /
c4;
51 coefficients[0] = (
float) (
c1 * a);
52 coefficients[1] = (
float) (
c2 * a);
53 coefficients[2] = (
float) (
c3 * a);
54 coefficients[3] = (
float) (
c5 * a);
55 coefficients[4] = (
float) (
c6 * a);
59 double frequency)
noexcept
68 jassert (sampleRate > 0.0);
69 jassert (frequency > 0.0 && frequency <= sampleRate * 0.5);
74 const auto c1 = 1.0 / (1.0 + 1.0 /
Q * n +
nSquared);
85 double frequency)
noexcept
87 return makeHighPass (sampleRate, frequency, 1.0 / std::sqrt (2.0));
94 jassert (sampleRate > 0.0);
95 jassert (frequency > 0.0 && frequency <= sampleRate * 0.5);
100 const auto c1 = 1.0 / (1.0 + 1.0 /
Q * n +
nSquared);
111 double frequency)
noexcept
120 jassert (sampleRate > 0.0);
121 jassert (frequency > 0.0 && frequency <= sampleRate * 0.5);
126 const auto c1 = 1.0 / (1.0 + 1.0 /
Q * n +
nSquared);
137 double frequency)
noexcept
146 jassert (sampleRate > 0.0);
147 jassert (frequency > 0.0 && frequency <= sampleRate * 0.5);
163 double frequency)
noexcept
172 jassert (sampleRate > 0.0);
173 jassert (frequency > 0.0 && frequency <= sampleRate * 0.5);
178 const auto c1 = 1.0 / (1.0 + 1.0 /
Q * n +
nSquared);
193 jassert (sampleRate > 0.0);
202 const auto beta = std::sin (
omega) * std::sqrt (A) /
Q;
218 jassert (sampleRate > 0.0);
224 const auto aplus1 = A + 1.0;
227 const auto beta = std::sin (
omega) * std::sqrt (A) /
Q;
243 jassert (sampleRate > 0.0);
244 jassert (frequency > 0.0 && frequency <= sampleRate * 0.5);
249 const auto alpha = 0.5 * std::sin (
omega) /
Q;
250 const auto c2 = -2.0 * std::cos (
omega);
263template <
typename Mutex>
269 const typename Mutex::ScopedLockType
sl (other.processLock);
270 coefficients = other.coefficients;
274template <
typename Mutex>
277 const typename Mutex::ScopedLockType
sl (processLock);
281template <
typename Mutex>
284 const typename Mutex::ScopedLockType
sl (processLock);
290template <
typename Mutex>
293 const typename Mutex::ScopedLockType
sl (processLock);
297template <
typename Mutex>
300 auto out = coefficients.coefficients[0] *
in + v1;
302 JUCE_SNAP_TO_ZERO (
out);
304 v1 = coefficients.coefficients[1] *
in - coefficients.coefficients[3] *
out + v2;
305 v2 = coefficients.coefficients[2] *
in - coefficients.coefficients[4] *
out;
310template <
typename Mutex>
313 const typename Mutex::ScopedLockType
sl (processLock);
317 auto c0 = coefficients.coefficients[0];
318 auto c1 = coefficients.coefficients[1];
319 auto c2 = coefficients.coefficients[2];
320 auto c3 = coefficients.coefficients[3];
321 auto c4 = coefficients.coefficients[4];
324 for (
int i = 0; i < numSamples; ++i)
334 JUCE_SNAP_TO_ZERO (
lv1); v1 =
lv1;
335 JUCE_SNAP_TO_ZERO (
lv2); v2 =
lv2;
static Type gainWithLowerBound(Type gain, Type lowerBoundDb)
static IIRCoefficients makeAllPass(double sampleRate, double frequency) noexcept
IIRCoefficients & operator=(const IIRCoefficients &) noexcept
static IIRCoefficients makeLowPass(double sampleRate, double frequency) noexcept
IIRCoefficients() noexcept
static IIRCoefficients makeNotchFilter(double sampleRate, double frequency) noexcept
static IIRCoefficients makePeakFilter(double sampleRate, double centreFrequency, double Q, float gainFactor) noexcept
~IIRCoefficients() noexcept
static IIRCoefficients makeBandPass(double sampleRate, double frequency) noexcept
static IIRCoefficients makeHighShelf(double sampleRate, double cutOffFrequency, double Q, float gainFactor) noexcept
static IIRCoefficients makeLowShelf(double sampleRate, double cutOffFrequency, double Q, float gainFactor) noexcept
static IIRCoefficients makeHighPass(double sampleRate, double frequency) noexcept
void makeInactive() noexcept
float processSingleSampleRaw(float sample) noexcept
void setCoefficients(const IIRCoefficients &newCoefficients) noexcept
void processSamples(float *samples, int numSamples) noexcept