Package clipgenerator
Class ClipSpectrogram
java.lang.Object
clipgenerator.ClipSpectrogram
- Direct Known Subclasses:
ClickSpectrogram
Creates and stores a spectrogram image for a wave file snippet. Usually used with small
snippets of wave data rather than continious raw data.
- Author:
- Jamie Macaulay
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
calcSpectrogram
(double[][] waveData, int fftLength, int fftHop, int windowType) Calculate the click spectrum for all channels.int
Get the FFT hope in samples.int
Get the FFT size in samples.ArrayList<double[][]>
Get the spectrogramdouble[][]
getSpectrogram
(int ichan) Get the spectrogram for a given channelint
Get the last used window type.specTransform
(double[] waveChunk) Apply a transforms to the raw data to convert from time to frequency/phase domain.
-
Field Details
-
fastFFT
A fast fourier transform class.
-
-
Constructor Details
-
ClipSpectrogram
-
-
Method Details
-
getSpectrogram
Get the spectrogram- Returns:
- the spectrogram for each channel
-
getSpectrogram
public double[][] getSpectrogram(int ichan) Get the spectrogram for a given channel- Parameters:
iChan
- - the relative channel number.- Returns:
- the spectrogram for each channel
-
getFFTHop
public int getFFTHop()Get the FFT hope in samples.- Returns:
- the FFT hop.
-
getFFTSize
public int getFFTSize()Get the FFT size in samples.- Returns:
- the FFT size
-
calcSpectrogram
public void calcSpectrogram(double[][] waveData, int fftLength, int fftHop, int windowType) Calculate the click spectrum for all channels.- Parameters:
waveData
- - the raw data for each channel
-
specTransform
Apply a transforms to the raw data to convert from time to frequency/phase domain.- Parameters:
wavChunk
- - the raw windowed chunk of data (i.e. after hanning window has been applied)len
- - the len of the transform e.g. FFT length- Returns:
- the ComplexArray with transformed data.
-
getWindowType
public int getWindowType()Get the last used window type.- Returns:
- the window type @see WindowFunction.getWindowFunc(windowType, fftLength);
-