%% 学习目标:一维小波的多层分解
clear all;
close all;
load noissin.mat;
x=noissin;
C,L\]=wavedec(x,3,'db4'); % 3层分解,使用db4小波 \[cd1,cd2,cd3\]=detcoef(C,L,\[1,2,3\]); % 使用detcoef函数获取细节系数 ca3=appcoef(C,L,'db4',3); % 使用appcoef函数获取近似系数 figure; subplot(511); plot(x); ylabel('x'); subplot(512); plot(1:L(1),ca3); ylabel('ca3'); subplot(513); plot(1:L(2),cd3); ylabel('cd3'); subplot(514); plot(1:L(3),cd2); ylabel('cd2'); subplot(515); plot(1:L(4),cd1); ylabel('cd1'); set(gcf,'position',\[30,30,600,500\]); 