clickDetector
Class OldClickClass

java.lang.Object
  extended by clickDetector.OldClickClass

public class OldClickClass
extends java.lang.Object

Author:
Doug Gillespie Click objects created by a click detector.

Contains a snap shot of wave data representing the click (this may or may not have been filtered). Also contains the basic data included in clicks created by RainbowClick

See Also:
ClickDetector

Field Summary
private  double[] amplitude
           
(package private)  int channelList
           
(package private)  ClickDetector clickDetector
           
(package private)  long clickNumber
           
(package private)  byte clickType
           
private  Complex[][] complexSpectrum
           
private  int currentSpectrumLength
           
(package private)  byte dataType
           
private  double dBamplitude
           
private  int delay
           
(package private)  int duration
           
(package private)  int eventId
           
(package private)  long filePos
           
(package private)  int flags
           
(package private)  double ICI
           
(package private)  int nChan
           
private  double[][] powerSpectra
           
(package private)  long startSample
           
private  double[] totalPowerSpectrum
           
(package private)  boolean tracked
           
(package private)  int triggerList
           
private  double[][] waveData
           
 
Constructor Summary
OldClickClass(ClickDetector clickDetector, long startSample, int nChan, long duration, int channelList, int triggerList)
           
 
Method Summary
 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()
           
 double getAmplitude(int channel)
           
 double getAngle(float sampleRate)
          Gets the angle to a click from the time delay on two hydrophones based on sound speed.
 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
 int getCurrentSpectrumLength()
           
 double getDBamplitude()
           
 int getDelay()
           
 int getEventId()
           
 double getMeanAmplitude()
           
 int getNChan()
           
 double[] getPowerSpectrum(int channel, int fftLength)
          Returns the power spectum for a given channel (square of magnitude of complex spectrum)
private  int getSpikeWidth(double[] data, int peakPos, double percent)
          Calculates the width of a peak - either time or frequency data
 double[] getTotalPowerSpectrum(int fftLength)
          Returns the sum of the power spectra for all channels
 double[][] getWaveData()
           
 double[] getWaveData(int channel)
           
 double inBandEnergy(double[] freqs)
          Calculates the total energy within a particular frequency band
 boolean isTracked()
           
 double peakFrequency(double[] searchRange)
           
 double peakFrequencyWidth(double peakFrequency, double percent)
           
 void setAmplitude(int channel, double amplitude)
           
 void setDBamplitude(double bamplitude)
           
 void setDelay(int delay)
           
 void setEventId(int eventId)
           
 void setTracked(boolean tracked)
           
 void setWaveData(double[][] waveData)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clickNumber

long clickNumber

startSample

long startSample

duration

int duration

nChan

int nChan

channelList

int channelList

triggerList

int triggerList

waveData

private double[][] waveData

delay

private int delay

tracked

boolean tracked

amplitude

private double[] amplitude

dBamplitude

private double dBamplitude

flags

int flags

dataType

byte dataType

filePos

long filePos

clickType

byte clickType

clickDetector

ClickDetector clickDetector

eventId

int eventId

ICI

double ICI

powerSpectra

private double[][] powerSpectra

totalPowerSpectrum

private double[] totalPowerSpectrum

complexSpectrum

private Complex[][] complexSpectrum

currentSpectrumLength

private int currentSpectrumLength
Constructor Detail

OldClickClass

public OldClickClass(ClickDetector clickDetector,
                     long startSample,
                     int nChan,
                     long duration,
                     int channelList,
                     int triggerList)
Method Detail

isTracked

public boolean isTracked()

setTracked

public void setTracked(boolean tracked)

getEventId

public int getEventId()

setEventId

public void setEventId(int eventId)

getAngle

public double getAngle(float sampleRate)
Gets the angle to a click from the time delay on two hydrophones based on sound speed.

Parameters:
sampleRate -
Returns:
The angle to the click (ahead = 0 degrees)

getComplexSpectrum

public Complex[] getComplexSpectrum(int channel)
Returns the complex spectrum for a given channel using the shortest possible FFT length

Parameters:
channel -
Returns:
The complex spectrum

getComplexSpectrum

public Complex[] getComplexSpectrum(int channel,
                                    int fftLength)
Returns the complex spectrum for a given channel using a set FFT length

Parameters:
channel -
fftLength -
Returns:
the complex spectrum

getCurrentSpectrumLength

public int getCurrentSpectrumLength()

getPowerSpectrum

public double[] getPowerSpectrum(int channel,
                                 int fftLength)
Returns the power spectum for a given channel (square of magnitude of complex spectrum)

Parameters:
channel -
fftLength -
Returns:
Power spectrum

getTotalPowerSpectrum

public double[] getTotalPowerSpectrum(int fftLength)
Returns the sum of the power spectra for all channels

Parameters:
fftLength -
Returns:
Sum of power spectra

inBandEnergy

public double inBandEnergy(double[] freqs)
Calculates the total energy within a particular frequency band

Parameters:
freqs -
Returns:
In Band Energy
See Also:
BasicClickIdentifier

clickLength

public double clickLength(double percent)
Calculates the length of a click in seconds averaged over all channels

Parameters:
percent - Fraction of total click energy to use in the calculation
Returns:
click length in seconds
See Also:
BasicClickIdentifier

clickLength

public double clickLength(int channel,
                          double percent)
Calculates the length of a click in seconds for a particular channel

Parameters:
channel -
percent - Fraction of total click energy to use in the calculation
Returns:
Click Length (seconds)
See Also:
BasicClickIdentifier

getSpikeWidth

private int getSpikeWidth(double[] data,
                          int peakPos,
                          double percent)
Calculates the width of a peak - either time or frequency data

Parameters:
data -
peakPos -
percent -
Returns:
Width of spike in whatever bins are used for raw data given

peakFrequency

public double peakFrequency(double[] searchRange)

peakFrequencyWidth

public double peakFrequencyWidth(double peakFrequency,
                                 double percent)

getAmplitude

public double getAmplitude(int channel)

setAmplitude

public void setAmplitude(int channel,
                         double amplitude)

getWaveData

public double[] getWaveData(int channel)

getWaveData

public double[][] getWaveData()

setWaveData

public void setWaveData(double[][] waveData)

freeClickMemory

public void freeClickMemory()

getMeanAmplitude

public double getMeanAmplitude()

getDBamplitude

public double getDBamplitude()
Returns:
Returns the dBamplitude.

setDBamplitude

public void setDBamplitude(double bamplitude)
Parameters:
bamplitude - The dBamplitude to set.

getDelay

public int getDelay()
Returns:
Returns the delay.

setDelay

public void setDelay(int delay)
Parameters:
delay - The delay to set.

getNChan

public int getNChan()