#include <mj_filter_iir2.h>
Public Methods | |
MJ_FilterIIR2 () | |
~MJ_FilterIIR2 () | |
Empty destructor. | |
complex<float> | response (complex< float > omega) |
Filter usage: | |
void | putSample (TElem s) |
TElem | getSample () const |
TElem | putGetSample (TElem s) |
TElem | putGetSampleOther (MJ_FilterIIR2 *f, TElem s) |
void | resetMemory () |
Clear internal buffer. | |
Filter design methods: | |
void | flatResponse () |
void | designHighShelve1 (TElem centerRad, TElem gainDb, TElem slope=1.0) |
void | designHighShelve2 (TElem frequencyHz, TElem sampleRate, TElem gainDb, TElem slope=1.0) |
void | designLowShelve1 (TElem centerRad, TElem gainDb, TElem slope=1.0) |
void | designLowShelve2 (TElem frequencyHz, TElem sampleRate, TElem gainDb, TElem slope=1.0) |
void | designParametric1 (TElem boostAbs, TElem centerRad, TElem bandWidthRad) |
void | designParametricB1 (TElem K, TElem F, TElem omega, TElem bw) |
void | designParametricB2 (TElem hz, TElem sr, TElem gainDb, TElem bw) |
void | designParametricC1 (TElem K, TElem F, TElem omega, TElem bw) |
void | designParametricC2 (TElem hz, TElem sr, TElem gainDb, TElem bw) |
void | designLowPass1 (TElem omega, TElem Q) |
Design a low-pass filter. | |
void | designLowPass2 (TElem hz, TElem sr, TElem Q) |
Design a low-pass filter. More... | |
void | designHighPass1 (TElem omega, TElem Q) |
Design a high-pass filter. | |
void | designHighPass2 (TElem hz, TElem sr, TElem Q) |
Design a high-pass filter. More... | |
void | designBandPass1 (TElem omega, TElem Q) |
Design a band-pass filter. More... | |
void | designBandPass2 (TElem hz, TElem sr, TElem Q) |
Design a band-pass filter. More... | |
void | designBandPassB1 (TElem omega, TElem bw) |
Design a band-pass filter. More... | |
void | designBandPassB2 (TElem hz, TElem sr, TElem bw) |
Design a band-pass filter. More... | |
void | copyCoefficients (const MJ_FilterIIR2 &iir) |
Copy filter coefficients from the given filter. | |
void | mulGain (TElem scale) |
Multiply b-coefficients by factor scale. | |
Filter coefficient access: | |
TElem | b0 () const |
Filter coefficient b0. | |
TElem | b1 () const |
Filter coefficient b1. | |
TElem | b2 () const |
Filter coefficient b2. | |
TElem* | bptr () |
Returns pointer to the b-coefficient array (b0-b2). | |
TElem | a1 () const |
Filter coefficient a1. | |
TElem | a2 () const |
Filter coefficient a2. | |
TElem* | aptr () |
Returns pointer to the a-coefficient array (a1-a2). |
The filter coefficients are normalized like in Matlab - the coefficient a0 is assumed to be 1. As such it not stored or used in calculation.
|
Empty constructor. Constructor does not initialize any values. |
|
Design a band-pass filter.
|
|
Design a band-pass filter.
|
|
Design a band-pass filter.
|
|
Design a band-pass filter.
|
|
Design a high-pass filter.
|
|
Design a high-shelving EQ. See MJ_dspHighShelveEq. |
|
Design a high-shelving EQ. See iir2HighShelveEq. |
|
Design a low-pass filter.
|
|
Design a high-shelving EQ. See iir2LowShelveEq. |
|
Design a high-shelving EQ. See iir2LowShelveEq. |
|
Design a parametric EQ. This algorithm is not too flashy. It often creates numerically unstable filters. I have not removed this method since it may be of some use to someone... |
|
Design a parametric EQ. The algorithm is fairly ok. |
|
|
|
Design a parameteric filter that mimics analogue filters. Algorithm by S. J. Orfanidis: "Digital Parametric Equalizer Design with Prescribed Nyquist Frequency Gain", J. Audio Eng. Soc., vol.45, p.444, June 1997. The algorithm creates fairly ok frequency responses in most cases. The unfortunate exception: When the filter center frequency is high and the filter bandwidth is great the designed filter often has a rather poor curve shape.
|
|
Design a parameteric filter that mimics analogue filters. This is a utility method that uses designParametricC1 to do the dirty work.
|
|
Makes the filter have flat frequency response. |
|
Get the current sample. Does not change the filter state, but causes computation. |
|
Put sample and get output sample. |
|
Put sample and get output sample on a foreign filter. The filter coeeficients of "this" filter are used on the memory of the other filter. |
|
Puts a sample to the filter. Changes the internal state, but does not calculate the output value. |
|
Compute z-domain response. |