org.tritonus.lowlevel.dsp
Class FIR

java.lang.Object
  extended by org.tritonus.lowlevel.dsp.FIR
All Implemented Interfaces:
Filter

public class FIR
extends java.lang.Object
implements Filter

A Finite Impulse Response (FIR) filter.


Constructor Summary
FIR(float[] afCoefficients)
          Init a FIR filter with coefficients.
 
Method Summary
 double getFrequencyResponse(double dOmega)
          Get the frequency response of the filter at a specified frequency.
 double getPhaseResponse(double dOmega)
          Get the phase response of the filter at a specified frequency.
 float process(float fInput)
          Process an input sample and calculate an output sample.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIR

public FIR(float[] afCoefficients)
Init a FIR filter with coefficients.

Parameters:
afCoefficients - The array of filter coefficients.
Method Detail

process

public float process(float fInput)
Process an input sample and calculate an output sample. Call this method to use the filter.

Specified by:
process in interface Filter

getFrequencyResponse

public double getFrequencyResponse(double dOmega)
Get the frequency response of the filter at a specified frequency. This method calculates the frequency response of the filter for a specified frequency. Calling this method is allowed at any time, even while the filter is operating. It does not affect the operation of the filter.

Specified by:
getFrequencyResponse in interface Filter
Parameters:
dOmega - The frequency for which the frequency response should be calculated. Has to be given as omega values ([-PI .. +PI]).
Returns:
The calculated frequency response.

getPhaseResponse

public double getPhaseResponse(double dOmega)
Get the phase response of the filter at a specified frequency. This method calculates the phase response of the filter for a specified frequency. Calling this method is allowed at any time, even while the filter is operating. It does not affect the operation of the filter.

Specified by:
getPhaseResponse in interface Filter
Parameters:
dOmega - The frequency for which the phase response should be calculated. Has to be given as omega values ([-PI .. +PI]).
Returns:
The calculated phase response.