Class DelayGroup

java.lang.Object
Localiser.algorithms.DelayGroup

public class DelayGroup extends Object
Functions for attempting to efficiently prep data for correlation using a variety of pre-processing methods. Input initially complex spectrum data from waveform.
Author:
Doug Gillespie
  • Constructor Details

    • DelayGroup

      public DelayGroup()
  • Method Details

    • getDelays

      public TimeDelayData[] getDelays(double[][] waveformInput, float sampleRate, DelayMeasurementParams delayParams)
      Calculate time delays for a set of raw waveforms
      Parameters:
      waveformInput - - the raw waveforms between -1 and 1
      sampleRate - - the sample rate in samples per second
      delayParams - - delay measurement parameters.
      Returns:
      time delay class with time delays and errors in seconds.
    • getDelays

      public TimeDelayData[] getDelays(double[][] waveformInput, float sampleRate, DelayMeasurementParams delayParams, double[] maxDelays)
      Calculate time delays for a set of raw waveforms
      Parameters:
      waveformInput - - the raw waveforms between -1 and 1
      sampleRate - - the sample rate in samples per second
      delayParams - - delay measurement parameters.
      maxDelays - m- the maximum delay search range in samples. Can be used to restrict searches. Can be null
      Returns:
      time delay class with time delays and errors in seconds.
    • getComplexCorrelatorData

      public FFTDataArray[] getComplexCorrelatorData(double[][] waveformInput, float sampleRate, Complex[][] preallocData, DelayMeasurementParams delayParams)
      Get the complex data which will go into a cross correlation function, starting with a group of waveforms.
      Parameters:
      waveformInput - Waveform input.
      sampleRate - audio sample rate (Hz)
      preallocData - preallocated data - can be null and my not be used if the envelope method isn't used.
      delayParams - Parameters controlling filtering, envelope extraction, etc.
      Returns:
      Array of Complex spectra to go into the second stage of a cross correlation function. Will have same FFT length as input data, but will only be the first half - fftLength/2 long.
    • getComplexCorrelatorData

      public FFTDataArray getComplexCorrelatorData(double[] waveformInput, int fftLength, float sampleRate, Complex[] preallocData, DelayMeasurementParams delayParams)
      Get the complex data which will go into a cross correlation function, starting with a waveform.
      Parameters:
      waveformInput - Waveform input.
      sampleRate - audio sample rate (Hz)
      preallocData - preallocated data - can be null and my not be used if the envelope method isn't used.
      delayParams - Parameters controlling filtering, envelope extraction, etc.
      Returns:
      Complex spectrum to go into the second stage of a cross correlation function. Will have same FFT length as input data, but will only be the first half - fftLength/2 long.
    • getComplexCorrelatorData

      public FFTDataArray getComplexCorrelatorData(ComplexArray spectrogramInput, float sampleRate, int signalLength, int fftLength, Complex[] preallocData, DelayMeasurementParams delayParams)
      Get the complex data which will go into a cross correlation function, starting with a complex spectrum.

      This can be used to save a certain amount of processing time since it minimises the number of fft and ifft's that need doing to a particular waveform.

      Parameters:
      spectrogramInput - Complex spectrum data. Only need the first half, so it can be fftLength or fftLength/2 long.
      sampleRate - audio sample rate (Hz)
      signalLength - signal length (can be invalid input: '<' fftLength)
      fftLength - FFT length used to calculate the spectrum.
      preallocData - preallocated data - can be null and my not be used if the envelope method isn't used.
      delayParams - Parameters controlling filtering, envelope extraction, etc.
      Returns:
      Complex spectrum to go into the second stage of a cross correlation function. Will have same FFT length as input data, but will only be the first half - fftLength/2 long.
    • getCorrelations

      public Correlations getCorrelations()
      Returns:
      the correlations