Class SegmenterProcess
java.lang.Object
PamguardMVC.PamProcess
rawDeepLearningClassifier.segmenter.SegmenterProcess
- All Implemented Interfaces:
PamObserver,ProcessAnnotator
Acquires raw sound data and then sends off to a deep learning classifier.
- Author:
- Jamie Macaulay
-
Field Summary
Fields inherited from class PamguardMVC.PamProcess
outputDataBlocks, parentDataBlock, processName, sampleRate -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA list of data block class types which are compatible as parent data blocks for the PamProcess.Get the segmenter data block.voidmasterClockUpdate(long milliSeconds, long sampleNumber) voidnewClickData(PamDataUnit pamRawData) Process new click data.voidnewClipData(PamDataUnit pamRawData) Process new clip data.voidnewData(PamDataUnit pamRawData) voidnewData(PamObservable obs, PamDataUnit pamRawData) booleannewGroupData(PamDataUnit detection) A new detection data unit i.e.voidnewRawData(PamDataUnit unit, double[] rawDataChunk, int iChan) Take a raw sound chunk of data and segment into discrete groups.voidnewRawData(PamDataUnit unit, double[] rawDataChunk, int iChan, int rawSampleSize, int rawSampleHop, boolean forcesave) Take a raw sound chunk of data and segment into discrete groups.voidnewRawDataUnit(PamDataUnit pamRawData) A new raw data unit.voidpamStart()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 commandvoidsetFirstClockUpdate(long startTime) Set the first clock update which helps the segmenter work out where to start segmenting from.voidcalled for every process once the system model has been created.voidSet up the DL process.Methods inherited from class PamguardMVC.PamProcess
absMillisecondsToSamples, absSamplesToMilliseconds, addData, addMultiPlexDataBlock, addOutputDataBlock, changedThreading, clearOldData, createAnnotations, destroyProcess, dumpBufferStatus, flushDataBlockBuffers, getAncestorDataBlock, getAnnotation, getChainPosition, 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, noteNewSettings, notifyModelChanged, prepareProcessOK, processNewBuoyData, receiveSourceNotification, relMillisecondsToSamples, relSamplesToMilliseconds, removeAllDataBlocks, removeAllMultiPlexDataBlocks, removeMultiPlexDataBlock, removeObservable, removeOutputDatablock, resetDataBlocks, saveViewerData, setCanMultiThread, setExternalProcess, setMultiplex, setParentDataBlock, setParentDataBlock, setProcessCheck, setProcessName, setSampleRate, toString, updateData
-
Constructor Details
-
SegmenterProcess
-
-
Method Details
-
prepareProcess
public void prepareProcess()Description copied from class:PamProcessCalled for each process before any of them receive the PamStart command- Overrides:
prepareProcessin classPamProcess
-
getCompatibleDataUnits
A 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.
-
setupProcess
public void setupProcess()called for every process once the system model has been created. this is a good time to check out and find input data blocks and similar tasks.- Overrides:
setupProcessin classPamProcess
-
setupSegmenter
public void setupSegmenter()Set up the DL process. -
newData
- Overrides:
newDatain classPamProcess
-
newData
-
newGroupData
A new detection data unit i.e. this is only if we have detection data which is being grouped into segments.- Parameters:
detection- - the whistle data unit.
-
masterClockUpdate
public void masterClockUpdate(long milliSeconds, long sampleNumber) - Specified by:
masterClockUpdatein interfacePamObserver- Overrides:
masterClockUpdatein classPamProcess
-
newRawDataUnit
A new raw data unit.- Parameters:
pamRawData- - PAM raw data.obs- - the PAM observable
-
newClipData
Process new clip data.- Parameters:
pamRawData- - the new raw data unitobs- - the PAM observable
-
newClickData
Process new click data.- Parameters:
pamRawData-obs- - the PAM observable
-
newRawData
Take a raw sound chunk of data and segment into discrete groups. This handles many situations e.g. where the segment is much larger than the raw data or where the segment is much small than each rawDataChunk returning multiple segments.- Parameters:
unit- - the data unit which contains relevant metadata on time etc.rawDataChunk- - the sound chunk to segment extracted form the data unit.iChan- - the channel that is being segmented
-
newRawData
public void newRawData(PamDataUnit unit, double[] rawDataChunk, int iChan, int rawSampleSize, int rawSampleHop, boolean forcesave) Take a raw sound chunk of data and segment into discrete groups. This handles many situations e.g. where the segment is much larger than the raw data or where the segment is much small than each rawDataChunk returning multiple segments.- Parameters:
unit- - the data unit which contains relevant metadata on time etc.rawDataChunk- - the sound chunk extracted from the data unit.iChan- - the channel that is being segmentedrawSampleSize- - the segment size in samples i.e. the size of the segmenting window.rawSampleHop- - the segment hop in samples i.e. how far the window jumps for each segment.forceSave- - make sure that all data is passed into the buffers and do not wait for the next data unit. This is used to make sure that discrete chunks have their full number of segments saved.
-
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
-
pamStop
public void pamStop()Description copied from class:PamProcessStops the process.- Specified by:
pamStopin classPamProcess
-
getSegmenterDataBlock
Get the segmenter data block. This holds raw chunks of data to be sent to the deep learning classifier.- Returns:
- the segmenter data block.
-
getSegmenteGroupDataBlock
-
setFirstClockUpdate
public void setFirstClockUpdate(long startTime) Set the first clock update which helps the segmenter work out where to start segmenting from.- Parameters:
startTime- - the start time in millis.
-