Package qa.generator.window
Class EndsWindow
java.lang.Object
qa.generator.window.HannWindow
qa.generator.window.EndsWindow
- All Implemented Interfaces:
SoundWindow
Window that only scales the ends of a waveform - suitable for calls such as whistles
where we want to leave most of it alone.
- Author:
- dg50
-
Constructor Summary
ConstructorsConstructorDescriptionEndsWindow
(double endSecs) The endLengh is in seconds since at constructor time of the window functions we might not know the sample rate. -
Method Summary
Modifier and TypeMethodDescriptionvoid
runWindow
(double[] wav, double soundSamples, double sampleRate, double sampleOffset) Window the waveform using a Hann window function.
-
Constructor Details
-
Method Details
-
runWindow
public void runWindow(double[] wav, double soundSamples, double sampleRate, double sampleOffset) Window the waveform using a Hann window function. If WindowLen > the length of wav, then only the ends of wav up to windowLen/2 from each end are windowed, the rest remaining flat. If windowLen > length of wav, then the window length is set to wav.length, i.e. the entire wave is windowed using a symetrical function.- Specified by:
runWindow
in interfaceSoundWindow
- Overrides:
runWindow
in classHannWindow
- Parameters:
wav
- wave to windowsoundSamples
- true number of samples in the sound - may be non integer.sampleOffset
- sample offsetwindowLen
- window length.
-