Gin
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Filter Class Reference

Multi-channel biquad filter with multiple types and slopes. More...

#include <gin_filter.h>

Public Types

enum  Type {
  none = 0 , lowpass , highpass , bandpass ,
  notch , lowshelf , highshelf , peak ,
  allpass
}
 
enum  Slope { db12 = 0 , db24 }
 

Public Member Functions

 Filter (int maxOrder=2)
 
void setSampleRate (double sr)
 
void setNumChannels (int ch)
 
void setType (Type t)
 
void setSlope (Slope s)
 
void reset ()
 
float getFrequency ()
 
void setParams (float freq_, float q_, float g_=0.0f)
 
void process (juce::AudioSampleBuffer &buffer)
 
float getResponseMagnitude (float atFreq)
 

Detailed Description

Multi-channel biquad filter with multiple types and slopes.

Filter provides a flexible multi-channel filtering solution supporting common filter types (lowpass, highpass, bandpass, etc.) with selectable 12dB or 24dB/octave slopes. It uses high-quality biquad filters with matched z-transform (MZTi) coefficient calculation.

Key Features:

Filter Types:

Slopes:

Usage:

Filter filter;
filter.setSampleRate(44100.0);
filter.setNumChannels(2);
filter.setParams(1000.0f, 0.707f); // 1kHz, Q=0.707
filter.process(audioBuffer);
// Get frequency response at 500Hz
float response = filter.getResponseMagnitude(500.0f);
Multi-channel biquad filter with multiple types and slopes.
Definition gin_filter.h:65
float getResponseMagnitude(float atFreq)
Definition gin_filter.h:154
void setSampleRate(double sr)
Definition gin_filter.h:93
@ db24
Definition gin_filter.h:83
void process(juce::AudioSampleBuffer &buffer)
Definition gin_filter.h:133
@ lowpass
Definition gin_filter.h:70
void setType(Type t)
Definition gin_filter.h:107
void setNumChannels(int ch)
Definition gin_filter.h:95
void setParams(float freq_, float q_, float g_=0.0f)
Definition gin_filter.h:118
void setSlope(Slope s)
Definition gin_filter.h:108
A lightweight 2D point class for projects that don't use juce_graphics.
Definition gin_point.h:25
See also
EQ

Member Enumeration Documentation

◆ Type

Enumerator
none 
lowpass 
highpass 
bandpass 
notch 
lowshelf 
highshelf 
peak 
allpass 

◆ Slope

Enumerator
db12 
db24 

Constructor & Destructor Documentation

◆ Filter()

Filter::Filter ( int  maxOrder = 2)

Member Function Documentation

◆ setSampleRate()

void Filter::setSampleRate ( double  sr)

◆ setNumChannels()

void Filter::setNumChannels ( int  ch)

References Point< T >::Point().

◆ setType()

void Filter::setType ( Type  t)

◆ setSlope()

void Filter::setSlope ( Slope  s)

◆ reset()

void Filter::reset ( )

◆ getFrequency()

float Filter::getFrequency ( )

◆ setParams()

void Filter::setParams ( float  freq_,
float  q_,
float  g_ = 0.0f 
)

References none, and Q.

◆ process()

void Filter::process ( juce::AudioSampleBuffer &  buffer)

References db12, db24, and none.

◆ getResponseMagnitude()

float Filter::getResponseMagnitude ( float  atFreq)

References db12, db24, Point< T >::Point(), and Q.


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