|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ddf.minim.ugens.UGen ddf.minim.effects.IIRFilter ddf.minim.effects.ChebFilter
public class ChebFilter
A Chebyshev filter is an IIR filter that uses a particular method to
calculate the coefficients of the filter. It is defined by whether it is a
low pass filter or a high pass filter and the number of poles it has. You
needn't worry about what a pole is, exactly, just know that more poles
usually makes for a better filter. An additional limitation is that the
number of poles must be even. See setPoles(int)
for more information
about poles. Another characteristic of Chebyshev filters is how much "ripple"
they allow in the pass band. The pass band is the range of frequencies that
the filter lets through. The "ripple" in the pass band can be seen as wavy
line in the frequency response of the filter. Lots of ripple is bad, but more
ripple gives a faster rolloff from the pass band to the stop band (the range
of frequencies blocked by the filter). Faster rolloff is good because it
means the cutoff is sharper. Ripple is expressed as a percentage, such as
0.5% ripple.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ddf.minim.ugens.UGen |
---|
UGen.InputType, UGen.UGenInput |
Field Summary | |
---|---|
static int |
HP
A constant used to indicate a high pass filter. |
static int |
LP
A constant used to indicate a low pass filter. |
Fields inherited from class ddf.minim.effects.IIRFilter |
---|
a, audio, b, cutoff |
Constructor Summary | |
---|---|
ChebFilter(float frequency,
int type,
float ripple,
int poles,
float sampleRate)
Constructs a Chebyshev filter with a cutoff of the given frequency, of the given type, with the give amount of ripple in the pass band, and with the given number of poles, that will be used to filter audio of that was recorded at the given sample rate. |
Method Summary | |
---|---|
protected void |
calcCoeff()
Calculates the coefficients of the filter using the current cutoff frequency. |
int |
getPoles()
Returns the number of poles in the filter. |
float |
getRipple()
Returns the ripple percentage of the filter. |
int |
getType()
Returns the type of the filter. |
void |
setPoles(int p)
Sets the number of poles used in the filter. |
void |
setRipple(float r)
Sets the ripple percentage of the filter. |
void |
setType(int t)
Sets the type of the filter. |
Methods inherited from class ddf.minim.effects.IIRFilter |
---|
frequency, initArrays, printCoeff, process, process, setFreq, uGenerate, validFreq |
Methods inherited from class ddf.minim.ugens.UGen |
---|
addInput, getLastValues, patch, patch, patch, printInputs, removeInput, sampleRate, sampleRateChanged, setSampleRate, tick, unpatch, unpatch |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LP
public static final int HP
Constructor Detail |
---|
public ChebFilter(float frequency, int type, float ripple, int poles, float sampleRate)
frequency
- the cutoff frequency of the filtertype
- the type of filter, either ChebFilter.LP or ChebFilter.HPripple
- the percentage of ripple, such as 0.005poles
- the number of poles, must be even and in the range [2, 20]sampleRate
- the sample rate of audio that will be filteredMethod Detail |
---|
public void setType(int t)
t
- the type of the filterpublic int getType()
public void setRipple(float r)
r
- the ripple percentagepublic float getRipple()
public void setPoles(int p)
Cutoff Frequency (expressed as a fraction of the sampling rate) |
0.02 | 0.05 | 0.10 | 0.25 | 0.40 | 0.45 | 0.48 |
Maximum poles | 4 | 6 | 10 | 20 | 10 | 6 | 4 |
p
- -
the number of polespublic int getPoles()
protected void calcCoeff()
IIRFilter
b[0]
corresponds to the coefficient b1
.
calcCoeff
in class IIRFilter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |