⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wiener1.m

📁 各种滤波器
💻 M
字号:
t=0:0.01:5;
s=sin(2*pi*5*t);
n=sin(2*pi*10*t);
%n=randn(size(t));
x=s+n;
d=s;
%s=[s(1:50),cos(2*pi*5*t(1:51))];
%s=[s(1:50),-s(51:end)]; % 这表明这个滤波器不具有自适应能力

N=10;
% 在程序文件wiener2.m中已经得知,如果相关矩阵只取滤波器长度个输入
% 来估计的话,很不精确,所以只能取相当多的输入来估计相关矩阵,这就是
% 一个非因果滤波器!!!!!!
UP=floor(length(t)/1);
R=MyCorrelation(x(1:UP),x(1:UP),N);
p=MyCorrelation(x(1:UP),d(1:UP),N)';
w=toeplitz(R)\p;

y=filter(w,1,x);
subplot(311)
plot(t,x)
title('Original')
grid on
subplot(312)
plot(t,y,'b')
title('Filter out')
grid on
subplot(313)
plot(t,d-y)
grid on
title('Error')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -