edu.mines.jtk.dsp
Class KaiserWindow

java.lang.Object
  extended by edu.mines.jtk.dsp.KaiserWindow

public class KaiserWindow
extends java.lang.Object

The Kaiser window is often used in FIR filter design. It is easy to use and exhibits near-optimal properties for many filter design problems. The window is defined by any two of three parameters: window length, transition width, and maximum absolute error.

For definiteness, assume that the Kaiser window is a function w(x) of argument x. Then, the window length is that range of x, centered about x = 0, for which the Kaiser window is non-zero. In other words, w(x) = 0 for |x| > length/2. When windowing functions of time, both the window length and the argument x of w(x) have dimensions of time.

The transition width is the width of the central lobe in the Fourier transform of the window. For band-pass filters, this is the width of the transition between pass and stop bands. When windowing functions of time, the dimensions of transition width are cycles per unit time (frequency). In any case, the product of window length and transition width is dimensionless.

The maximum absolute error corresponds to the magnitude of ripples in the passbands and stopbands of windowed filters. For an ideal band-pass filter that has magnitude one in the pass band, the maximum (or minimum) amplitude in the passband of a windowed filter is one plus (or minus) the maximum amplitude error. Likewise, the maximum amplitude in the stopband of such a windowed filter equals the maximum amplitude error.

Kaiser windows are based on approximate relationships among the three design parameters. These approximations break down for passbands and stopbands that are narrow relative to the transition width. In such cases, the actual maximum error may exceed a specified maximum error for which a Kaiser window is designed by up to a factor of two.

When constructing a Kaiser window for a specified window length and transition width, the product of these two parameters cannot be less than one. When length*width is less than one, a useful upper bound for the maximum absolute error cannot be obtained from the Kaiser window design equations. However, in this case, the lower bound for maximum absolute error is nearly 10%, which is too large for most applications anyway. Therefore, in practice, this restriction seldom matters.

Version:
2005.08.04
Author:
Dave Hale, Colorado School of Mines

Method Summary
 double evaluate(double x)
          Returns the value of this Kaiser window function w(x) for specified x.
static KaiserWindow fromErrorAndLength(double error, double length)
          Returns a Kaiser window with specified error and window length.
static KaiserWindow fromErrorAndWidth(double error, double width)
          Returns a Kaiser window with specified error and transition width.
static KaiserWindow fromWidthAndLength(double width, double length)
          Returns a Kaiser window with specified transition width and window length.
 double getError()
          Gets the maximum absolute error.
 double getLength()
          Gets the two-sided window length.
 double getWidth()
          Gets the transition width.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

fromErrorAndWidth

public static KaiserWindow fromErrorAndWidth(double error,
                                             double width)
Returns a Kaiser window with specified error and transition width.

Parameters:
error - the maximum absolute error.
width - the transition width.
Returns:
the window.

fromErrorAndLength

public static KaiserWindow fromErrorAndLength(double error,
                                              double length)
Returns a Kaiser window with specified error and window length.

Parameters:
error - the maximum absolute error.
length - the two-sided window length.
Returns:
the window.

fromWidthAndLength

public static KaiserWindow fromWidthAndLength(double width,
                                              double length)
Returns a Kaiser window with specified transition width and window length. The product width*length cannot be less than one.

Parameters:
width - the transition width
length - the two-sided window length.
Returns:
the window.

evaluate

public double evaluate(double x)
Returns the value of this Kaiser window function w(x) for specified x.

Parameters:
x - the argument for which to evaluate w(x).
Returns:
the value w(x).

getError

public double getError()
Gets the maximum absolute error.

Returns:
the maximum absolute error.

getLength

public double getLength()
Gets the two-sided window length.

Returns:
the window length.

getWidth

public double getWidth()
Gets the transition width.

Returns:
the transition width.