具有脉冲响应的 xcorr 函数

xcorr function with impulse response

我正尝试在 Matlab 中设计维纳滤波器来解决反卷积问题,但我遇到了很多问题。我有一个方差为 1.2 的高斯白噪声过程和一个长度为 2 的脉冲响应。它的值是 g(0) = 5 和 g(1) = 4。稍后在这个过程中我尝试确定 Rxx(m)。为此,我需要计算 g(m)*g(-m)(卷积),并被建议在 Matlab 中使用 xcorr 函数,但我的结果没有意义。任何人都可以帮助我使用这个 xcorr 函数并提供有关如何在其中使用此脉冲响应的建议吗?我曾尝试使用 g 的傅立叶变换,但这没有帮助。

下面的代码只实现了我在描述中看到的一部分。它生成噪声过程并执行第一部分中描述的操作。自相关不是用滤波器系数计算的,而是用实际信号计算的。

% generate noise process y
y = randn(1,N) * sqrt(1.2);

% filter y with the fir-filter g
g = [2, 0.6];
r = filter(g,1,y);

% generate noise process d
d = randn(1,N) * sqrt(0.2);

% x is the sum of r and d
x = r + d; 

% autocorrelation of x
[Rxx,lagRxx] = xcorr(x);

% plot autocorrelation
figure; grid on;
plot(lagRxx,Rxx);
title('Biased Autocorrelation of Signal x');
xlabel('Lag');

% cross correlation between x and y
[Rxy,lagRxy] = xcorr(x,y);

% plot crosscorrelation
figure; grid on;
plot(lagRxy,Rxy);
title('Biased Crosscorrelation of Signal x and y');
xlabel('Lag');