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

📄 ch3_9_6.m

📁 用MATLAB作的一个滤波程序
💻 M
字号:
clear all;
load noisdopp;
x=noisdopp(1:128);
figure(1)
plot(x);
title('noisdopp噪声时域图')

%四级dwt分解
figure(2)
[ca1,cd1]=dwt(x,'db2');
subplot(421);
plot(ca1);
title('1 Approx.coef.for db2')
subplot(422);
plot(cd1);
title('1 Detail.coef.for db2')

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

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

[ca4,cd4]=dwt(ca3,'db2');
subplot(427);
plot(ca4);
title('4 Approx.coef.for db2')
subplot(428);
plot(cd4);
title('4 Detail.coef.for db2')

%对细节分量进行或值处理

figure(3)
xd1=wden(cd1,'minimaxi','s','one',4,'db2');
subplot(221);
plot(xd1);
title('Denoise singal with  soft sure');

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

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

xd4=wden(cd4,'minimaxi','s','one',4,'db2');
subplot(224);
plot(xd4);
title('Denoise singal with  soft sure');

%用idwt 重构信号
figure(4)
xc4=idwt(ca4,xd4,'db2');
subplot(321);
plot(xc4);
title('4 Detail component for db2');

xc3=idwt(xc4,xd3,'db2');
subplot(322);
plot(xc3);
title('3 Detail component for db2');

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

xca=idwt(xc2,[],'db2');
xca=xca(1:128);
xcb=idwt([],xd1,'db2');
xc1=xca+xcb
subplot(324);
plot(xc1);
title('重建信号时域图');
axis([0 140 -5 5])

subplot(325);
plot(x)
axis([0 140 -5 5])
title('原始信号时域图')



⌨️ 快捷键说明

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