ddf.minim.effects
Class BandPass

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

public class BandPass
extends IIRFilter

A band pass filter is a filter that filters out all frequencies except for those in a band centered on the current frequency of the filter.

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
BandPass(float freq, float bandWidth, float sampleRate)
          Constructs a band pass filter with the requested center frequency, bandwidth and sample rate.
 
Method Summary
protected  void calcCoeff()
          Calculates the coefficients of the filter using the current cutoff frequency.
 float getBandWidth()
          Returns the band width of this filter.
 void setBandWidth(float bandWidth)
          Sets the band width 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
 

Constructor Detail

BandPass

public BandPass(float freq,
                float bandWidth,
                float sampleRate)
Constructs a band pass filter with the requested center frequency, bandwidth and sample rate.

Parameters:
freq - the center frequency of the band to pass (in Hz)
bandWidth - the width of the band to pass (in Hz)
sampleRate - the sample rate of audio that will be filtered by this filter
Method Detail

setBandWidth

public void setBandWidth(float bandWidth)
Sets the band width of the filter. Doing this will cause the coefficients to be recalculated.

Parameters:
bandWidth - the band width (in Hz)

getBandWidth

public float getBandWidth()
Returns the band width of this filter.

Returns:
the band width (in Hz)

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