How can I perform normalised correlation using Arduino

Hello,
I would like to compare two signals using normalized correlation, I need help with the code to do this using arduino. This is how I would like to do it

  1. Generate and transmit a 40Khz signal through an object
  2. Receive the signal & compensate for the theoretically calculated losses
  3. compare the the received and compensated signal with the original generated signal.

I would like to assume that if the loses/ change in the received signal as equal to the calculated losses the normalized function will return a value very close to 1, else there loses are very different.

AdamMC:
Hello,
I would like to compare two signals using normalized correlation, I need help with the code to do this using arduino. This is how I would like to do it

  1. Generate and transmit a 40Khz signal through an object
  2. Receive the signal & compensate for the theoretically calculated losses
  3. compare the the received and compensated signal with the original generated signal.

I would like to assume that if the loses/ change in the received signal as equal to the calculated losses the normalized function will return a value very close to 1, else there loses are very different.

Have you made any attempt to write your own code?

Or did you expect someone to write the whole thing for you.

Why do this on an Arduino? It only involves calculation and would be much better suited for a PC - perhaps using MatLab.

Pete

Please describe the object, and the "40 kHz signal" that is to be sent through the object: amplitude, total time, etc.

ieee488:
Have you made any attempt to write your own code?

Or did you expect someone to write the whole thing for you.

I have written the other codes it's the normalized correlation code I need help with.

el_supremo:
Why do this on an Arduino? It only involves calculation and would be much better suited for a PC - perhaps using MatLab.

Pete

Am trying to build a device that is based on some already done experiments.

jremington:
Please describe the object, and the "40 kHz signal" that is to be sent through the object: amplitude, total time, etc.

A pulsed square signal, 5V, 4uS

And how many samples are you expecting to store - ie how much RAM might you need (given the Uno
has only 2k, Mega 8k, this might force using one of the more powerful Arduinos).

Do you need real-time performance?

A pulsed square signal, 5V, 4uS

4 microseconds period = frequency 250 kHz.