?? test.m
字號:
%閥值wthresh,軟閥值或者硬閥值
%upcoef重構小波系數
%appcoef多分辯小波分解
%waverec多分辯小波重構
%detcoef小波細節系數
clear;
s=load('open2.txt');
%分解,用db1其它的需要進行信號延拓
[ca1,cd1]=dwt(s,'db1');
[ca2,cd2]=dwt(ca1,'db1');
[ca3,cd3]=dwt(ca2,'db1');
figure;plot(s);
figure;plot(ca1);
figure;plot(ca2);
figure;plot(ca3);
figure;plot(cd1);
figure;plot(cd2);
figure;plot(cd3);
%軟閥值
cd3=wthresh(cd3,'s',thselect(s,'sqtwolog'));
cd2=wthresh(cd2,'s',thselect(s,'sqtwolog'));
cd1=wthresh(cd1,'s',thselect(s,'sqtwolog'));
%重構
ca2=idwt(ca3,cd3,'db1');
ca1=idwt(ca2,cd2,'db1');
ns=idwt(ca1,cd1,'db1');
% subplot(4,2,1);plot(s);ylabel('原始序列');
% subplot(4,2,2);plot(ca1);ylabel('一層低頻信號');
% subplot(4,2,3);plot(ca2);ylabel('二層低頻信號');
% subplot(4,2,4);plot(ca3);ylabel('三層低頻信號');
%
% subplot(4,2,5);plot(ns);ylabel('信號重構')
% subplot(4,2,6);plot(cd1);ylabel('一層高頻信號');
% subplot(4,2,7);plot(cd2);ylabel('二層高頻信號');
% subplot(4,2,8);plot(cd3);ylabel('三層高頻信號');
figure;plot(ns);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -