赞
踩
%计算广义互相关时延 时间差
clc;
close all;
clear all;
fs = 150e6;
N = 4096;
x1 = randn(N,1);
tau = 0.000008;
x2 = delayseq(x1,tau,fs);
n = 2*length(x1)-1;
N = 2^nextpow2(n);
xfft = fft(x1);
yfft = fft(x2);
sampleIndex = -N/4:N/4-1;
R = xfft.*conj(yfft);
c = R./abs®;
ic = ifftshift(ifft©);
figure;plot(sampleIndex,ic)
[~,ind] =max(abs(ic));
lagDiff = sampleIndex(ind);
timeDiff = lagDiff/fs
tau = gccphat(x1,x2,fs)
timeDiff =
-8.0000e-06
tau =
-8.0000e-06
个人认为这里的时延估计,时延估计的准确率与采样率和实际的信号频率有关。
延迟点数不要设置得太大,设置的小一点就能准确计算出延迟。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。