% %%%在小波分析中经常用到近似与细节。近似表示信号的低尺度,即低频信息;
% %%%%细节表示信号的高尺度,即高频信息。因此,原始信号通过两个相互滤波器产生两个信号。
% %%%%(1)单层分解
% %%%%%%%%%%%%%%%%%%%%%%
% clc; clear all; close all;
% load leleccum; % 载入信号数据
% s = leleccum;
% Len = length(s);
% [ca1, cd1] = dwt(s, 'db1'); % 采用db1小波基分解
% a1 = upcoef('a', ca1, 'db1', 1, Len); % 从系数得到近似信号
% d1 = upcoef('d', cd1, 'db1', 1, Len); % 从系数得到细节信号
% s1 = a1+d1; % 重构信号
% figure;
% subplot(2, 2, 1); plot(s); title('初始电源信号');
% subplot(2, 2, 2); plot(ca1); title('一层小波分解的低频信息');
% subplot(2, 2, 3); plot(cd1); title('一层小波分解的高频信息');
% subplot(2, 2, 4); plot(s1, 'r-'); title('一层小波分解的重构信号');
% %%%%%%%%%%%%%%%%%%%%%%%%
%
% %%%%(2)多层分解介绍
% %[c,l] = wavedec(x,n,wname)
% %returns the wavelet decomposition of the 1-D signal x at level n using the wavelet wname.
% %(返回x信号在第n层的分解)
%
% load sumsin
% plot(sumsin)
% title('Signal')
% [c,l] = wavedec(sumsin,3,'db2');%返回sumsin信号在第3层的分解
% approx = appcoef(c,l,'db2');%近似信号
% [cd1,cd2,cd3] = detcoef(c,l,[1 2 3]);%细节信号
% subplot(4,1,1)
% plot(approx)
% title('Approximation Coefficients')
% subplot(4,1,2)
% plot(cd3)
% title('Level 3 Detail Coefficients')
% subplot(4,1,3)
% plot(cd2)
% title('Level 2 Detail Coefficients')
% subplot(4,1,4)
% plot(cd1)
% title('Level 1 Detail Coefficients')
%
% wname = 'db5';
% [LoD,HiD,LoR,HiR] = wfilters(wname);
% subplot(2,2,1)
% stem(LoD)
% title('Decomposition Lowpass Filter')
% subplot(2,2,2)
% stem(HiD)
% title('Decomposition Highpass Filter')
% subplot(2,2,3)
% stem(LoR)
% title('Reconstruction Lowpass Filter')
% subplot(2,2,4)
% stem(HiR)
% title('Reconstruction Highpass Filter')
% xlabel(['The four filters for ',wname])
%%%%%%%%%返回高低通滤波器
% clear all;
% close all;
%
% [F1,F2] = wfilters('db6','l')
% subplot(1,2,1)
% stem(F1)
% title('Decomposition Lowpass Filter')
% subplot(1,2,2)
% stem(F2)
% title('Decomposition Highpass Filter')
waveletwavelet_离散小波滤波_given4nf_matlab_小波多层分解_小波变换_
版权申诉
5星 · 超过95%的资源 20 浏览量
2021-10-02
04:02:43
上传
评论 1
收藏 2KB RAR 举报
西西nayss
- 粉丝: 70
- 资源: 4754