資源簡介
利用互相關計算兩個信號的時延差,附程序注釋。
代碼片段和文件信息
clc?;
clear?all;
close?all
?N=10000;??%采樣長度
?Fs=500;??%采樣頻率
?n=0:N-1;
?t=n/Fs;?%時間序列
?t1=(n+10)/Fs;?%延遲0.02s;
?lag=200;
?%信號1
?x=cos(2*pi*10*t);
%??x=awgn(x10);
?%信號2
?y=cos(2*pi*10*t1);
%??y=awgn(y10);
?%互相關
?[clags]=xcorr(xy);
?subplot(211);
?plot(tx‘r‘);
?axis([0?0.9?-1?1]);
?hold?on;
?plot(ty
評論
共有 條評論