Class WhistleDetector

java.lang.Object
PamguardMVC.PamProcess
whistleDetector.WhistleDetector
All Implemented Interfaces:
PamObserver, ProcessAnnotator

public class WhistleDetector extends PamProcess
Author:
Doug Gillespie

Re-implementation of the IFAW 2003 whistle detector

Uses the PeakDetector and WhistleLinker to do the actual work

  • Constructor Details

    • WhistleDetector

      public WhistleDetector(WhistleControl whistleControl)
      Parameters:
      whistleControl - reference ot a WhistleControl PamControlledUnit pamguard plug-in
  • Method Details

    • destroyProcess

      public void destroyProcess()
      Description copied from class: PamProcess
      Called from the PamControlled unit when a PamControlled unit is removed from the model. Offers an opportunity to disconnect individual processed from the rest of the model. May be necessary to override to clean up some processes.
      Overrides:
      destroyProcess in class PamProcess
    • setSampleRate

      public void setSampleRate(float sampleRate, boolean notify)
      Description copied from interface: PamObserver
      New sample rate
      Specified by:
      setSampleRate in interface PamObserver
      Overrides:
      setSampleRate in class PamProcess
      Parameters:
      notify - Notify other PamObservers and PamObservables in the chain.
    • newData

      public void newData(PamObservable obs, PamDataUnit obj)
      Overrides:
      newData in class PamProcess
    • getRequiredDataHistory

      public long getRequiredDataHistory(PamObservable o, Object arg)
      Specified by:
      getRequiredDataHistory in interface PamObserver
      Overrides:
      getRequiredDataHistory in class PamProcess
      Parameters:
      arg - optional argument from PamObservable
      Returns:
      time in milliseconds required by data held in PamObservable
    • prepareProcess

      public void prepareProcess()
      Description copied from class: PamProcess
      Called for each process before any of them receive the PamStart command
      Overrides:
      prepareProcess in class PamProcess
    • pamStart

      public void pamStart()
      Description copied from class: PamProcess
      Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway).
      Specified by:
      pamStart in class PamProcess
    • pamStop

      public void pamStop()
      Description copied from class: PamProcess
      Stops the process.
      Specified by:
      pamStop in class PamProcess
    • binsToHz

      public double binsToHz(int nFrequencyBins)
      Convert a number of frequency bins in the spectrgram matrix to a frequency in Hz.
      Parameters:
      nFrequencyBins - number of frequency bins
      Returns:
      frequency in Hz
    • hzToBins

      public int hzToBins(double frequency)
    • binsToSeconds

      public double binsToSeconds(int nTimeBins)
      Convert a number of time bins in the spectrgram matris to a a time in seconds
      Parameters:
      nTimeBins - number of time bins
      Returns:
      time in seconds
    • getFftHop

      public int getFftHop()
    • getFftLength

      public int getFftLength()
    • getWhistleControl

      public WhistleControl getWhistleControl()
    • getFftDataBlock

      public FFTDataBlock getFftDataBlock()