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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
protected double
protected double
protected double
protected double
protected double[]
protected int
protected int
protected static final int
Fields inherited from class PamguardMVC.PamProcess
outputDataBlocks, parentDataBlock, processName, sampleRate
-
Constructor Summary
ConstructorsConstructorDescriptionPeakDetector
(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
-
Field Details
-
nrData
protected double[] nrData -
searchBin0
protected int searchBin0 -
searchBin1
protected int searchBin1 -
detectionThreshold
protected double detectionThreshold -
bgndUpdate0
protected double bgndUpdate0 -
bgndUpdate0_1
protected double bgndUpdate0_1 -
bgndUpdate1
protected double bgndUpdate1 -
bgndUpdate1_1
protected double bgndUpdate1_1 -
WARMUP_SLICES
protected static final int WARMUP_SLICES- See Also:
-
-
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:
sampleRate
-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
-