Package whistleDetector
Class PeakDetector
java.lang.Object
PamguardMVC.PamProcess
whistleDetector.PeakDetector
- All Implemented Interfaces:
PamObserver
,ProcessAnnotator
- Direct Known Subclasses:
BasicPeakDetector
- Author:
- Doug Gillespie Detects whistle peaks from FFT data
-
Constructor Summary
ConstructorDescriptionPeakDetector
(WhistleControl whistleControl, WhistleDetector whistleDetector, FFTDataBlock fftDataSource, int groupChannels) -
Method Summary
Modifier and TypeMethodDescriptionint
double[]
int
abstract String
void
newData
(PamObservable obs, PamDataUnit newUnit) 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
Called for each process before any of them receive the PamStart commandvoid
searchForPeaks
(PamObservable obs, FFTDataUnit newDataUnit) void
setGroupChannels
(int groupChannels) void
setSampleRate
(float sampleRate, boolean notify) New sample rateMethods inherited from class PamguardMVC.PamProcess
absMillisecondsToSamples, absSamplesToMilliseconds, addData, addMultiPlexDataBlock, addOutputDataBlock, changedThreading, clearOldData, createAnnotations, destroyProcess, dumpBufferStatus, flushDataBlockBuffers, getAncestorDataBlock, getAnnotation, getChainPosition, getCompatibleDataUnits, getCpuPercent, getFrequencyRange, getLastSourceNotificationObject, getLastSourceNotificationType, getMuiltiplexDataBlock, getNumAnnotations, getNumMuiltiplexDataBlocks, getNumOutputDataBlocks, getObserverName, getObserverObject, getOfflineData, getOfflineData, getOutputDataBlock, getOutputDataBlocks, getPamControlledUnit, getParentDataBlock, getParentDataBlocks, getParentProcess, getProcessCheck, getProcessName, getRawSourceDataBlock, getRawSourceDataBlock, getRequiredDataHistory, getSampleRate, getSourceDataBlock, getSourceProcess, hasOutputDatablock, isCanMultiThread, isExternalProcess, isMultiplex, makePamProcess, masterClockUpdate, noteNewSettings, notifyModelChanged, prepareProcessOK, processNewBuoyData, receiveSourceNotification, relMillisecondsToSamples, relSamplesToMilliseconds, removeAllDataBlocks, removeAllMultiPlexDataBlocks, removeMultiPlexDataBlock, removeObservable, removeOutputDatablock, resetDataBlocks, saveViewerData, setCanMultiThread, setExternalProcess, setMultiplex, setParentDataBlock, setParentDataBlock, setProcessCheck, setProcessName, setupProcess, toString, updateData
-
Constructor Details
-
PeakDetector
public PeakDetector(WhistleControl whistleControl, WhistleDetector whistleDetector, FFTDataBlock fftDataSource, int groupChannels)
-
-
Method Details
-
prepareProcess
public void prepareProcess()Description copied from class:PamProcess
Called for each process before any of them receive the PamStart command- Overrides:
prepareProcess
in classPamProcess
-
setSampleRate
public void setSampleRate(float sampleRate, boolean notify) Description copied from interface:PamObserver
New sample rate- Specified by:
setSampleRate
in interfacePamObserver
- Overrides:
setSampleRate
in classPamProcess
- Parameters:
notify
- Notify other PamObservers and PamObservables in the chain.
-
newData
- Overrides:
newData
in classPamProcess
-
searchForPeaks
- Parameters:
obs
- PamObservable - always a PamDataBlocknewDataUnit
- The latest PamDataUnit added to the PamDataBlock Takes a new block of FFT data and creates a series of peaks based on parts of the sectrum being above some threshold. Rather than add individual peaks to the output data block, the peaks are stored in a new ArrayList and the array list is added to the output block. This reduces the amount of traffic to the output blocks listeners and will make it easier for the process linking the peaks to navigate between successive peak slices.
-
getEqualisationConstants
public double[] getEqualisationConstants() -
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 classPamProcess
-
pamStop
public void pamStop()Description copied from class:PamProcess
Stops the process.- Specified by:
pamStop
in classPamProcess
-
getPeakDataBlock
-
getGroupChannels
public int getGroupChannels() -
setGroupChannels
public void setGroupChannels(int groupChannels) -
getDetectionChannel
public int getDetectionChannel() -
getPeakDetectorName
-