具有脉冲响应的xcorr功能

时间:2015-06-23 09:56:14

标签: matlab filtering convolution

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

1 个答案:

答案 0 :(得分:0)

以下代码仅实现了我在描述中可以看到的部分内容。它产生噪声过程并完成第一部分中描述的内容。自相关不是用滤波器系数计算的,而是用实际信号计算的。

% 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');
相关问题