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

📄 ch3_9_5.m

📁 用MATLAB作的一个滤波程序
💻 M
字号:
clear all;
figure(1)
k=0:127
x=cos(20*k)+sqrt(0.5)*randn(1,128);
subplot(311);
plot(k,x);
title('混噪信号时域图')
grid;

%小波变换
[ca1,cd1]=dwt(x,'db2');

subplot(323);
plot(cd1);
title('1 Detail.coef.for db2')

[ca2,cd2]=dwt(ca1,'db2');
subplot(324);
plot(cd2);
title('2 Detail.coef.for db2')

[ca3,cd3]=dwt(ca2,'db2');
subplot(325);
plot(ca3);
title('3 Approx.coef.for db2')
subplot(326);
plot(cd3);
title('3 Detail.coef.for db2')

%对细节分量进行或值处理
figure(2)
xd1=wden(cd1,'minimaxi','s','one',3,'db2');
subplot(311);
plot(xd1);
title('Denoise singal with  soft sure');

xd2=wden(cd2,'minimaxi','s','one',3,'db2');
subplot(312);
plot(xd2);
title('Denoise singal with  soft sure');

xd3=wden(cd3,'minimaxi','s','one',3,'db2');
subplot(313);
plot(xd3);
title('Denoise singal with  soft sure');

%用idwt 重构信号
figure(3)
xc3=idwt(ca3,xd3,'db2');
subplot(221);
plot(xc3);
title('3 Detail component for db2');

xc2=idwt(xc3,xd2,'db2');
subplot(222);
plot(xc2);
title('2 Detail component for db2');

xca=idwt(xc2,[],'db2');
xca=xca(1:128);
xcb=idwt([],xd1,'db2');
xc1=xca+xcb
subplot(223);
plot(xc1);
title('1 Detail component for db2');
axis([0 130 -2 2])

subplot(224);
plot(x)
axis([0 130 -2 2])

⌨️ 快捷键说明

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