Hi Group
This is a new estimator based on the magnitudes of three DFT bins.
The estimator is exact for a pure sinusoid without noise.
It performs well in the presence of noise.
Let j be the index of the DFT bin with the largest magnitude.
Let k=j-1 and i=j+1.
Now let
Ck = Cos(2*PI*k/N)
Cj = Cos(2*PI*j/N)
Ci = Cos(2*PI*i/N)
Then the Cosine of the normalised angular frequency can be estimated
as the root of the quadratic with the following coefficients:
A = (Ck-Ci)*Mag[j]^2 - (Cj-Ci)*Mag[k]^2 - (Ck-Cj)*Mag[i]^2
B = - 2*( Cj*(Ck-Ci)*Mag[j]^2 - Ck*(Cj-Ci)*Mag[k]^2 -
Ci*(Ck-Cj)*Mag[i]^2 )
C = Cj^2*(Ck-Ci)*Mag[j]^2 - Ck^2*(Cj-Ci)*Mag[k]^2 -
Ci^2*(Ck-Cj)*Mag[i]^2
where Mag[] is the magnitude of X[].
The roots are
Cw1 = (-B + Sqr(B^2-4*A*C))/(2*A)
and
Cw2 = (-B - Sqr(B^2-4*A*C))/(2*A)
The correct answer, Cw, is the root that places the frequency
between the two bins with the largest magnitudes.
The normalised frequency is then
Freq=(N/(2*PI))*Arccos(Cw)
Below is the result of a test run.
Regards,
Michael Plet
The sample count is 100
and the run size is 1000
The phase value is 0.785398
Errors are shown at 100x actual value
Target Noise Level = 0.000
Freq Plet's Fifth Estimator
---- -------------
3.0 -0.000 0.000
3.1 -0.000 0.000
3.2 -0.000 0.000
3.3 -0.000 0.000
3.4 -0.000 0.000
3.5 -0.000 0.000
3.6 0.000 0.000
3.7 0.000 0.000
3.8 -0.000 0.000
3.9 0.000 0.000
Target Noise Level = 0.001
Freq Plet's Fifth Estimator
---- -------------
3.0 -0.019 0.007
3.1 -0.000 0.010
3.2 -0.000 0.010
3.3 -0.001 0.010
3.4 -0.000 0.011
3.5 0.001 0.013
3.6 0.000 0.015
3.7 -0.000 0.012
3.8 0.000 0.011
3.9 -0.000 0.010
Target Noise Level = 0.010
Freq Plet's Fifth Estimator
---- -------------
3.0 -0.186 0.068
3.1 -0.002 0.094
3.2 0.001 0.095
3.3 -0.002 0.096
3.4 -0.003 0.108
3.5 0.004 0.132
3.6 -0.006 0.144
3.7 -0.006 0.122
3.8 -0.001 0.108
3.9 -0.007 0.102
Target Noise Level = 0.100
Freq Plet's Fifth Estimator
---- -------------
3.0 -0.023 1.954
3.1 -0.890 4.490
3.2 0.057 0.931
3.3 0.076 0.981
3.4 0.063 1.048
3.5 0.060 1.341
3.6 -0.072 1.496
3.7 -0.072 1.212
3.8 -0.029 1.112
3.9 0.357 3.452
Thank you to Cedron for letting me use his test program.