close all
clear all
fs=10000;
ts=1/fs;
%t=1/fs:1/fs:30000/fs;
%r=2*sin(2*pi*50.0*t);
%z=r';
z=importdata('1.mat');
N=length(z);
t=(0:N-1)*ts;
tic;
[c,l]=wavedec(z(:,1),6,'db10');
aa6=wrcoef('a',c,l,'db10',6);
%重构1-5层细节系数
ad6=wrcoef('d',c,l,'db10',6);
ad5=wrcoef('d',c,l,'db10',5);
ad4=wrcoef('d',c,l,'db10',4);
ad3=wrcoef('d',c,l,'db10',3);
ad2=wrcoef('d',c,l,'db10',2);
ad1=wrcoef('d',c,l,'db10',1);
toc;
subplot(311)
plot(t,aa6);
subplot(312)
plot(t,ad6);
subplot(313)
plot(t,ad5);