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;
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!
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.
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.
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: