## Amplitude calculation from cross correlation data

Started by 7 years ago●4 replies●latest reply 7 years ago●614 viewsHey all,

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

fs=500000;

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));

figure(3)

subplot(2,1,2)

plot(tx,x)

% 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!

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.

Kaz

Hey Amartansh,

From Cross correlation properties(wiki),

Analogous to the convolution theorem, the cross-correlation satisfies

- So finding the second signal amplitude is easy.
- Hope this helps !

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.

Kaz

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: