jass.generators
Class KellyLochbaumFilter

java.lang.Object
  extended by jass.generators.KellyLochbaumFilter
All Implemented Interfaces:
Filter
Direct Known Subclasses:
TubeFilter

public class KellyLochbaumFilter
extends java.lang.Object
implements Filter

Kelly-Lochbaum filter. Follow sample code from http://people.ee.ethz.ch/~jniederh/VocSynth/

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

Field Summary
protected  double[] cylRadius
          Radii of the segments
protected  double dampingCoeff
          How much damping in system (1 == no damping)
protected  double[] gi
          State of filter.
protected  double[] go
          State of filter.
protected  double[] kCoeff
          Filter coefficients derived form cylinder radii
protected  double[] li
          State of filter.
protected  double[] lo
          State of filter.
protected  int nTubeSections
          This many cylinder segments
protected  float srate
          Sampling rate in Hertz.
 
Constructor Summary
KellyLochbaumFilter()
           
KellyLochbaumFilter(float srate, int nTubeSections)
          Create and initialize.
 
Method Summary
protected  void computeKCoeff()
          Compute low level filter values from geometry
 void filter(float[] output, float[] input, int nsamples, int inputOffset)
          Proces input (may be same as output).
 void resetFilter()
          Clear filter of past history
 void setAllCylinderRadii(double[] r)
          Set all radii
 void setCylinderRadius(int k, double r)
          Set an individual segment radius
 void setDampingCoeff(double val)
          Set damping coeff.
 void setGlottalReflectionCoeff(double val)
          Set the glottal reflection coeff.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dampingCoeff

protected double dampingCoeff
How much damping in system (1 == no damping)


srate

protected float srate
Sampling rate in Hertz.


li

protected double[] li
State of filter.


lo

protected double[] lo
State of filter.


gi

protected double[] gi
State of filter.


go

protected double[] go
State of filter.


nTubeSections

protected int nTubeSections
This many cylinder segments


cylRadius

protected double[] cylRadius
Radii of the segments


kCoeff

protected double[] kCoeff
Filter coefficients derived form cylinder radii

Constructor Detail

KellyLochbaumFilter

public KellyLochbaumFilter(float srate,
                           int nTubeSections)
Create and initialize.

Parameters:
srate - sampling rate in Hertz.
nTubeSection - number of sections

KellyLochbaumFilter

public KellyLochbaumFilter()
Method Detail

computeKCoeff

protected void computeKCoeff()
Compute low level filter values from geometry


setCylinderRadius

public void setCylinderRadius(int k,
                              double r)
Set an individual segment radius

Parameters:
k - index of segment (0,...)
r - radius to set

setAllCylinderRadii

public void setAllCylinderRadii(double[] r)
Set all radii

Parameters:
array - of r radii

setDampingCoeff

public void setDampingCoeff(double val)
Set damping coeff. (1 == no damping)

Parameters:
val - damping coefficient

resetFilter

public void resetFilter()
Clear filter of past history


setGlottalReflectionCoeff

public void setGlottalReflectionCoeff(double val)
Set the glottal reflection coeff.

Parameters:
val - glottal reflection coefficient

filter

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

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.