ddf.minim.effects
Class LowPassFS

java.lang.Object
  extended by ddf.minim.ugens.UGen
      extended by ddf.minim.effects.IIRFilter
          extended by ddf.minim.effects.LowPassFS
All Implemented Interfaces:
AudioEffect

public class LowPassFS
extends IIRFilter

LowPassFS is a four stage low pass filter. It becomes unstable if the cutoff frequency is set below 60 Hz, so it will report and error and set the cutoff to 60 Hz if you try to set it lower.

Author:
Damien Di Fede

Nested Class Summary
 
Nested classes/interfaces inherited from class ddf.minim.ugens.UGen
UGen.InputType, UGen.UGenInput
 
Field Summary
 
Fields inherited from class ddf.minim.effects.IIRFilter
a, audio, b, cutoff
 
Constructor Summary
LowPassFS(float freq, float sampleRate)
          Constructs a low pass filter with a cutoff frequency of freq that will be used to filter audio recorded at sampleRate.
 
Method Summary
protected  void calcCoeff()
          Calculates the coefficients of the filter using the current cutoff frequency.
 boolean validFreq(float f)
          Returns true if the frequency is valid for this filter.
 
Methods inherited from class ddf.minim.effects.IIRFilter
frequency, initArrays, printCoeff, process, process, setFreq, uGenerate
 
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
 

Constructor Detail

LowPassFS

public LowPassFS(float freq,
                 float sampleRate)
Constructs a low pass filter with a cutoff frequency of freq that will be used to filter audio recorded at sampleRate.

Parameters:
freq - the cutoff frequency
sampleRate - the sample rate of the audio that will be filtered
Method Detail

validFreq

public boolean validFreq(float f)
Description copied from class: IIRFilter
Returns true if the frequency is valid for this filter. Subclasses can override this method if they want to limit center frequencies to certain ranges to avoid becoming unstable. The default implementation simply makes sure that f is positive.

Overrides:
validFreq in class IIRFilter
Parameters:
f - the frequency (in Hz) to validate
Returns:
true if f is a valid frequency for this filter

calcCoeff

protected void calcCoeff()
Description copied from class: IIRFilter
Calculates the coefficients of the filter using the current cutoff frequency. To make your own IIRFilters, you must extend IIRFilter and implement this function. The frequency is expressed as a fraction of the sample rate. When filling the coefficient arrays, be aware that b[0] corresponds to the coefficient b1.

Specified by:
calcCoeff in class IIRFilter