jass.generators
Class KellyLochbaumFilterOld

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

public class KellyLochbaumFilterOld
extends java.lang.Object
implements Filter

Kelly-Lochbaum filter. Follow notation of MATLAB sample code from www.cs.tut.fi/sgn/arg/8003051 and associated writeup therein

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

Field Summary
protected  double[] B0
          State of filter.
protected  double[] B0old
          Scratch variables
protected  double[] B1
          State of filter.
protected  double[] B1old
          Scratch variables
protected  double[] cylRadius
          Radii of the segments
protected  double dampingCoeff
          How much damping in system (1 == no damping)
protected  double[] F0
          State of filter.
protected  double[] F0old
          Scratch variables
protected  double[] F1
          State of filter.
protected  double[] F1old
          Scratch variables
protected  double glottalReflectionCoeff
          How much is reflected back at glottis
protected  double[] kCoeff
          Filter coefficients derived form cylinder radii
protected  int nJunctions
          This many junctions (above -1)
protected  int nTubeSections
          This many cylinder segments
protected  float srate
          Sampling rate in Hertz.
 
Constructor Summary
KellyLochbaumFilterOld()
           
KellyLochbaumFilterOld(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

srate

protected float srate
Sampling rate in Hertz.


F0

protected double[] F0
State of filter.


F1

protected double[] F1
State of filter.


B0

protected double[] B0
State of filter.


B1

protected double[] B1
State of filter.


glottalReflectionCoeff

protected double glottalReflectionCoeff
How much is reflected back at glottis


dampingCoeff

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


F0old

protected double[] F0old
Scratch variables


F1old

protected double[] F1old
Scratch variables


B0old

protected double[] B0old
Scratch variables


B1old

protected double[] B1old
Scratch variables


nTubeSections

protected int nTubeSections
This many cylinder segments


nJunctions

protected int nJunctions
This many junctions (above -1)


cylRadius

protected double[] cylRadius
Radii of the segments


kCoeff

protected double[] kCoeff
Filter coefficients derived form cylinder radii

Constructor Detail

KellyLochbaumFilterOld

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

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

KellyLochbaumFilterOld

public KellyLochbaumFilterOld()
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

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

setDampingCoeff

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

Parameters:
val - damping 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.