資源簡(jiǎn)介
對(duì)一幅圖像的進(jìn)行小波包分解,然后提取每一層的系數(shù)
代碼片段和文件信息
tic
clear
clc
a=15;?b=0.5;?f=200;?m=pi/3;?%設(shè)定初始值
N=400;?flag=1;
%下面代碼是分段繪制信號(hào),時(shí)間間隔為0.001,數(shù)據(jù)點(diǎn)數(shù)是1001個(gè)
t1=linspace(0.3010.5200);
xt1=9*sin(100*pi*t1)+5*sin(180*pi*t1)+sin(240*pi*t1);
t2=linspace(0.5010.7200);
xt2=9*sin(100*pi*t2)+5*sin(180*pi*t2)+sin(240*pi*t2)+sin(2*pi*f*t2+m.*exp(-a*(t2-b)));
t=[t1t2];
xt=[xt1xt2];
figure(1);
plot(txt);
title(‘原始信號(hào)圖‘);?xlabel(‘時(shí)間(t)‘);?ylabel(‘幅值‘);?
T=wpdec(xt3‘db2‘);?%進(jìn)行小波包分解
plot(T);??figure(2);
%計(jì)算小波包分解系數(shù)
x1=wpcoef(T[10]);?
x2=wpcoef(T[11]);?
z1=wpcoef(T[20]);??
z2=wpcoef(T[21]);?
z3=wpcoef(T[22]);?
z4=wpcoef(T[23]);?
y1=wpcoef(T[30]);??
y2=wpcoef(T[31]);?
y3=wpcoef(T[32]);?
y4=wpcoef(T[33]);?
y5=wpcoef(T[34]);?
y6=wpcoef(T[35]);?
y7=wpcoef(T[36]);?
y8=wpcoef(T[37]);?
figure(3);
subplot(321);???plot(x1);
subplot(322);???plot(x2);
subplot(323);???plot(z1);
subplot(324);???plot(z2);
subplot(325);???plot(z3);
subplot(326);???plot(z4);
figure(4);
subplot(421);???plot(y1);
subplot(422);???plot(y2);
subplot(423);???plot(y3);
subplot(424);???plot(y4);
subplot(425);???plot(y5);
subplot(426);???plot(y6);
subplot(427);???plot(y7);
subplot(428);???plot(y8);
%重構(gòu)小波包系數(shù)
xx1=wprcoef(T[10]);?
xx2=wprcoef(T[11]);?
zz1=wprcoef(T[20]);??
zz2=wprcoef(T[21]);?
zz3=wprcoef(T[22]);?
zz4=wprcoef(T[23]);?
yy1=wprcoef(T[30]);?
yy2=wprcoef(T[31]);?
yy3=wprcoef(T[32]);?
yy4=wprcoef(T[33]);?
yy5=wprcoef(T[34]);?
yy6=wprcoef(T[35]);?
yy7=wprcoef(T[36]);?
yy8=wprcoef(T[37]);?
figure(5);
subplot(321);???plot(txx1);?title(‘第一層分解低頻段‘);
subplot(322);???plot(txx2);?title(‘第一層分解高頻段‘);
subplot(323);???plot(tzz1);?title(‘第二層分解低頻段1‘);
subplot(324);???plot(tzz2);?title(‘第二層分解低頻段2‘);
subplot(325);???plot(tzz3);?title(‘第二層分解高頻段1‘);
subplot(326);???plot(tzz4);?title(‘第二層分解高頻段2‘);
figure(6);
subplot(421);???plot(tyy1);?title(‘第三層分解低頻段1‘);
subplot(422);???plot(tyy2);?title(‘第三層分解低頻段2‘);
subplot(423);???plot(tyy3);?title(‘第三層分解低頻段3‘);
subplot(424);???plot(tyy4);?title(‘第三層分解低頻段4‘);
subplot(425);???plot(tyy5);?title(‘第三層分解高頻段1‘);
subplot(426);???plot(tyy6);?title(‘第三層分解高頻段2‘);
subplot(427);???plot(tyy7);?title(‘第三層分解高頻段3‘);
subplot(428);???plot(tyy8);?title(‘第三層分解高頻段4‘);
%計(jì)算各個(gè)頻段的能量
a=pow2(1);??%計(jì)算第一次分解后的能量
aa=xx1.^2;????bb=(aa.*a)/(N-a);
for?i=1:a:N-a-1?
????bb(1i+a)=bb(1i+a)+bb(1i);
end
E1=?bb(1i+a);
aa=xx2.^2;????bb=(aa.*a)/(N-a);
for?i=1:a:N-a-1?
????bb(1i+a)=bb(1i+a)+bb(1i);
end
E2=?bb(1i+a);
a=pow2(2);???%計(jì)算第二次分解后的能量
aa=zz1.^2;????bb=(aa.*a)/(N-a);
for?i=1:a:N-a-1??
????bb(1i+a)=bb(1i+a)+bb(1i);
end
E3=?bb(1i+a);
aa=zz2.^2;????bb=(aa.*a)/(N-a);
for?i=1:a:N-a-1???
????bb(1i+a)=bb(1i+a)+bb(1i);
end
E4=?bb(1i+a);
aa=zz3.^2;????bb=(aa.*a)/(N-a);
for?i=1:a:N-a-1???
????bb(1i+a)=bb(1i+a)+bb(1i);
end
E5=?bb(1i+a);
aa=zz4.^2;????bb=(aa.*a)/(N-a);
for?i=1:a:N-a-1???
????bb(1i+a)=bb(1i+a)+bb(1i);
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????4381??2010-04-23?22:14??小波包分解\waveletpacketsZHH.m
?????目錄??????????0??2018-10-25?19:31??小波包分解
-----------?---------??----------?-----??----
?????????????????4381????????????????????2
- 上一篇:數(shù)字華容道
- 下一篇:ANSYS LS-DYNA
評(píng)論
共有 條評(píng)論
相關(guān)資源
- 數(shù)字華容道
- VisualStudioUninstaller vs卸載工具
- 基于MSP430G2553的藍(lán)牙控制小車
- 金蝶K3wise數(shù)據(jù)字典
- DAC0832波形發(fā)生器幅值及頻率都精確可
- 安卓QQ6.71協(xié)議源碼易語(yǔ)言,qq協(xié)議源碼
- E盾偷后臺(tái)工具源碼
- Zprotect專業(yè)版(無(wú)限制) 一機(jī)一碼E
- WPF USB 網(wǎng)絡(luò) 串口 通信軟件
- Servlet API中文文檔
- 組態(tài)王驅(qū)動(dòng)開(kāi)發(fā)包3.0.0.7(中文)
- stm32f030 IAP Demo(原創(chuàng))
- 用python編寫的移動(dòng)彩信的發(fā)送程序
- SSM+Shiro+redis實(shí)現(xiàn)單點(diǎn)登陸
- WPE三件套(WPE+CCP+E2G)冰楓修改版
- 飛思卡爾單片機(jī)MC9S12XS12G128驅(qū)動(dòng)(硬件
- 多窗口后臺(tái)鼠標(biāo)連點(diǎn)器
- jstl-api-1.2和jstl-impl-1.2
- 精美千年登陸器(自動(dòng)更新).rar
- VF編程與軟件開(kāi)發(fā)若干實(shí)例
- 成績(jī)管理和課程表系統(tǒng)
- XXX市審計(jì)局審計(jì)信息管理系統(tǒng)介紹
- 我寫的一個(gè)簡(jiǎn)單的屬性編輯器控件
- 校園網(wǎng)絡(luò)信息發(fā)布系統(tǒng)
- 公歷(陽(yáng)歷)和農(nóng)歷(陰歷)相互轉(zhuǎn)
- sandisk cruzer 32G U盤量產(chǎn)工具.rar
- 金蝶ERP二次開(kāi)發(fā)技術(shù)手冊(cè)
- swift-swift版本的簡(jiǎn)易WKWebview瀏覽器帶加
- swift-模仿類似聊天的UI
- ARTNET開(kāi)發(fā)技術(shù)