一维正交小波分解
%一维正交小波分解clear all
close all
t=0:1/1024:1-1/1024;
x=sin(2*pi*t);
n=0.2*randn(1,length(x));
y=x+n;
figure;
subplot(2,1,1),plot(t,x);title('原始信号');
subplot(2,1,2),plot(t,y);title('加噪信号');
%==========================================================================
qmf=MakeONFilter('Daubechies',8);
L=10-5;%两层分解
wcoef = FWT_PO(y,L,qmf);%小波系数
figure;
subplot(2,1,1),plot(t,wcoef);title('小波分解信号');
%============================================
%=============中间处理过程====================
th=0.2*sqrt(log(length(x)));
%wcoef=sign(wcoef).*(abs(wcoef)-th).*(abs(wcoef)>th);%软阈值去噪
wcoef=sign(wcoef).*abs(wcoef).*(abs(wcoef)>th);%硬阈值去噪
%============================================
y_re=IWT PO(wcoef,L,qmf);
subplot(2,1,2),plot(t,y_re);title('重构信号');
%Copyright: Mr. Hongxiao Feng,Institute of Intelligent Information
%Processing, Xidian University,2008