Class FFTDataOrganiser

java.lang.Object
fftManager.fftorganiser.FFTDataOrganiser
Direct Known Subclasses:
ClickFFTOrganiser, ClipFFTOrganiser, WSLFFTDataOrganiser

public class FFTDataOrganiser extends Object
Functions to create blocks of FFT data for multiple channels as needed by various localisation algorithms in PAMGuard (e.g. BearingLocaliser and Group3DLocaliser). These localisers can take data from multiple sources:
FFT Data from an FFTDataBlock
RAW Data from a PAMRawDataBlock
FFT Data from within a data unit (e.g. click spectrum)
RAW Data from within a data unit (e.g. a click waveform) In all cases, FFT data will either be taken or converted from the raw data into a list of FFT units for the requested channels and returned in a FFTDataList object with a bit of additional diagnostic information such as numbers of FFT's per channel, etc. Creates a block of FFT Data. These will be returned as an arraylist
Author:
Doug Gillespie
  • Field Details

  • Constructor Details

  • Method Details

    • getFftObservable

      public FFTDataOrganiser.FFTObservable getFftObservable()
      Returns:
      the fftObservable
    • setInput

      public boolean setInput(PamDataBlock rawOrFFTData, FFTInputTypes preferredInputType)
    • canProcess

      public boolean canProcess(PamDataBlock sourceInputBlock, FFTInputTypes inputType)
      Determine whether or not a particular data block type can be processed in the selected way
      Parameters:
      sourceInputBlock - source data block
      inputType - input type
      Returns:
      true if this is gonna work
    • suggestInputType

      public FFTInputTypes suggestInputType(PamDataBlock sourceInputBlock)
      Get the most suitable input type for a data block. internal FFT data preferred, then internal raw, then external FFT, finally external raw.
      Parameters:
      sourceInputBlock - source input data
      Returns:
      most suitable input type
    • createFFTDataList

      public FFTDataList createFFTDataList(PamDataUnit pamDataUnit, double sampleRate, int channelMap) throws FFTDataException
      Create a list of FFT Data units using the preferred input type.

      Note that some overridden versions of this function may chose to change the sample rate of the data (e.g. click detector upsampling) so the sample rate in the returned FFTDataList may not be the same as the sampleRate parameter fed to the function.

      Parameters:
      pamDataUnit - data unit we need FFT data for (can be anything, just needs it's times)
      sampleRate - sample rate of the data in PamDataUnit
      channelMap - channel map we want data for
      Returns:
      Collated and interleaved list of FFT data units
      Throws:
      FFTDataException
      See Also:
    • getFFTDataUnits

      public List<FFTDataUnit> getFFTDataUnits(FFTDataHolder fftDataHolder, Integer fftLength)
      Separated out function to get the list of FFT data units from the FFT holder so that individual modules can easily override this and add additional information (such as bin ranges) to the FFT data.
      Parameters:
      fftDataHolder - FFT Data holder
      fftLength - FFT length
      Returns:
      list of FFT data units for all channels in the fftDataholder
    • getFftLength

      public Integer getFftLength()
      Returns:
      the fftLength
    • setFftLength

      public void setFftLength(Integer fftLength)
      Parameters:
      fftLength - the fftLength to set
    • getFftHop

      public Integer getFftHop()
      Returns:
      the fftHop
    • setFftHop

      public void setFftHop(Integer fftHop)
      Parameters:
      fftHop - the fftHop to set
    • getOnlyAllowedDataBlock

      public PamDataBlock<?> getOnlyAllowedDataBlock()
      Use only if this FFT organiser is being used with a very specific data source, such as the click detector, where we 100% know that the data will be coming from that detector.
      Returns:
      the onlyAllowedDataBlock
    • setOnlyAllowedDataBlock

      public void setOnlyAllowedDataBlock(PamDataBlock<?> onlyAllowedDataBlock)
      Use only if this FFT organiser is being used with a very specific data source, such as the click detector, where we 100% know that the data will be coming from that detector.
      Parameters:
      onlyAllowedDataBlock - the onlyAllowedDataBlock to set
    • getDataKeepMillis

      public long getDataKeepMillis()
      Get how long the input data to this need to be help in memory for (e.g. a few seconds for whistles, perhaps a lot longer for things marked on the spectrogram ?
      Returns:
      the dataKeepMillis
    • setDataKeepMillis

      public void setDataKeepMillis(long dataKeepMillis)
      Set how long the input data to this need to be help in memory for (e.g. a few seconds for whistles, perhaps a lot longer for things marked on the spectrogram ?
      Parameters:
      dataKeepMillis - the dataKeepMillis to set