35 template <
typename NumericType>
48 static std::array<NumericType, 6>
makeLowPass (
double sampleRate, NumericType frequency);
51 static std::array<NumericType, 6>
makeLowPass (
double sampleRate, NumericType frequency, NumericType
Q);
54 static std::array<NumericType, 6>
makeHighPass (
double sampleRate, NumericType frequency);
57 static std::array<NumericType, 6>
makeHighPass (
double sampleRate, NumericType frequency, NumericType
Q);
60 static std::array<NumericType, 6>
makeBandPass (
double sampleRate, NumericType frequency);
63 static std::array<NumericType, 6>
makeBandPass (
double sampleRate, NumericType frequency, NumericType
Q);
66 static std::array<NumericType, 6>
makeNotch (
double sampleRate, NumericType frequency);
69 static std::array<NumericType, 6>
makeNotch (
double sampleRate, NumericType frequency, NumericType
Q);
72 static std::array<NumericType, 6>
makeAllPass (
double sampleRate, NumericType frequency);
75 static std::array<NumericType, 6>
makeAllPass (
double sampleRate, NumericType frequency, NumericType
Q);
83 static std::array<NumericType, 6>
makeLowShelf (
double sampleRate,
94 static std::array<NumericType, 6>
makeHighShelf (
double sampleRate,
106 static std::array<NumericType, 6>
makePeakFilter (
double sampleRate,
107 NumericType centreFrequency,
113 static constexpr NumericType inverseRootTwo =
static_cast<NumericType
> (0.70710678118654752440L);
122 template <
typename NumericType>
133 NumericType
a0, NumericType
a1);
136 NumericType
a0, NumericType
a1, NumericType
a2);
139 NumericType
a0, NumericType
a1, NumericType
a2, NumericType
a3);
147 template <
size_t Num>
151 template <
size_t Num>
171 static Ptr makeLowPass (
double sampleRate, NumericType frequency);
174 static Ptr makeLowPass (
double sampleRate, NumericType frequency, NumericType
Q);
181 static Ptr makeHighPass (
double sampleRate, NumericType frequency, NumericType
Q);
188 static Ptr makeBandPass (
double sampleRate, NumericType frequency, NumericType
Q);
192 static Ptr makeNotch (
double sampleRate, NumericType frequency);
195 static Ptr makeNotch (
double sampleRate, NumericType frequency, NumericType
Q);
199 static Ptr makeAllPass (
double sampleRate, NumericType frequency);
202 static Ptr makeAllPass (
double sampleRate, NumericType frequency, NumericType
Q);
274 template <
size_t Num>
277 template <
size_t Num>
295 template <
typename SampleType>
302 using NumericType =
typename SampleTypeHelpers::ElementType<SampleType>::Type;
351 template <
typename ProcessContext>
359 #if JUCE_DSP_ENABLE_SNAP_TO_ZERO
389 SampleType* state =
nullptr;
392 JUCE_LEAK_DETECTOR (
Filter)
ElementType * begin() noexcept
ElementType * getRawDataPointer() noexcept
void prepare(const ProcessSpec &) noexcept
CoefficientsPtr coefficients
void snapToZero() noexcept
SampleType JUCE_VECTOR_CALLTYPE processSample(SampleType sample) noexcept
typename Coefficients< NumericType >::Ptr CoefficientsPtr
typename SampleTypeHelpers::ElementType< SampleType >::Type NumericType
void process(const ProcessContext &context) noexcept
static std::array< NumericType, 6 > makeHighPass(double sampleRate, NumericType frequency)
static std::array< NumericType, 6 > makePeakFilter(double sampleRate, NumericType centreFrequency, NumericType Q, NumericType gainFactor)
static std::array< NumericType, 6 > makeBandPass(double sampleRate, NumericType frequency)
static std::array< NumericType, 4 > makeFirstOrderHighPass(double sampleRate, NumericType frequency)
static std::array< NumericType, 6 > makeLowPass(double sampleRate, NumericType frequency)
static std::array< NumericType, 6 > makeLowShelf(double sampleRate, NumericType cutOffFrequency, NumericType Q, NumericType gainFactor)
static std::array< NumericType, 4 > makeFirstOrderLowPass(double sampleRate, NumericType frequency)
static std::array< NumericType, 4 > makeFirstOrderAllPass(double sampleRate, NumericType frequency)
static std::array< NumericType, 6 > makeAllPass(double sampleRate, NumericType frequency)
static std::array< NumericType, 6 > makeHighShelf(double sampleRate, NumericType cutOffFrequency, NumericType Q, NumericType gainFactor)
static std::array< NumericType, 6 > makeNotch(double sampleRate, NumericType frequency)
static Ptr makeLowShelf(double sampleRate, NumericType cutOffFrequency, NumericType Q, NumericType gainFactor)
const NumericType * getRawCoefficients() const noexcept
Coefficients(const std::array< NumericType, Num > &values)
static Ptr makeFirstOrderHighPass(double sampleRate, NumericType frequency)
static Ptr makeHighPass(double sampleRate, NumericType frequency)
static Ptr makeHighShelf(double sampleRate, NumericType cutOffFrequency, NumericType Q, NumericType gainFactor)
void getMagnitudeForFrequencyArray(const double *frequencies, double *magnitudes, size_t numSamples, double sampleRate) const noexcept
static Ptr makeLowPass(double sampleRate, NumericType frequency)
double getMagnitudeForFrequency(double frequency, double sampleRate) const noexcept
static Ptr makePeakFilter(double sampleRate, NumericType centreFrequency, NumericType Q, NumericType gainFactor)
void getPhaseForFrequencyArray(double *frequencies, double *phases, size_t numSamples, double sampleRate) const noexcept
static Ptr makeAllPass(double sampleRate, NumericType frequency)
NumericType * getRawCoefficients() noexcept
static Ptr makeBandPass(double sampleRate, NumericType frequency)
double getPhaseForFrequency(double frequency, double sampleRate) const noexcept
static Ptr makeNotch(double sampleRate, NumericType frequency)
size_t getFilterOrder() const noexcept
static Ptr makeFirstOrderLowPass(double sampleRate, NumericType frequency)
static Ptr makeFirstOrderAllPass(double sampleRate, NumericType frequency)
Array< NumericType > coefficients