Package clickDetector
Class ClickDetector
java.lang.Object
PamguardMVC.PamProcess
clickDetector.ClickDetector
- All Implemented Interfaces:
 PamObserver,ProcessAnnotator
Main click detector process.
 
Observes a raw data block, filters and thresholds the data to create Click objects
- Author:
 - Doug Gillespie
 - See Also:
 
- 
Nested Class Summary
Nested Classes - 
Field Summary
FieldsFields inherited from class PamguardMVC.PamProcess
outputDataBlocks, parentDataBlock, processName, sampleRate - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidIf the multi-threading has been changed, make sure to call setupProcess to take that into accountbooleancompleteClick(ClickDetection newClick) Once a click is detected, does everything else to it such as calculate bearing, check species, send to click train detector, etc.voidvoidCalled from the PamControlled unit when a PamControlled unit is removed from the model.findChannelGroupDetector(int channelBitmap) booleanflushDataBlockBuffers(long maxWait) Work through all the output datablocks and wait for their internal buffers to flush through.Gte the aquisition process associated with the click detector.getChannelGroupDetector(int i) Get the click classifier annotation time.longA list of data block class types which are compatible as parent data blocks for the PamProcess.getDelayMeasurementParams(ClickDetection pamDetection) Get appropriate delay measurement parameters depending on the click type.double[]getFFTFilter(FFTFilterParams fftFilterParams) Get an FFT filter, mainly used to generate filtered waveforms within click detections.double[]Get the range of frequencies over which the data in this process are likely to be present.Get information about the internal bearing localiser.intlonglonglongvoidmasterClockUpdate(long timeMilliseconds, long sampleNumber) double[]measureDelays(ClickDetection click) Measure time delays between raw waveforms within a single click detection (multiple channels within) a single group.voidnewData(PamObservable obs, PamDataUnit newData) voidvoidvoidpamStart()Called for each process to tell it to start (may not be necessary for processes which are listening for data anyway).voidpamStop()Stops the process.voidCalled for each process before any of them receive the PamStart commandvoidprocessNewBuoyData(BuoyStatusDataUnit buoyStatus, PamDataUnit dataUnit) voidsecondTimer(long sampleNumber) voidsetSampleRate(float sampleRate, boolean notify) New sample ratevoidsetTargetMotionLocaliser(TargetMotionLocaliser<GroupDetection> targetMotionLocaliser) voidcalled for every process once the systemmodel has been created.booleanwantClick(ClickDetection click, ClickIdInformation idInfo) Return true if the click should be processed and stored.Methods inherited from class PamguardMVC.PamProcess
absMillisecondsToSamples, absSamplesToMilliseconds, addData, addMultiPlexDataBlock, addOutputDataBlock, clearOldData, createAnnotations, dumpBufferStatus, getAncestorDataBlock, getAnnotation, getChainPosition, getCpuPercent, getLastSourceNotificationObject, getLastSourceNotificationType, getMuiltiplexDataBlock, getNumAnnotations, getNumMuiltiplexDataBlocks, getNumOutputDataBlocks, getObserverName, getObserverObject, getOfflineData, getOfflineData, getOutputDataBlock, getOutputDataBlocks, getPamControlledUnit, getParentDataBlock, getParentDataBlocks, getParentProcess, getProcessCheck, getProcessName, getRawSourceDataBlock, getRawSourceDataBlock, getSampleRate, getSourceDataBlock, getSourceProcess, hasOutputDatablock, isCanMultiThread, isExternalProcess, isMultiplex, makePamProcess, noteNewSettings, notifyModelChanged, prepareProcessOK, receiveSourceNotification, relMillisecondsToSamples, relSamplesToMilliseconds, removeAllDataBlocks, removeAllMultiPlexDataBlocks, removeMultiPlexDataBlock, removeObservable, removeOutputDatablock, resetDataBlocks, saveViewerData, setCanMultiThread, setExternalProcess, setMultiplex, setParentDataBlock, setParentDataBlock, setProcessCheck, setProcessName, toString, updateData 
- 
Field Details
- 
fastFFT
 - 
cepstrumFFT
 
 - 
 - 
Constructor Details
- 
ClickDetector
 
 - 
 - 
Method Details
- 
setSampleRate
public void setSampleRate(float sampleRate, boolean notify) Description copied from interface:PamObserverNew sample rate- Specified by:
 setSampleRatein interfacePamObserver- Overrides:
 setSampleRatein classPamProcess- Parameters:
 sampleRate-notify- Notify other PamObservers and PamObservables in the chain.
 - 
setupProcess
public void setupProcess()Description copied from class:PamProcesscalled for every process once the systemmodel has been created. this is a good time to check out and find input data blocks and similar tasks.- Overrides:
 setupProcessin classPamProcess
 - 
getFrequencyRange
public double[] getFrequencyRange()Description copied from class:PamProcessGet the range of frequencies over which the data in this process are likely to be present. Note that this is pretty crude and may not reflect the true range, for example, the click detector will return the limits of it's trigger filter, and there are plenty of sounds outside of that range which may have most of their energy well outside of the trigger range of the detector.- Overrides:
 getFrequencyRangein classPamProcess- Returns:
 - Nominal frequency range for data in this block.
 
 - 
getDurationRange
public double[] getDurationRange()- Returns:
 - the duration of clicks that can potentially be detected
 
 - 
createFilters
public void createFilters() - 
newParameters
public void newParameters() - 
getClickDataBlock
- Returns:
 - The main output click data block.
 
 - 
getOfflineEventDataBlock
- Returns:
 - the offlineEventDataBlock
 
 - 
getRequiredDataHistory
- Specified by:
 getRequiredDataHistoryin interfacePamObserver- Overrides:
 getRequiredDataHistoryin classPamProcess- Parameters:
 arg- optional argument from PamObservable- Returns:
 - time in milliseconds required by data held in PamObservable
 
 - 
secondTimer
public void secondTimer(long sampleNumber)  - 
newData
- Overrides:
 newDatain classPamProcess
 - 
masterClockUpdate
public void masterClockUpdate(long timeMilliseconds, long sampleNumber) - Specified by:
 masterClockUpdatein interfacePamObserver- Overrides:
 masterClockUpdatein classPamProcess
 - 
prepareProcess
public void prepareProcess()Description copied from class:PamProcessCalled for each process before any of them receive the PamStart command- Overrides:
 prepareProcessin classPamProcess
 - 
pamStart
public void pamStart()Description copied from class:PamProcessCalled for each process to tell it to start (may not be necessary for processes which are listening for data anyway).- Specified by:
 pamStartin classPamProcess
 - 
processNewBuoyData
- Overrides:
 processNewBuoyDatain classPamProcess
 - 
pamStop
public void pamStop()Description copied from class:PamProcessStops the process.- Specified by:
 pamStopin classPamProcess
 - 
getStartTimeMillis
public long getStartTimeMillis() - 
getClickControl
 - 
getSamplesProcessed
public long getSamplesProcessed() - 
getClickCount
public long getClickCount() - 
getTriggerDataBlock
 - 
getOutputClickData
 - 
getDelayMeasurementParams
Get appropriate delay measurement parameters depending on the click type. 31/11/2016 MO: originally this method was passed a PamDetection which was immediately cast to a Click Detection. All classes calling this method passed a ClickDetection anyway, and since we've now removed the PamDetection class I've just changed the parameter to ClickDetection and commented out the cast.- Parameters:
 pamDetection-- Returns:
 - appropriate click delay measurement parameters.
 
 - 
completeClick
Once a click is detected, does everything else to it such as calculate bearing, check species, send to click train detector, etc.- Returns:
 - true if the tasks complete successfully and the click is to be kept. false otherwise.
 
 - 
measureDelays
Measure time delays between raw waveforms within a single click detection (multiple channels within) a single group.- Parameters:
 click- - the click detection- Returns:
 - a list of time delays between all channels in seconds.
 
 - 
flushDataBlockBuffers
public boolean flushDataBlockBuffers(long maxWait) Description copied from class:PamProcessWork through all the output datablocks and wait for their internal buffers to flush through.This is used when stopping PAMGUARD to ensure that all data complete processing before anything else happens.
- Overrides:
 flushDataBlockBuffersin classPamProcess- Parameters:
 maxWait- maxWait time in milliseconds.- Returns:
 - true if successful, or false if there was a timeout.
 
 - 
wantClick
Return true if the click should be processed and stored.If there is no online classification, we want everything If there is classification, but we've not told it to discard, etc
- Parameters:
 click-idInfo-- Returns:
 
 - 
getFilteredDataBlocks
 - 
getTriggerFunctionDataBlock
 - 
getTrackedClicks
 - 
getHilbert
 - 
notifyArrayChanged
public void notifyArrayChanged() - 
findChannelGroupDetector
 - 
getClickBinaryDataSource
- Returns:
 - the clickBinaryDataSource
 
 - 
getFFTFilter
Get an FFT filter, mainly used to generate filtered waveforms within click detections.- Parameters:
 fftFilterParams-- Returns:
 - FFT filter object.
 
 - 
getnChannelGroups
public int getnChannelGroups()- Returns:
 - the nChannelGroups
 
 - 
getChannelGroupDetector
 - 
getOfflineEventLogging
- Returns:
 - the offlineEventLogging
 
 - 
setTargetMotionLocaliser
 - 
getCompatibleDataUnits
Description copied from class:PamProcessA list of data block class types which are compatible as parent data blocks for the PamProcess. This can return null, e.g. in the case of Acquisition process.- Overrides:
 getCompatibleDataUnitsin classPamProcess- Returns:
 - a list of PamDataBlock sub class types which can be used as parent data blocks for the process.
 
 - 
getClickAnnotationType
Get the click classifier annotation time. This annotates clicks with an array showing what classifiers were passed rather than just the first classifier to pass in the click type flag.- Returns:
 - the click classifier annotation type.
 
 - 
changedThreading
public void changedThreading()If the multi-threading has been changed, make sure to call setupProcess to take that into account- Overrides:
 changedThreadingin classPamProcess
 - 
getAquisitionProcess
Gte the aquisition process associated with the click detector.- Returns:
 - the Aquisition process.
 
 - 
destroyProcess
public void destroyProcess()Description copied from class:PamProcessCalled 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:
 destroyProcessin classPamProcess
 - 
getLocaliserInfo
Get information about the internal bearing localiser. Will have to do just for the first sub detector.- Returns:
 
 
 -