|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttoxi.audio.IIRFilter
public class IIRFilter
This class provides a simple IIR filter implementation with one of lowpass, highpass or bandpass characteristics. The class can filter individual samples or entire signal buffers. The filter function always has this form:
y = 1 / a0 * (b0 * x0 + b1 * x1 + b2 * x2 - a1 * q1 - a2 * q2)http://en.wikipedia.org/wiki/Infinite_impulse_response
Nested Class Summary | |
---|---|
static class |
IIRFilter.Type
|
Constructor Summary | |
---|---|
IIRFilter(IIRFilter.Type type,
float sampleRate)
|
Method Summary | |
---|---|
float |
calculateAmplitude(float[] in)
Just calculates the amplitude of the filtered signal, but doesn't actually apply the filter. |
IIRFilter |
clear()
|
float |
filter(float in)
Applies filter to a single sample value. |
float |
filter(float[] in)
Destructively filters a the given signal buffer. |
float |
getDecay()
|
IIRFilter |
init(float freq,
float q)
Initializes the filter to the given cutoff frequency and Q (resonance) settings. |
IIRFilter |
setDecay(float decay)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IIRFilter(IIRFilter.Type type, float sampleRate)
type
- sampleRate
- Method Detail |
---|
public float calculateAmplitude(float[] in)
in
-
public IIRFilter clear()
public float filter(float in)
in
-
public float filter(float[] in)
in
-
public float getDecay()
public IIRFilter init(float freq, float q)
freq
- q
-
public IIRFilter setDecay(float decay)
decay
- the decay to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |