[email protected] wrote:
> Hi,
>
> we are not using the matlab functions , we have to write code in
> embedded C only that why iam asking you. and we have to do calculation
> in that why if you have information regarding this please provide me .
> waiting for your reply.
>
>
> Thanks®ards,
> Devika.
To help get the feel for how correlation works, you might want to set up
an experiment in a spreadsheet. For example:
- Set up two pairs column, where each pair represents a sine of a
certain frequency and phase. The first column of each pair is the phase
angle; the second is the cosine of the first.
- Add a cell at the top of each phase column that allows you to
parameterize the change in phase per cell.
- Make another column that's the product of the two cosine columns and
total up the product column using the "sum" function.
- Experiment with different initial phases and delta-phases
(frequencies) and see how the sum changes.
You can expand this to cover the case of a complex signal (that is, a
cosine/sine pair) by adding in a sine column for each signal and
calculating the product according to the rules of complex numbers.
Also, be sure to conjugate the second one by negating its sine column.
Once you master all that, you're well on your way to writing your own
correlation routines in C. Basically, correlation boils down to
multiplying corresponding data points from two signals and summing the
result. You can implement it by translating the formulas in textbooks
directly into code - or a spreadsheet.
=g2
__________________________________________________ ___________________
Grant R. Griffin
Publisher of dspGuru
http://www.dspguru.com
Iowegian International Corporation
http://www.iowegian.com
See
http://www.iowegian.com/img/contact.gif for e-mail address