Comparing two non periodic signals (signal shift)
10 views (last 30 days)
Show older comments

Hi guys, My name is Salah, I have two non periodic signals and im trying to find the shift between them using matlab. the signals are from spectrometer. I attached excel file that contains two signals and photo for them
Thanks Salah
0 Comments
Answers (1)
Ahmet Cecen
on 20 Nov 2014
Import your signals as A and B using the wizard. Also import the time information (x-axis) as T.
X=(ifft(fft(A).*conj(fft(B))));
shiftindex=find(X==max(X));
shift=T(shiftindex)-T(1); % This is the time value of the shift.
Also check below for a plot of the shifted signal and comparison.
figure
plot(A);
hold on;
plot(circshift(B,(find(X==max(X)))));
See Also
Categories
Find more on Large Files and Big Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!