Loading...
Searching...
No Matches
juce_FilterDesign.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
By using JUCE, you agree to the terms of both the JUCE 7 End-User License
Agreement and JUCE Privacy Policy.
End User License Agreement: www.juce.com/juce-7-licence
Privacy Policy: www.juce.com/juce-privacy-policy
Or: You may also use this code under the terms of the GPL v3 (see
www.gnu.org/licenses).
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce::dsp
{
template <typename FloatType>
struct FilterDesign
{
using FIRCoefficientsPtr = typename FIR::Coefficients<FloatType>::Ptr;
using IIRCoefficients = typename IIR::Coefficients<FloatType>;
using WindowingMethod = typename WindowingFunction<FloatType>::WindowingMethod;
//==============================================================================
static FIRCoefficientsPtr designFIRLowpassWindowMethod (FloatType frequency, double sampleRate,
size_t order, WindowingMethod type,
FloatType beta = static_cast<FloatType> (2));
static FIRCoefficientsPtr designFIRLowpassKaiserMethod (FloatType frequency, double sampleRate,
FloatType normalisedTransitionWidth,
FloatType amplitudedB);
static FIRCoefficientsPtr designFIRLowpassTransitionMethod (FloatType frequency, double sampleRate,
size_t order,
FloatType normalisedTransitionWidth,
FloatType spline);
static FIRCoefficientsPtr designFIRLowpassLeastSquaresMethod (FloatType frequency, double sampleRate, size_t order,
FloatType normalisedTransitionWidth,
FloatType stopBandWeight);
static FIRCoefficientsPtr designFIRLowpassHalfBandEquirippleMethod (FloatType normalisedTransitionWidth,
FloatType amplitudedB);
//==============================================================================
static ReferenceCountedArray<IIRCoefficients> designIIRLowpassHighOrderButterworthMethod (FloatType frequency, double sampleRate,
FloatType normalisedTransitionWidth,
FloatType passbandAmplitudedB,
FloatType stopbandAmplitudedB);
//==============================================================================
static ReferenceCountedArray<IIRCoefficients> designIIRLowpassHighOrderButterworthMethod (FloatType frequency, double sampleRate,
int order);
static ReferenceCountedArray<IIRCoefficients> designIIRHighpassHighOrderButterworthMethod (FloatType frequency, double sampleRate,
int order);
static ReferenceCountedArray<IIRCoefficients> designIIRLowpassHighOrderChebyshev1Method (FloatType frequency, double sampleRate,
FloatType normalisedTransitionWidth,
FloatType passbandAmplitudedB,
FloatType stopbandAmplitudedB);
static ReferenceCountedArray<IIRCoefficients> designIIRLowpassHighOrderChebyshev2Method (FloatType frequency, double sampleRate,
FloatType normalisedTransitionWidth,
FloatType passbandAmplitudedB,
FloatType stopbandAmplitudedB);
static ReferenceCountedArray<IIRCoefficients> designIIRLowpassHighOrderEllipticMethod (FloatType frequency, double sampleRate,
FloatType normalisedTransitionWidth,
FloatType passbandAmplitudedB,
FloatType stopbandAmplitudedB);
struct IIRPolyphaseAllpassStructure
{
ReferenceCountedArray<IIRCoefficients> directPath, delayedPath;
Array<double> alpha;
};
static IIRPolyphaseAllpassStructure designIIRLowpassHalfBandPolyphaseAllpassMethod (FloatType normalisedTransitionWidth,
FloatType stopbandAmplitudedB);
private:
//==============================================================================
static Array<double> getPartialImpulseResponseHn (int n, double kp);
static ReferenceCountedArray<IIRCoefficients> designIIRLowpassHighOrderGeneralMethod (int type, FloatType frequency, double sampleRate,
FloatType normalisedTransitionWidth,
FloatType passbandAmplitudedB,
FloatType stopbandAmplitudedB);
FilterDesign() = delete;
};
} // namespace juce::dsp
juce::Array
Definition juce_Array.h:56
juce::ReferenceCountedArray
Definition juce_ReferenceCountedArray.h:51
juce::dsp::WindowingFunction::WindowingMethod
WindowingMethod
Definition juce_Windowing.h:46
juce::dsp::FIR::Coefficients::Ptr
ReferenceCountedObjectPtr< Coefficients > Ptr
Definition juce_FIRFilter.h:233
juce::dsp::FilterDesign::designIIRLowpassHighOrderButterworthMethod
static ReferenceCountedArray< IIRCoefficients > designIIRLowpassHighOrderButterworthMethod(FloatType frequency, double sampleRate, FloatType normalisedTransitionWidth, FloatType passbandAmplitudedB, FloatType stopbandAmplitudedB)
Definition juce_FilterDesign.cpp:337
juce::dsp::FilterDesign::designFIRLowpassLeastSquaresMethod
static FIRCoefficientsPtr designFIRLowpassLeastSquaresMethod(FloatType frequency, double sampleRate, size_t order, FloatType normalisedTransitionWidth, FloatType stopBandWeight)
Definition juce_FilterDesign.cpp:126
juce::dsp::FilterDesign::designFIRLowpassKaiserMethod
static FIRCoefficientsPtr designFIRLowpassKaiserMethod(FloatType frequency, double sampleRate, FloatType normalisedTransitionWidth, FloatType amplitudedB)
Definition juce_FilterDesign.cpp:65
juce::dsp::FilterDesign::designIIRLowpassHalfBandPolyphaseAllpassMethod
static IIRPolyphaseAllpassStructure designIIRLowpassHalfBandPolyphaseAllpassMethod(FloatType normalisedTransitionWidth, FloatType stopbandAmplitudedB)
Definition juce_FilterDesign.cpp:612
juce::dsp::FilterDesign::designIIRLowpassHighOrderChebyshev1Method
static ReferenceCountedArray< IIRCoefficients > designIIRLowpassHighOrderChebyshev1Method(FloatType frequency, double sampleRate, FloatType normalisedTransitionWidth, FloatType passbandAmplitudedB, FloatType stopbandAmplitudedB)
Definition juce_FilterDesign.cpp:348
juce::dsp::FilterDesign::designIIRHighpassHighOrderButterworthMethod
static ReferenceCountedArray< IIRCoefficients > designIIRHighpassHighOrderButterworthMethod(FloatType frequency, double sampleRate, int order)
Definition juce_FilterDesign.cpp:577
juce::dsp::FilterDesign::designFIRLowpassTransitionMethod
static FIRCoefficientsPtr designFIRLowpassTransitionMethod(FloatType frequency, double sampleRate, size_t order, FloatType normalisedTransitionWidth, FloatType spline)
Definition juce_FilterDesign.cpp:93
juce::dsp::FilterDesign::designIIRLowpassHighOrderChebyshev2Method
static ReferenceCountedArray< IIRCoefficients > designIIRLowpassHighOrderChebyshev2Method(FloatType frequency, double sampleRate, FloatType normalisedTransitionWidth, FloatType passbandAmplitudedB, FloatType stopbandAmplitudedB)
Definition juce_FilterDesign.cpp:359
juce::dsp::FilterDesign::designIIRLowpassHighOrderEllipticMethod
static ReferenceCountedArray< IIRCoefficients > designIIRLowpassHighOrderEllipticMethod(FloatType frequency, double sampleRate, FloatType normalisedTransitionWidth, FloatType passbandAmplitudedB, FloatType stopbandAmplitudedB)
Definition juce_FilterDesign.cpp:370
juce::dsp::FilterDesign::designFIRLowpassHalfBandEquirippleMethod
static FIRCoefficientsPtr designFIRLowpassHalfBandEquirippleMethod(FloatType normalisedTransitionWidth, FloatType amplitudedB)
Definition juce_FilterDesign.cpp:235
juce::dsp::FilterDesign::designFIRLowpassWindowMethod
static FIRCoefficientsPtr designFIRLowpassWindowMethod(FloatType frequency, double sampleRate, size_t order, WindowingMethod type, FloatType beta=static_cast< FloatType >(2))
Definition juce_FilterDesign.cpp:31
juce::dsp::FilterDesign::IIRPolyphaseAllpassStructure
Definition juce_FilterDesign.h:257
juce::dsp::IIR::Coefficients
Definition juce_dsp/processors/juce_IIRFilter.h:124