public class ClickDetection extends PamDetection<PamDetection,PamDetection>
Modifier and Type | Field and Description |
---|---|
static int |
CLICK_CLICK |
static int |
CLICK_FLAG_ECHO |
static int |
CLICK_NOISEWAVE |
AMPLITUDE_SCALE_DBREMPA, AMPLITUDE_SCALE_LINREFSD
Constructor and Description |
---|
ClickDetection(ClickDetector clickDetector) |
ClickDetection(int channelBitmap,
long startSample,
long duration,
ClickDetector clickDetector,
ClickDetector.ChannelGroupDetector channelGroupDetector,
int triggerList) |
Modifier and Type | Method and Description |
---|---|
void |
addSuperDetection(PamDetection superDetection) |
double[] |
applyHanningWindow(double[] data)
apply a Hanning window to the passed dataset.
|
boolean |
calculateAmplitude(int channel)
Calculate the peak waveform amplitude
making the correction of rotating teh wave so it's two ends
are at zero.
|
double |
clickLength(double percent)
Calculates the length of a click in seconds averaged over all channels
|
double |
clickLength(int channel,
double percent)
Calculates the length of a click in seconds for a particular channel
|
void |
freeClickMemory()
Free up as much click memory as possible.
|
double |
getAmplitude(int channel) |
double[] |
getAnalyticWaveform(int iChan)
Get the analytic waveform for a given channel
|
double[] |
getAnalyticWaveform(int iChan,
boolean filtered,
FFTFilterParams fftFilterParams)
Get filtered or unfiltered analytic waveform.
|
double |
getAngle()
Returns the angle in degrees for compatibilty with older version of click detector
|
double[] |
getCepstrum(int channel,
int cepLength)
Calculate the cepstrum for a click channel.
|
ClickDetector.ChannelGroupDetector |
getChannelGroupDetector() |
ClickDetector |
getClickDetector() |
int |
getClickFlags() |
ClickLocalisation |
getClickLocalisation() |
byte |
getClickType() |
static Complex[] |
getComplexSpectrum(double[] rawData,
int fftLength)
Returns the complex spectrum for waveform using a set FFT length
|
Complex[] |
getComplexSpectrum(int channel)
Returns the complex spectrum for a given channel using the shortest
possible FFT length
|
Complex[] |
getComplexSpectrum(int channel,
int fftLength)
Returns the complex spectrum for a given channel using a set FFT length
|
Complex[] |
getComplexSpectrumHann(int channel,
int fftLength)
Returns the complex spectrum for a given channel using a set FFT length as
getComplexSpectrum, but applies a Hanning window to the raw data first
|
byte[][] |
getCompressedWaveData()
Get compressed waveform data in int8 format, scaled
so that the maximum range >-127 to +127 is utilised.
|
int |
getCurrentSpectrumLength() |
byte |
getDataType() |
double[] |
getDelays()
return a list of delays.
|
AbstractDetectionMatch |
getDetectionMatch() |
AbstractDetectionMatch |
getDetectionMatch(int type) |
int |
getEventId() |
double[][] |
getFilteredAnalyticWaveform(FFTFilterParams fftFilterParams)
Get the analytic waveform for all channels
if filter params = null, then return normal analytic waveform
|
double[] |
getFilteredAnalyticWaveform(FFTFilterParams fftFilterParams,
int iChan)
Get a filtered version of the analytic waveform.
|
double[][] |
getFilteredWaveData(FFTFilterParams filterParams)
Get filtered waveform data for all channels.
|
double[] |
getFilteredWaveData(FFTFilterParams filterParams,
int channelIndex)
Get filtered waveform data for a single channel.
|
double |
getICI() |
double[] |
getMagnitude(int channel,
int fftLength,
boolean hann)
Returns the magnitude of the complex spectrum for a given channel.
|
double |
getMeanAmplitude() |
double |
getMeanFrequency(double[] searchRange) |
int |
getNChan() |
int |
getOfflineEventID() |
double[] |
getPowerSpectrum(int channel)
Get the power spectrum of the entire click.
|
double[] |
getPowerSpectrum(int channel,
int fftLength)
Returns the power spectrum for a given channel (square of magnitude of
complex spectrum)
|
double[] |
getRotationCorrection(int channel)
GEt a correction based on the slope of the waveform which
can be used to remove large DC / LF offsets in the waveform.
|
int |
getShortestFFTLength() |
double |
getTempICI() |
double[] |
getTotalPowerSpectrum(int fftLength)
Returns the sum of the power spectra for all channels
|
double |
getWaveAmplitude() |
double[][] |
getWaveData() |
double[][] |
getWaveData(boolean filtered,
FFTFilterParams fftFilterParams)
convenience method to get filtered or unfiltered data for a single channel.
|
double[] |
getWaveData(int channelIndex)
Get raw waveform data for a given click channel index.
|
double[] |
getWaveData(int channelIndex,
boolean filtered,
FFTFilterParams fftFilterParams)
convenience method to get filtered or unfiltered data for a single channel.
|
ZeroCrossingStats[] |
getZeroCrossingStats() |
boolean |
hasComplexSpectrum()
Find out whether there are complex
spectrum data - and if there are, data may
get cleaned up.
|
double |
inBandEnergy(double[] freqs)
Calculates the total energy within a particular frequency band
|
boolean |
isEcho() |
boolean |
isTracked() |
double |
peakFrequency(double[] searchRange) |
double |
peakFrequencyWidth(double peakFrequency,
double percent) |
double[] |
peakFrequencyWidth(double peakFrequency,
int dBDrop) |
double[] |
peakFrequencyWidthChan(double peakFrequency,
int dBDrop,
int channel,
boolean hann)
Returns the frequency width of a drop in dBDrop decibels to either side of the peak frequency.
|
void |
removeSuperDetection(PamDetection superDetection) |
void |
setAmplitude(int channel,
double amplitude)
Set the amplitude for a given channel
|
void |
setChannelBitmap(int channelBitmap) |
void |
setClickDetector(ClickDetector clickDetector) |
void |
setClickFlags(int clickFlags) |
void |
setClickLocalisation(ClickLocalisation clickLocalisation) |
void |
setClickType(byte clickType) |
void |
setComplexSpectrum() |
void |
setCompressedData(byte[][] compressedWaveData,
double waveAmplitude)
Set the compressed wave data (used when reading back from file).
|
void |
setDataType(byte dataType) |
void |
setDelay(int iDelay,
double delay)
Set the time of arrival delay in samples.
|
void |
setEcho(boolean isEcho) |
void |
setEventId(int eventId) |
void |
setICI(double iCI) |
void |
setOfflineEventID(int offlineEventID) |
void |
setTempICI(double tempICI) |
void |
setTracked(boolean tracked) |
void |
setWaveData(double[][] waveData) |
void |
setZeroCrossingStats(ZeroCrossingStats[] zcs) |
addSubDetection, findSubDetection, getDetectionType, getEventEndTime, getPeakTime, getSubDetection, getSubDetectionsCount, getSubDetectionSyncronisation, getSuperDetection, getSuperDetection, getSuperDetectionsCount, getSuperDetectionSyncronisation, removeSubDetection, replaceSubDetection, setDetectionType, setEventEndTime, setPeakTime, setUniqueSuperDetection
amplifyMeasuredAmplitudeByDB, amplifyMeasuredAmplitudeByLinear, compareTo, getAmplitudeDB, getCalculatedAmlitudeDB, getDuration, getFrequency, getFrequencyOverlap, getLastSample, getMeasuredAmplitude, getMeasuredAmplitudeType, getSeconds, getStartSample, getSummaryString, getTimeOverlap, setCalculatedAmlitudeDB, setDuration, setFrequency, setInfo, setMeasuredAmplitude, setMeasuredAmplitude, setMeasuredAmplitudeType, setStartSample
addDataAnnotation, clearOandAngles, clearUpdateCount, findDataAnnotation, getAbsBlockIndex, getChannelBitmap, getDataAnnotation, getDatabaseIndex, getDatabaseUpdateOf, getDataUnitFileInformation, getHydrophoneHeading, getLastUpdateTime, getLocalisation, getNumDataAnnotations, getOriginLatLong, getPairAngle, getParentDataBlock, getTimeMilliseconds, getUpdateCount, removeDataAnnotation, removeDataAnnotation, setAbsBlockIndex, setDatabaseIndex, setDatabaseUpdateOf, setDataUnitFileInformation, setLastUpdateTime, setLocalisation, setOriginLatLong, setParentDataBlock, setTimeMilliseconds, updateDataUnit
public static final int CLICK_CLICK
public static final int CLICK_NOISEWAVE
public static final int CLICK_FLAG_ECHO
public ClickDetection(int channelBitmap, long startSample, long duration, ClickDetector clickDetector, ClickDetector.ChannelGroupDetector channelGroupDetector, int triggerList)
public ClickDetection(ClickDetector clickDetector)
public int getShortestFFTLength()
public boolean isTracked()
public void setTracked(boolean tracked)
public int getEventId()
public void setEventId(int eventId)
public boolean isEcho()
public void setEcho(boolean isEcho)
isEcho
- set the click echo flag.public Complex[] getComplexSpectrum(int channel)
channel
- public void setComplexSpectrum()
public Complex[] getComplexSpectrum(int channel, int fftLength)
channel
- fftLength
- public Complex[] getComplexSpectrumHann(int channel, int fftLength)
channel
- fftLength
- public static Complex[] getComplexSpectrum(double[] rawData, int fftLength)
waveData
- public boolean hasComplexSpectrum()
public int getCurrentSpectrumLength()
public double[] getPowerSpectrum(int channel)
channel
- channel numberpublic double[] getCepstrum(int channel, int cepLength)
channel
- cannelcepLength
- length of cepstrum. If this is 0, then the Cepstrum
will be the next binary int up from the click length.public double[] getPowerSpectrum(int channel, int fftLength)
channel
- channel numberfftLength
- public double[] getMagnitude(int channel, int fftLength, boolean hann)
channel
- fftLength
- hann
- TRUE=apply hanning window; FALSE=do not apply hanning windowpublic double[] getTotalPowerSpectrum(int fftLength)
fftLength
- public double[] getAnalyticWaveform(int iChan)
iChan
- channel indexpublic double[] getAnalyticWaveform(int iChan, boolean filtered, FFTFilterParams fftFilterParams)
iChan
- channel numberfiltered
- true if you want data to be filteredfftFilterParams
- fft filter parameters.public double[] getFilteredAnalyticWaveform(FFTFilterParams fftFilterParams, int iChan)
fftFilterParams
- FFT filter parameters.iChan
- channel numberpublic double[][] getFilteredAnalyticWaveform(FFTFilterParams fftFilterParams)
fftFilterParams
- public double inBandEnergy(double[] freqs)
freqs
- BasicClickIdentifier
public double clickLength(double percent)
percent
- Fraction of total click energy to use in the calculationBasicClickIdentifier
public double clickLength(int channel, double percent)
channel
- percent
- Fraction of total click energy to use in the calculationBasicClickIdentifier
public double peakFrequency(double[] searchRange)
public double peakFrequencyWidth(double peakFrequency, double percent)
public double[] peakFrequencyWidth(double peakFrequency, int dBDrop)
public double[] peakFrequencyWidthChan(double peakFrequency, int dBDrop, int channel, boolean hann)
peakFrequency
- The peak frequency in HzdBDrop
- The drop in magnitude (in dB) to either side of the peak frequencychannel
- The channel to run the calculations onhann
- TRUE=apply hanning window, FALSE=do not apply hanning windowpublic double getMeanFrequency(double[] searchRange)
public double[] getFilteredWaveData(FFTFilterParams filterParams, int channelIndex)
Data are filtered in the frequency domain using an FFT / Inverse FFT.
filterParams
- filter parameterschannelIndex
- channel indexpublic double[][] getFilteredWaveData(FFTFilterParams filterParams)
Data are filtered in the frequency domain using an FFT / Inverse FFT.
filterParams
- filter parameterspublic double[][] getWaveData(boolean filtered, FFTFilterParams fftFilterParams)
filtered
- flag saying you want it filteredfftFilterParams
- filter parameters.public double[] getWaveData(int channelIndex, boolean filtered, FFTFilterParams fftFilterParams)
channelIndex
- channel indexfiltered
- flag saying you want it filteredfftFilterParams
- filter parameters.public double[] getWaveData(int channelIndex)
channelIndex
- channel indexpublic double[][] getWaveData()
public void setWaveData(double[][] waveData)
public byte[][] getCompressedWaveData()
public void setCompressedData(byte[][] compressedWaveData, double waveAmplitude)
compressedWaveData
- waveAmplitude
- public double getWaveAmplitude()
public void freeClickMemory()
Ensures that waveform data are retained in a compressed (int8) format so that all other data can be reconstructed if necessary.
public void setDelay(int iDelay, double delay)
delay
- delay in samplespublic double[] getDelays()
public boolean calculateAmplitude(int channel)
channel
- public double[] getRotationCorrection(int channel)
channel
- public void setAmplitude(int channel, double amplitude)
channel
- channel numberamplitude
- amplitudepublic double getAmplitude(int channel)
public double getAngle()
public double getMeanAmplitude()
public ClickLocalisation getClickLocalisation()
public void setClickLocalisation(ClickLocalisation clickLocalisation)
public AbstractDetectionMatch getDetectionMatch(int type)
getDetectionMatch
in class PamDataUnit
public AbstractDetectionMatch getDetectionMatch()
getDetectionMatch
in class PamDataUnit
public int getNChan()
public void setChannelBitmap(int channelBitmap)
setChannelBitmap
in class PamDataUnit
public void setClickType(byte clickType)
clickType
- the clickType (click species) to setpublic byte getClickType()
public byte getDataType()
public void setDataType(byte dataType)
dataType
- the type of data - click, noise, etc.public void setClickDetector(ClickDetector clickDetector)
clickDetector
- the clickDetector to setpublic ClickDetector getClickDetector()
public double getICI()
public void setICI(double iCI)
iCI
- the iCI to setpublic void addSuperDetection(PamDetection superDetection)
addSuperDetection
in class PamDetection<PamDetection,PamDetection>
public void removeSuperDetection(PamDetection superDetection)
removeSuperDetection
in class PamDetection<PamDetection,PamDetection>
public ClickDetector.ChannelGroupDetector getChannelGroupDetector()
public void setClickFlags(int clickFlags)
clickFlags
- the clickFlags to setpublic int getClickFlags()
public void setTempICI(double tempICI)
tempICI
- the tempICI to setpublic double getTempICI()
public ZeroCrossingStats[] getZeroCrossingStats()
public void setZeroCrossingStats(ZeroCrossingStats[] zcs)
zcs
- save the ZeroCrossingStats array (array size=number of channels)public double[] applyHanningWindow(double[] data)
data
- a double arraypublic int getOfflineEventID()
public void setOfflineEventID(int offlineEventID)
offlineEventID
- the offlineEventID to set