jass.generators
Class Butter2LowFilter

java.lang.Object
  extended by jass.generators.Butter2LowFilter
All Implemented Interfaces:
Filter

public class Butter2LowFilter
extends java.lang.Object
implements Filter

Second order Butterworth lowpass filter.

Author:
Kees van den Doel (kvdoel@cs.ubc.ca)

Field Summary
protected  float A
          Gain.
protected  float A0
          Gain.
protected  float cc
          Coefficients (Steiglitz notation).
protected  float dd
          Coefficients (Steiglitz notation).
protected  float f
          Cutoff frequency in Hertz.
protected  float gain
          Gain.
protected  float srate
          Sampling rate in Hertz.
 
Constructor Summary
Butter2LowFilter(float srate)
          Create and initialize.
 
Method Summary
 void filter(float[] output, float[] input, int nsamples, int inputOffset)
          Proces input (may be same as output).
 void reset()
          Reset state.
 void reset(float c)
          Reset state.
 void setCutoffFrequency(float f)
          Set the filter cutoff.
 void setGain(float gain)
          Set gain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

srate

protected float srate
Sampling rate in Hertz.


f

protected float f
Cutoff frequency in Hertz.


cc

protected float cc
Coefficients (Steiglitz notation).


dd

protected float dd
Coefficients (Steiglitz notation).


A

protected float A
Gain. A0 is normalized. A is actual gain, gain is user settable


A0

protected float A0
Gain. A0 is normalized. A is actual gain, gain is user settable


gain

protected float gain
Gain. A0 is normalized. A is actual gain, gain is user settable

Constructor Detail

Butter2LowFilter

public Butter2LowFilter(float srate)
Create and initialize.

Parameters:
srate - sampling rate in Hertz.
Method Detail

setCutoffFrequency

public void setCutoffFrequency(float f)
Set the filter cutoff.

Parameters:
f - cutoff frequency in Hertz.

setGain

public void setGain(float gain)
Set gain.

Parameters:
gain - gain.

reset

public void reset()
Reset state.


reset

public void reset(float c)
Reset state.

Parameters:
c - value of constant state

filter

public void filter(float[] output,
                   float[] input,
                   int nsamples,
                   int inputOffset)
Proces input (may be same as output).

Specified by:
filter in interface Filter
Parameters:
output - user provided buffer for returned result.
input - user provided input buffer.
nsamples - number of samples written to output buffer.
inputOffset - where to start in circular buffer input.