Package Spectrogram
Class SpectrumBackground
java.lang.Object
Spectrogram.SpectrumBackground
Simple background measure for a channel of complex or real FFT data
Uses a dead simple decaying mean measurement
- Author:
- dg50
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble[]
Get a copy of the current background.int
int
getnDone()
boolean
prepareS
(double timeConstSecs) Prepare the background measurement, passing a time constant in secondsdouble[]
process
(FFTDataUnit fftDataUnit) Add a FFT data unit (assume already of the right channel)double[]
process
(ComplexArray fftData) Add an array of complex FFT data (assume already of the right channel)
-
Constructor Details
-
SpectrumBackground
- Parameters:
parentFFTBlock
-iChannel
-
-
-
Method Details
-
prepareS
public boolean prepareS(double timeConstSecs) Prepare the background measurement, passing a time constant in seconds- Parameters:
timeConstSecs
- time constant in seconds- Returns:
- true if OK
-
process
Add a FFT data unit (assume already of the right channel)- Parameters:
fftData
- FFT Complex Data must be of length fftlength / 2- Returns:
- current background measure
-
process
Add an array of complex FFT data (assume already of the right channel)- Parameters:
fftData
- FFT Complex Data must be of length fftlength / 2- Returns:
- current background measure
-
copyBackground
public double[] copyBackground()Get a copy of the current background. This is often preferable to calling getBackground() since that other function returns a copy to an array which is constantly being updated. So if you're going to manipulate data in that array, then a) it may be out of date by the time you use it and b) you'll mess up the internal background measurement- Returns:
- array of background measures (magnitude squared, no corrections for FFT length, neg frequencies, etc.)
-
getParentFFTBlock
- Returns:
- the parentFFTBlock
-
getiChannel
public int getiChannel()- Returns:
- the iChannel
-
getnDone
public int getnDone()- Returns:
- the nDone
-