Package Spectrogram
Class WindowFunction
java.lang.Object
Spectrogram.WindowFunction
Window function for use with FFT.
- Author:
- Douglas Gillespie
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double[]
bartlett
(int length) static double[]
blackman
(int length) static double[]
blackmanharris
(int length) static String[]
getNames()
static double[]
getWindowFunc
(int windowType, int length) static double
getWindowGain
(double[] windowFunction) Calculate the gain of the window functionstatic double[]
hamming
(int length) static double[]
hann
(int length) static double[]
rectangular
(int length) static double[]
tukey
(int length, double a) also known as tapered-cosine, for a=0 becomes rectangular and a=1 becomes hann
-
Field Details
-
RECTANGULAR
public static final int RECTANGULAR- See Also:
-
HAMMING
public static final int HAMMING- See Also:
-
HANNING
public static final int HANNING- See Also:
-
BARTLETT
public static final int BARTLETT- See Also:
-
BLACKMAN
public static final int BLACKMAN- See Also:
-
BLACKMANHARRIS
public static final int BLACKMANHARRIS- See Also:
-
NWINDOWS
public static final int NWINDOWS- See Also:
-
-
Constructor Details
-
WindowFunction
public WindowFunction()
-
-
Method Details
-
getNames
-
getWindowFunc
public static double[] getWindowFunc(int windowType, int length) -
hamming
public static double[] hamming(int length) -
hann
public static double[] hann(int length) -
rectangular
public static double[] rectangular(int length) -
bartlett
public static double[] bartlett(int length) -
blackman
public static double[] blackman(int length) -
blackmanharris
public static double[] blackmanharris(int length) -
tukey
public static double[] tukey(int length, double a) also known as tapered-cosine, for a=0 becomes rectangular and a=1 becomes hann- Parameters:
length
-- Returns:
-
getWindowGain
public static double getWindowGain(double[] windowFunction) Calculate the gain of the window function- Parameters:
windowFunction
- window function array- Returns:
- window rms gain as a factor (NOT dB);
-