regarding correlation and cross-correlation

Started by March 4, 2008
```Hi,
this is devika , i want some  clear information regarding the
correlation and cross-correlation .
if there are two sine waves  how can we see taht they are
correlated and cross-correlated .
please give some examples with there wave forms  examples   and give
some information regarding how to calculate the correlation and cross-
correlation as per  equations(software view)
waiting for u r reply ,

thanks&regards,
Devikareddy.
```
```devikapatnam@gmail.com wrote:
> Hi,
>  this is devika , i want some  clear information regarding the
> correlation and cross-correlation .
>     if there are two sine waves  how can we see taht they are
> correlated and cross-correlated .
> please give some examples with there wave forms  examples   and give
> some information regarding how to calculate the correlation and cross-
> correlation as per  equations(software view)
>  waiting for u r reply ,
>
>  thanks&regards,
>  Devikareddy.

May I suggest starting at http://en.wikipedia.org/wiki/Cross-correlation

```
```On Mar 4, 6:42 pm, Richard Owlett <rowl...@atlascomm.net> wrote:
> devikapat...@gmail.com wrote:
> > Hi,
> >  this is devika , i want some  clear information regarding the
> > correlation and cross-correlation .
> >     if there are two sine waves  how can we see taht they are
> > correlated and cross-correlated .
> > please give some examples with there wave forms  examples   and give
> > some information regarding how to calculate the correlation and cross-
> > correlation as per  equations(software view)
> >  waiting for u r reply ,
>
> >  thanks&regards,
> >  Devikareddy.
>
> May I suggest starting athttp://en.wikipedia.org/wiki/Cross-correlation

hi devika,
try out hands at matlab functions of xcorr and
remember you try to see the xcorr code by typing  edit xcorr  in the
command window and you can come to know about it.

particle (filter) reddy
```
```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 .

Thanks&regards,
Devika.

On Mar 4, 9:22&#4294967295;pm, "PARTICLEREDDY (STRAYDOG)"
<particlere...@gmail.com> wrote:
> On Mar 4, 6:42 pm, Richard Owlett <rowl...@atlascomm.net> wrote:
>
>
>
>
>
> > devikapat...@gmail.com wrote:
> > > Hi,
> > > &#4294967295;this is devika , i want some &#4294967295;clear information regarding the
> > > correlation and cross-correlation .
> > > &#4294967295; &#4294967295; if there are two sine waves &#4294967295;how can we see taht they are
> > > correlated and cross-correlated .
> > > please give some examples with there wave forms &#4294967295;examples &#4294967295; and give
> > > some information regarding how to calculate the correlation and cross-
> > > correlation as per &#4294967295;equations(software view)
> > > &#4294967295;waiting for u r reply ,
>
> > > &#4294967295;thanks&regards,
> > > &#4294967295;Devikareddy.
>
> > May I suggest starting athttp://en.wikipedia.org/wiki/Cross-correlation
>
> hi devika,
> &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; &#4294967295; try out hands at matlab functions of xcorr and
> remember you try to see the xcorr code by typing &#4294967295;edit xcorr &#4294967295;in the
> command window and you can come to know about it.
>
> particle (filter) reddy- Hide quoted text -
>
> - Show quoted text -

```
```devikapatnam@gmail.com 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 .
>
>
> Thanks&regards,
> 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
```
```Hello Devika,

The equation for autocorrelation and cross-correlation are
very simple and mentioned at many websites and standard DSP
textbooks (buy DSP book by proakis and manolakis,
one of the best book written in the subject of DSP).

The equation is also very easy to implement.
You just need to run a for-loop. In embedded application
not sure if for-loop is better or their are more efficient ways.
This you may check with local embedded C expert.

In case if you do not have access to Matlab, you can
use Octave or Scilab (both these softwares are free and both
and installable from their websites www.octave.org and
www.scilab.org. I am big time fan of Octave (Million Thanks to
John W Eaton and his team) and do not use Matlab at all. Matlab
license cost is 3 lakh Rupees in India
(basic matlab + signal processing toolbox + image processing
toolbox). Also I have build up my own DSP function library
in octave to make it superior to Matlab for signal processing
applications.

You may write your efficient code in embedded C but to test it
you can use functions available in scilab and octave. My suggestion
is use Octave as it is more matlab compatible and easy to use. The
code can be ported vice-versa without extra effort.

Regards
Bharat Pathak

Arithos Designs
www.Arithos.com

```