public class WhistleDetector extends PamProcess
Re-implementation of the IFAW 2003 whistle detector
Uses the PeakDetector and WhistleLinker to do the actual work
Constructor and Description |
---|
WhistleDetector(WhistleControl whistleControl) |
Modifier and Type | Method and Description |
---|---|
double |
binsToHz(int nFrequencyBins)
Convert a number of frequency bins in the spectrgram matrix to a
frequency in Hz.
|
double |
binsToSeconds(int nTimeBins)
Convert a number of time bins in the spectrgram matris to a
a time in seconds
|
void |
destroyProcess()
Called from the PamControlled unit when a PamControlled unit is removed from
the model.
|
FFTDataBlock |
getFftDataBlock() |
int |
getFftHop() |
int |
getFftLength() |
long |
getRequiredDataHistory(PamObservable o,
java.lang.Object arg) |
WhistleControl |
getWhistleControl() |
int |
hzToBins(double frequency) |
void |
newData(PamObservable obs,
PamDataUnit obj) |
void |
pamStart()
Called for each process to tell it to start (may not be necessary for
processes which are listening for data anyway).
|
void |
pamStop()
Stops the process.
|
void |
prepareProcess()
Called for each process before any of them receive the PamStart command
|
void |
setSampleRate(float sampleRate,
boolean notify)
New sample rate
|
absMillisecondsToSamples, absSamplesToMilliseconds, addOutputDataBlock, changedThreading, clearOldData, createAnnotations, fillXMLElement, flushDataBlockBuffers, getAncestorDataBlock, getAnnotation, getChainPosition, getCpuPercent, getNumAnnotations, getNumOutputDataBlocks, getObserverName, getObserverObject, getOfflineData, getOutputDataBlock, getOutputDataBlocks, getPamControlledUnit, getParentDataBlock, getParentProcess, getProcessName, getRawSourceDataBlock, getSampleRate, getSourceDataBlock, getSourceProcess, isCanMultiThread, makePamProcess, masterClockUpdate, noteNewSettings, notifyModelChanged, processNewBuoyData, relMillisecondsToSamples, relSamplesToMilliseconds, removeAllDataBlocks, removeObservable, removeOutputDatablock, resetDataBlocks, saveViewerData, setCanMultiThread, setParentDataBlock, setParentDataBlock, setProcessName, setupProcess, toString, update, updateData
public WhistleDetector(WhistleControl whistleControl)
whistleControl
- reference ot a WhistleControl PamControlledUnit pamguard plug-inpublic void destroyProcess()
PamProcess
destroyProcess
in class PamProcess
public void setSampleRate(float sampleRate, boolean notify)
PamObserver
setSampleRate
in interface PamObserver
setSampleRate
in class PamProcess
notify
- Notify other PamObservers and PamObservables in the chain.public void newData(PamObservable obs, PamDataUnit obj)
newData
in class PamProcess
public long getRequiredDataHistory(PamObservable o, java.lang.Object arg)
getRequiredDataHistory
in interface PamObserver
getRequiredDataHistory
in class PamProcess
o
- PamObservable class requiring the dataarg
- optional argument from PamObservablepublic void prepareProcess()
PamProcess
prepareProcess
in class PamProcess
public void pamStart()
PamProcess
pamStart
in class PamProcess
public void pamStop()
PamProcess
pamStop
in class PamProcess
public double binsToHz(int nFrequencyBins)
nFrequencyBins
- number of frequency binspublic int hzToBins(double frequency)
public double binsToSeconds(int nTimeBins)
nTimeBins
- number of time binspublic int getFftHop()
public int getFftLength()
public WhistleControl getWhistleControl()
public FFTDataBlock getFftDataBlock()