Split from: Applying Cross Correlation

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, I have a problem with correlation. I need to read from ADC and after that calculate corr between ADCs.

I don't know how make a matrix of ADC!!! 

 

Thanks alot

 

* The question is asked here so the answer (if any) goes here also. Moderator. *

nj

Last Edited: Mon. Jan 29, 2018 - 06:07 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you really need a matrix :

 

To make thinks simple, suppose you have "only" two ADC.

You need to accumulate:

a) The -scalar- count of -almost- simultaneous measures

b) the - array of two floats- sum of thes measures in the 2 channels

c) the sum of squares -array of floats- of thes measures

d) the sum  -array of floats, in there are more than 2 channels- of the cross products

 

Nota (c) and (d) are often merged ....

 

and, once there are enough samples,  compute correlations explicitely.

This is the way correlation was computed 60 years ago on big files, with very little RAM... and keeps on being computed (package hugeR)

 

Another way is to send the channels to a PC, via a serial line (python can cope easily with it, on the Pc side),  which has everything '(I will dare to quote ... c, fortran, R, Python, octave/matlab and let other people fret about spreadshts: there atr hundredths  of ways, exponentiating confusion )  to compute correlation. (would be interesting to comapre).

 

Edited : you should at least test values on a PC (with known solution series, say sin(x/n) on simuated channel 1, cos(x/n) on simulated channel 2) ; ideal would be to write in C -easier to port than Fortran, matlab...-

 

You would be given better answers if you told :

do you want  real time computation?

do you accept having sampling stopped (math. can be slow on an avr; displaying is slow, too)?

is it school work or hobbyists one?

What have you already done?

 

Last Edited: Mon. Jan 29, 2018 - 09:20 AM