Package clickDetector
Class ClickTemplate
java.lang.Object
clickDetector.ClickTemplate
Class for storing click templates.
Note that the average log spectrum must also be saved as this cannot be back calculated from the average spectrum (see ClickSpectrumTemplateEditDialog class for details)
- Author:
- Jamie Macaulay
-
Constructor Summary
ConstructorDescriptionClickTemplate
(ArrayList<Double> fft, ArrayList<Double> std, ArrayList<Double> fftLog, ArrayList<Double> stdLog, float samplerate, String species) ClickTemplate
(ArrayList<Double> fft, ArrayList<Double> std, ArrayList<Double> fftLog, ArrayList<Double> stdLog, float samplerate, String species, Color color) -
Method Summary
Modifier and TypeMethodDescriptionstatic ClickTemplate
getCSVResults
(String filename) Get a click template.int
getN()
float
void
void
setN
(int N) void
setSampleRate
(float sampleRate) void
setSpecies
(String species) void
setSpectrum
(double[] spectrum1D) void
setSpectrum
(ArrayList<Double> fft) void
setSpectrumLog
(double[] spectrum1D) void
setSpectrumLog
(ArrayList<Double> fftLog) void
setSpectrumStd
(double[] spectrum1D) void
setSpectrumStd
(ArrayList<Double> std) void
setSpectrumStdLog
(double[] spectrum1DLog) void
setSpectrumStdLog
(ArrayList<Double> stdLog) static void
writeClickTemptoFile
(ClickTemplate clickTemp, String outputFileForAnalysedResults) static void
writeClickTemptoFile
(ClickTemplate clickTemp, ArrayList<ArrayList<Double>> allFFT, String outputFileForAnalysedResults) Writes a .csv with mean fft and standard deviation of each fft bin.
-
Constructor Details
-
ClickTemplate
public ClickTemplate() -
ClickTemplate
-
ClickTemplate
-
-
Method Details
-
getN
public int getN() -
getSampleRate
public float getSampleRate() -
getSpecies
-
getSpectrum
-
getSpectrumLog
-
getSpectrumStd
-
getSpectrumStdLog
-
setN
public void setN(int N) -
setSampleRate
public void setSampleRate(float sampleRate) -
setSpecies
-
setSpectrum
-
setSpectrumLog
-
setSpectrum
public void setSpectrum(double[] spectrum1D) -
setSpectrumLog
public void setSpectrumLog(double[] spectrum1D) -
setSpectrumStd
-
setSpectrumStdLog
-
setSpectrumStd
public void setSpectrumStd(double[] spectrum1D) -
setSpectrumStdLog
public void setSpectrumStdLog(double[] spectrum1DLog) -
setColor
-
getColour
-
writeClickTemptoFile
public static void writeClickTemptoFile(ClickTemplate clickTemp, ArrayList<ArrayList<Double>> allFFT, String outputFileForAnalysedResults) Writes a .csv with mean fft and standard deviation of each fft bin. First line==mean fft, second line==standard deviation FFT,third line==mean 10*log(FFT), fourth line==standard deviation 10*log(FFT). All lines have the following format.
Format:
0=Samplerate.
1=Possible species.
2=Color1=red.
3=Color2=blue.
4=Color3=green.
5-N=fft result (usually 256 bins long).
- Parameters:
clickTemp
- - a click template.allFFT
- - an arraylist of fft's which made up the click spectrum.outputFileForAnalysedResults
- . File name for the output.csv file
-
writeClickTemptoFile
public static void writeClickTemptoFile(ClickTemplate clickTemp, String outputFileForAnalysedResults) -
getCSVResults
Get a click template. Format 0=Samplerate 1=Possible species 2=Color1=red 3=Color2=blue 4=Color3=green 5-N=fft results- Parameters:
filename
-- Returns:
- ClickTemplate from file
-