correlation of 2 signals
1 次查看(过去 30 天)
显示 更早的评论
need little help.
i am actually correlating two signals. i want to circ shift the signal by (-1.9282e-12) and then find this delay by delay command.
code:
% t=linspace(0,1000,100001) %in ms
xs=randn(1,100001)
grid on
subplot(3,1,1)
plot(t,xs)
title('SIGNAL RECEIVED AT MASTER')
shift_ms = 10;
%SIGNAL RECEIVED AT RECEIVER 1(TIME DELAYING THE DISCRETE SIGNAL)
x1=circshift(xs,shift_ms*.1); %signal received at receiver 1
subplot(3,1,2)
plot(t,x1)
title('SIGNAL RECEIVED AT RECEIVER#1')
[c,lags]=xcorr(xs,x1);
subplot(3,1,3)
plot(lags,c)
title('CORRELATION OF RECEIVER 1 AND PROCESSING UNIT')
[maxval indx]=max(c)
shiftCalc_ms = (length(t)-indx)/10
t21 = finddelay(xs,x1)
output:
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!