我正在尝试编写代码来将发送的信号与接收的信号进行互相关,以确定样本延迟的数量

发布于 2024-12-09 21:42:04 字数 316 浏览 0 评论 0原文

互相关用于通过发送一个信号来测量到飞机的距离 已知的宽带信号并将传输信号与输入信号相关联 通过雷达接收盘接收

发射信号 x(n) 的长度为 N=512,而接收信号 y(n) 的长度为 N=2048。

y(n)=kx(nd)+w(n);其中“kx(nd)”是 x(n) 延迟 d 个样本并衰减系数 k,w(n) 是接收噪声。

我正在尝试编写一个 MATLAB 程序来将 x(n) 与 y(n) 交叉关联,以确定 d 的值,即样本延迟数。 如果到飞机的距离要确定,还要确定合适的采样频率 考虑到传输的信号,在 50 km 内确定,精度为 50 m 接收到的数据以光速传播。

Cross correlation is to be used to measure distance to an aircraft by transmitting a
known wide-band signal and correlating the transmitted signal with incoming signals
received via the radar reception dish

The transmitted signal x(n) is of length N=512 while the received signal y(n) is of length N=2048.

y(n)=kx(n-d)+w(n); where 'kx(n-d)' is x(n) delayed by d samples and attenuated by a factor k, and w(n) is reception noise.

i am trying to write a MATLAB program to cross correlate x(n) with the y(n) to determine the value of d, the number of samples delay.
And also Determine a suitable sampling frequency if the distance to the aircraft is to be
determined within 50 km to an accuracy of 50 m, given that the transmitted
and received data is travelling at the speed of light.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

猫烠⑼条掵仅有一顆心 2024-12-16 21:42:04

最简单的方法是使用“xcorr”函数。这是 matlab 信号处理工具箱的一部分,但应该可用于 GNU Octave 此处。我还没有检查八度脚本是否完全兼容 MATLAB。

您可以将 xcorr 函数用作:

[correlation,lags] = xcorr(x,y);

可以使用以下方法找到滞后值

delay = lags(find(correlation==max(correlation)))

在光速下,信号将以 3 x 10^8 m/s 的速度传播,因此要获得 50m 的分辨率,您应该在以下位置采样至少 (3e8/50m) = 6MHz。在此采样率下,每次延迟将为 1/6000000 秒。如果将延迟乘以该值,就可以得到信号传输和接收之间的总时间间隔。将此时间间隔乘以光速即可得出您的距离。

The easiest way to do this is with the "xcorr" function. This is part of the Signal Processing toolbox for matlab, but should be available for GNU Octave here. I have not checked if the octave script is completely MATLAB compatible.

You can use the xcorr function as:

[correlation,lags] = xcorr(x,y);

The lag value can be found using

delay = lags(find(correlation==max(correlation)))

At the speed of light, the signal will be travelling at 3 x 10^8 m/s, so to have a resolution of 50m, you should be sampling at at least (3e8/50m) = 6MHz. At this sampling rate, each lag will be 1/6000000 second. If you multiply your delay by this value, you get your total time intervel between transmission and reception of the signal. Multiply this time intervel by the speed of light to get your distance.

眼泪淡了忧伤 2024-12-16 21:42:04

您可以使用广义互相关 - 相变换 GCC PHAT
以下是它的 MATLAB 代码

function time=GCCPHAT_testmode(b1,b2)

b1f=fft(b1);

b2f=fft(b2);

b2fc=conj(b2f);

neuma=(b1f).*(b2fc);

deno=abs((b1f).*(b2fc));

GPHAT=neuma./deno;

GPHATi=ifft(GPHAT);

[maxval ind]= max(GPHATi);

samp=ind

end

You can use generalized Cross correlation -Phase transform GCC PHAT
The following is the MATLAB code for it

function time=GCCPHAT_testmode(b1,b2)

b1f=fft(b1);

b2f=fft(b2);

b2fc=conj(b2f);

neuma=(b1f).*(b2fc);

deno=abs((b1f).*(b2fc));

GPHAT=neuma./deno;

GPHATi=ifft(GPHAT);

[maxval ind]= max(GPHATi);

samp=ind

end
恰似旧人归 2024-12-16 21:42:04

我们可以忽略matlab中的'find'函数,该命令可以更改为

delay = lags(correlation==max(correlation))

'xcorr'适合长向量;
“gcc”更喜欢逐帧。

we can ignore the 'find' function in matlab, the command could be changed to

delay = lags(correlation==max(correlation))

'xcorr' suits for vectors with long length;
'gcc' prefer frame by frame.

む无字情书 2024-12-16 21:42:04

Aj463上面的评论很好,确实GCC-PHAT在估计宽带信号延迟方面比未加权相关更好。

我建议对上面发布的代码进行一个小改进:向分母添加一个小值 epsilon,epsilon -> 0,以避免最终被零除。

因此,我会将行更改

deno=abs((b1f).*(b2fc));

deno=abs((b1f).*(b2fc)) + epsilon; 

Aj463's comment above is good, indeed GCC-PHAT is better than unweighted correlation for estimating delay of wide-band signals.

I would suggest a small improvement to the code posted above: to add a small value epsilon to the denominator, epsilon -> 0, in order to avoid eventual division by zero.

Thus, I would change the line

deno=abs((b1f).*(b2fc));

to

deno=abs((b1f).*(b2fc)) + epsilon; 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文