Class EndsWindow

java.lang.Object
qa.generator.window.HannWindow
qa.generator.window.EndsWindow
All Implemented Interfaces:
SoundWindow

public class EndsWindow extends HannWindow
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

    Constructors
    Constructor
    Description
    EndsWindow(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 Type
    Method
    Description
    void
    runWindow(double[] wav, double soundSamples, double sampleRate, double sampleOffset)
    Window the waveform using a Hann window function.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EndsWindow

      public EndsWindow(double endSecs)
      The endLengh is in seconds since at constructor time of the window functions we might not know the sample rate. This will get added when the window actually runs.
      Parameters:
      endSecs -
  • 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 interface SoundWindow
      Overrides:
      runWindow in class HannWindow
      Parameters:
      wav - wave to window
      soundSamples - true number of samples in the sound - may be non integer.
      sampleOffset - sample offset
      windowLen - window length.