dsp::StateVariableFilter::Parameters< NumericType > Struct Template Reference
Inheritance diagram for dsp::StateVariableFilter::Parameters< NumericType >:

Public Types

enum  Type { Type::lowPass, Type::bandPass, Type::highPass }
 
using Ptr = ReferenceCountedObjectPtr< Parameters >
 The Coefficients structure is ref-counted, so this is a handy type that can be used as a pointer to one. More...
 
- Public Types inherited from dsp::ProcessorState
using Ptr = ReferenceCountedObjectPtr< ProcessorState >
 The ProcessorState structure is ref-counted, so this is a handy type that can be used as a pointer to one. More...
 

Public Member Functions

void setCutOffFrequency (double sampleRate, NumericType frequency, NumericType resonance=static_cast< NumericType >(1.0/std::sqrt(2.0))) noexcept
 Sets the cutoff frequency and resonance of the IIR filter. More...
 
 Parameters ()=default
 
 Parameters (const Parameters &o)
 
Parametersoperator= (const Parameters &o) noexcept
 
- Public Member Functions inherited from ReferenceCountedObject
void incReferenceCount () noexcept
 Increments the object's reference count. More...
 
void decReferenceCount () noexcept
 Decreases the object's reference count. More...
 
bool decReferenceCountWithoutDeleting () noexcept
 Decreases the object's reference count. More...
 
int getReferenceCount () const noexcept
 Returns the object's current reference count. More...
 

Public Attributes

Type type = Type::lowPass
 The type of the IIR filter. More...
 
NumericType g = static_cast<NumericType> (std::tan (double_Pi * 200.0 / 44100.0))
 
NumericType R2 = static_cast<NumericType> (std::sqrt (2.0))
 
NumericType h = static_cast<NumericType> (1.0 / (1.0 + R2 * g + g * g))
 

Additional Inherited Members

- Protected Member Functions inherited from ReferenceCountedObject
 ReferenceCountedObject ()
 Creates the reference-counted object (with an initial ref count of zero). More...
 
 ReferenceCountedObject (const ReferenceCountedObject &) noexcept
 Copying from another object does not affect this one's reference-count. More...
 
 ReferenceCountedObject (ReferenceCountedObject &&) noexcept
 Copying from another object does not affect this one's reference-count. More...
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &) noexcept
 Copying from another object does not affect this one's reference-count. More...
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&) noexcept
 Copying from another object does not affect this one's reference-count. More...
 
virtual ~ReferenceCountedObject ()
 Destructor. More...
 
void resetReferenceCount () noexcept
 Resets the reference count to zero without deleting the object. More...
 

Member Typedef Documentation

◆ Ptr

template<typename NumericType>
using dsp::StateVariableFilter::Parameters< NumericType >::Ptr = ReferenceCountedObjectPtr<Parameters>

The Coefficients structure is ref-counted, so this is a handy type that can be used as a pointer to one.

Member Enumeration Documentation

◆ Type

template<typename NumericType>
enum dsp::StateVariableFilter::Parameters::Type
strong
Enumerator
lowPass 
bandPass 
highPass 

Constructor & Destructor Documentation

◆ Parameters() [1/2]

template<typename NumericType>
dsp::StateVariableFilter::Parameters< NumericType >::Parameters ( )
default

◆ Parameters() [2/2]

template<typename NumericType>
dsp::StateVariableFilter::Parameters< NumericType >::Parameters ( const Parameters< NumericType > &  o)

Member Function Documentation

◆ setCutOffFrequency()

template<typename NumericType>
void dsp::StateVariableFilter::Parameters< NumericType >::setCutOffFrequency ( double  sampleRate,
NumericType  frequency,
NumericType  resonance = static_cast<NumericType> (1.0 / std::sqrt (2.0)) 
)
noexcept

Sets the cutoff frequency and resonance of the IIR filter.

Note : the bandwidth of the resonance increases with the value of the parameter. To have a standard 12 dB/octave filter, the value must be set at 1 / sqrt(2).

References double_Pi.

◆ operator=()

template<typename NumericType>
Parameters& dsp::StateVariableFilter::Parameters< NumericType >::operator= ( const Parameters< NumericType > &  o)
noexcept

Member Data Documentation

◆ type

template<typename NumericType>
Type dsp::StateVariableFilter::Parameters< NumericType >::type = Type::lowPass

The type of the IIR filter.

◆ g

template<typename NumericType>
NumericType dsp::StateVariableFilter::Parameters< NumericType >::g = static_cast<NumericType> (std::tan (double_Pi * 200.0 / 44100.0))

◆ R2

template<typename NumericType>
NumericType dsp::StateVariableFilter::Parameters< NumericType >::R2 = static_cast<NumericType> (std::sqrt (2.0))

◆ h

template<typename NumericType>
NumericType dsp::StateVariableFilter::Parameters< NumericType >::h = static_cast<NumericType> (1.0 / (1.0 + R2 * g + g * g))

The documentation for this struct was generated from the following file: