Package Spectrogram

Class SpectrumBackground

java.lang.Object
Spectrogram.SpectrumBackground

public class SpectrumBackground extends Object
Simple background measure for a channel of complex or real FFT data Uses a dead simple decaying mean measurement
Author:
dg50
  • Constructor Details

    • SpectrumBackground

      public SpectrumBackground(FFTDataBlock parentFFTBlock, int iChannel)
      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

      public double[] process(FFTDataUnit fftDataUnit)
      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

      public double[] process(ComplexArray fftData)
      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

      public FFTDataBlock getParentFFTBlock()
      Returns:
      the parentFFTBlock
    • getiChannel

      public int getiChannel()
      Returns:
      the iChannel
    • getnDone

      public int getnDone()
      Returns:
      the nDone