org.tritonus.lowlevel.dsp
Class Util

java.lang.Object
  extended by org.tritonus.lowlevel.dsp.Util

public class Util
extends java.lang.Object

Helper methods used for filter design.


Constructor Summary
Util()
           
 
Method Summary
static double absolute2omega(double dAbsolute, double dSampleRate)
          Converts frequency representation from absolute to omega.
static double I0(double x)
          Modified Bessel function of first kind and 0th order.
static Complex[] IDFT(Complex[] aFrequencyDomain)
          Compute an inverse discrete fourier transform (IDFT).
static double[] multiply(double[] ad1, double[] ad2)
          Multiplication of two arrays.
static double omega2absolute(double dOmega, double dSampleRate)
          Converts frequency representation from omega to absolute.
static double omega2relative(double dOmega)
          Converts frequency representation from omega to relative.
static float[] quantizeToFloat(double[] adConstants)
          Quantize constants from double to float.
static double relative2omega(double dRelative)
          Converts frequency representation from relative to omega.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

I0

public static double I0(double x)
Modified Bessel function of first kind and 0th order.


IDFT

public static Complex[] IDFT(Complex[] aFrequencyDomain)
Compute an inverse discrete fourier transform (IDFT). This implementation works fully complex. It is not optimized for speed. I.e., it does not use a 'fast' algorithm.

Parameters:
aFrequencyDomain - The array containing the frequency domain factors.
Returns:
The reconstructed time domain values (returned as complex numbers for full generality).

multiply

public static double[] multiply(double[] ad1,
                                double[] ad2)
Multiplication of two arrays.


omega2relative

public static double omega2relative(double dOmega)
Converts frequency representation from omega to relative. This method converts a frequency represented in omega ([-PI .. +PI]) to relative (f/fs).

Parameters:
dOmega - The frequency represented in omega ([-PI .. +PI]).
Returns:
The frequency represented relative to the sample rate (f/fs).

relative2omega

public static double relative2omega(double dRelative)
Converts frequency representation from relative to omega. This method converts a frequency represented relative to the sample rate (f/fs) to omega ([-PI .. +PI]).

Parameters:
dRelative - The frequency represented relative to the sample rate (f/fs).
Returns:
The frequency represented in omega ([-PI .. +PI]).

omega2absolute

public static double omega2absolute(double dOmega,
                                    double dSampleRate)
Converts frequency representation from omega to absolute. This method converts a frequency represented in omega ([-PI .. +PI]) to absolute frequency (f).

Parameters:
dOmega - The frequency represented in omega ([-PI .. +PI]).
dSampleRate - The sample rate (fs).
Returns:
The absolute frequency represented in Hz (f).

absolute2omega

public static double absolute2omega(double dAbsolute,
                                    double dSampleRate)
Converts frequency representation from absolute to omega. This method converts a frequency represented relative to the sample rate (f/fs) to omega ([-PI .. +PI]).

Parameters:
dAbsolute - The absolute frequency expressed in Hz (f).
dSampleRate - The sample rate (fs).
Returns:
The frequency represented in omega ([-PI .. +PI]).

quantizeToFloat

public static float[] quantizeToFloat(double[] adConstants)
Quantize constants from double to float.