1
$\begingroup$

I am performing cross-correlation between two double[1024] arrays. I want to track the correlation's maximum with sub-sample accuracy, so I decided to implement parabolic fitting to my code. I used this class, that seems to work well.

To make this class work I have to feed it with the points I want it to apply to. My question is simple : what are the best points to feed it ? Should I give it the maximum of the cross-correlation and it's direct neighbours ? Should I space them more ? Should I NOT feed it the maximum of the cross-correlation ? Should I limite myself to 3 points, of give it as much as I can ?

Bonus question : if you think this class is not the most suitable and know a better way to implement parabolic fitting to my code, I am open to suggestions.

Thanks.

$\endgroup$

1 Answer 1

4
$\begingroup$

You can use the formulas presented in the answers to: How to calculate a delay (correlation peak) between two signals with a precision smaller than the sampling period?

To recap, find the largest value, called $\beta$. Take also the values of the samples just to the left of it, $\alpha$, and just to the right of it, $\gamma$. Then calculate the peak position $p$ of Lagrange parabolic interpolation by:

$$p = \frac{1}{2} \frac{\alpha - \gamma}{\alpha - 2\beta + \gamma}$$

If your signals are white you can get an unbiased estimate $d$ of the peak position from the biased estimate $p$ by:

$$d = \frac{\sqrt{32p^2 + 1} - 1}{8p}$$

These estimates give the peak position relative to the position of the sample with the highest value.

$\endgroup$
1
  • $\begingroup$ Thanks, I'm going to try this, and see if th results are better ! $\endgroup$
    – Trion
    Commented May 18, 2018 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.