Localiser
Class Correlations
java.lang.Object
Localiser.Correlations
public class Correlations
- extends java.lang.Object
- Author:
- Doug Gillespie
Various functions to do wtih cross correlating two or more signals
As with the FastFFT class, these functions are no longer static so
that Allocation of FFT internal storage is done separately for each detector. This
avoids it having to be continually reallocated if fft's of different lenghts are taken.
Also calculates a delay correction factor based on a parabolic interpolation around the
maximum value. For compatibility with previous versions, the returned results is still
the integer solution. If you require greater accuracy, you should get the interpolated
correction and add this to the main integer result for double precision accuracy.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fastFFT
FastFFT fastFFT
interpolatedCorrection
private double interpolatedCorrection
Correlations
public Correlations()
getDelay
public double getDelay(double[] s1,
double[] s2,
int fftLength)
getDelay
public double getDelay(Complex[] f1,
Complex[] f2,
int fftLength)
getInterpolatedCorrection
public double getInterpolatedCorrection()
defaultTimingError
public static double defaultTimingError(float sampleRate)
- Generate a default timing error which is 1/sqrt(12) times
the sample interval
- Parameters:
sampleRate - sample rate
- Returns:
- typical timing error
parabolicCorrection
public static double parabolicCorrection(double y1,
double y2,
double y3)
- Calculate a parabolic fit correction based on three bin heights
- Parameters:
y1 - first biny2 - second biny3 - third bin
- Returns:
- correction = 0.5*(y3-y1)/(2*y2-y1-y3);