whistleDetector
Class PeakDetector

java.lang.Object
  extended by PamguardMVC.PamProcess
      extended by whistleDetector.PeakDetector
All Implemented Interfaces:
Annotator, PamObserver
Direct Known Subclasses:
BasicPeakDetector

public abstract class PeakDetector
extends PamProcess

Author:
Doug Gillespie Detects whistle peaks from FFT data

Nested Class Summary
(package private) static class PeakDetector.PeakStatus
           
 
Field Summary
protected  double bgndUpdate0
           
protected  double bgndUpdate0_1
           
protected  double bgndUpdate1
           
protected  double bgndUpdate1_1
           
private  int detectionChannel
           
protected  double detectionThreshold
           
(package private)  FFTDataBlock fftDataSource
           
(package private)  double[] freqGrad
           
private  int groupChannels
           
protected  double[] nrData
           
(package private)  boolean[] overThreshold
           
(package private)  PamDataBlock<PeakDataUnit> peakDataBlock
           
protected  int searchBin0
           
protected  int searchBin1
           
(package private)  int slicesAnalysed
           
(package private)  double[] spectrumAverage
           
protected static int WARMUP_SLICES
           
(package private)  WhistleControl whistleControl
           
(package private)  WhistleDetector whistleDetector
           
 
Fields inherited from class PamguardMVC.PamProcess
outputDataBlocks, processName, sampleRate
 
Constructor Summary
PeakDetector(WhistleControl whistleControl, WhistleDetector whistleDetector, FFTDataBlock fftDataSource, int groupChannels)
           
 
Method Summary
 int getDetectionChannel()
           
 double[] getEqualisationConstants()
           
 int getGroupChannels()
           
 PamDataBlock<PeakDataUnit> getPeakDataBlock()
           
abstract  java.lang.String getPeakDetectorName()
           
 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 prepareProcess()
          Called for each process before any of them receive the PamStart command
 void searchForPeaks(PamObservable obs, FFTDataUnit newDataUnit)
           
 void setGroupChannels(int groupChannels)
           
 void setSampleRate(float sampleRate, boolean notify)
          New sample rate
 
Methods inherited from class PamguardMVC.PamProcess
absMillisecondsToSamples, absSamplesToMilliseconds, addOutputDataBlock, changedThreading, clearOldData, createAnnotations, destroyProcess, fillXMLElement, fillXMLParameters, getAncestorDataBlock, getAnnotation, getBackendProcess, getChainPosition, getCpuPercent, getNumAnnotations, getNumOutputDataBlocks, getObserverName, getObserverObject, getOfflineData, getOutputDataBlock, getPamControlledUnit, getParentDataBlock, getParentProcess, getProcessName, getRawSourceDataBlock, getRequiredDataHistory, getSampleRate, getSourceDataBlock, getSourceProcess, isCanMultiThread, makePamProcess, masterClockUpdate, noteNewSettings, notifyModelChanged, relMillisecondsToSamples, relSamplesToMilliseconds, removeObservable, removeOutputDatablock, saveViewerData, setBackendProcess, setCanMultiThread, setParentDataBlock, setParentDataBlock, setProcessName, setupProcess, toString, update, updateData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

spectrumAverage

double[] spectrumAverage

overThreshold

boolean[] overThreshold

nrData

protected double[] nrData

freqGrad

double[] freqGrad

searchBin0

protected int searchBin0

searchBin1

protected int searchBin1

whistleDetector

WhistleDetector whistleDetector

fftDataSource

FFTDataBlock fftDataSource

peakDataBlock

PamDataBlock<PeakDataUnit> peakDataBlock

whistleControl

WhistleControl whistleControl

groupChannels

private int groupChannels

detectionChannel

private int detectionChannel

slicesAnalysed

int slicesAnalysed

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:
Constant Field Values
Constructor Detail

PeakDetector

public PeakDetector(WhistleControl whistleControl,
                    WhistleDetector whistleDetector,
                    FFTDataBlock fftDataSource,
                    int groupChannels)
Method Detail

prepareProcess

public void prepareProcess()
Description copied from class: PamProcess
Called for each process before any of them receive the PamStart command

Overrides:
prepareProcess in class PamProcess

setSampleRate

public void setSampleRate(float sampleRate,
                          boolean notify)
Description copied from interface: PamObserver
New sample rate

Specified by:
setSampleRate in interface PamObserver
Overrides:
setSampleRate in class PamProcess
notify - Notify other PamObservers and PamObservables in the chain.

newData

public void newData(PamObservable obs,
                    PamDataUnit newUnit)
Overrides:
newData in class PamProcess

searchForPeaks

public void searchForPeaks(PamObservable obs,
                           FFTDataUnit newDataUnit)
Parameters:
obs - PamObservable - always a PamDataBlock
newDataUnit - 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 class PamProcess

pamStop

public void pamStop()
Description copied from class: PamProcess
Stops the process.

Specified by:
pamStop in class PamProcess

getPeakDataBlock

public PamDataBlock<PeakDataUnit> getPeakDataBlock()

getGroupChannels

public int getGroupChannels()

setGroupChannels

public void setGroupChannels(int groupChannels)

getDetectionChannel

public int getDetectionChannel()

getPeakDetectorName

public abstract java.lang.String getPeakDetectorName()