Amplitude calculation from cross correlation data

Started by AMARTANSH 7 years ago4 replieslatest reply 7 years ago614 views

Hey all,

I have this code for cross correlation between two signals shifted by 90 degree and having some attenuation: 


 t = [0:1/fs:0.001];

 A = 2;

 f =5000;

 y = 5*sin(2*pi*f*t);

 y1 = 3.5*sin(2*pi*f*(t)-(pi/2));

x = xcorr(y,y1,'none');

tx = [-(length(y)-1):length(y1)-1]*(1/(fs));




 % Determine the lag

 [mx,ix] = max(x);

 lag = tx(ix);

Given the first signal (amplitude 5V) and the cross correlation data between first and second signal, I want to calculate the amplitude of my second signal. How can I do this?

Thanks in advance!

[ - ]
Reply by kazFebruary 20, 2017

Sounds like asking if I filter (x) with (h), if I know (x) and the output (y). Can I know (h)??? not sure but looks like sets of simultaneous equations scenario.


[ - ]
Reply by charansaiFebruary 20, 2017

Hey Amartansh,

From Cross correlation properties(wiki), 

Analogous to the convolution theorem, the cross-correlation satisfies

{\mathcal {F}}\{f\star g\}=({\mathcal {F}}\{f\})^{*}\cdot {\mathcal {F}}\{g\},
So finding the second signal amplitude is easy. 
Hope this helps !

[ - ]
Reply by kazFebruary 20, 2017

Hi Charansai, that looks good idea but to get correlation equivalent mathematically between time domain and frequency domain care is needed regarding Fourier resolution, padding issues and scaling.


[ - ]
Reply by Rick LyonsFebruary 20, 2017

Hi Amartansh.  I think charansal is pointing you in the correct direction, and kaz's warning is sensible. It seems to me that you should explore the topic of "deconvolution."  I suggest you have a look at the Chapter 17 deconvolution material from DSP guru Steven Smith at: