小波包分解、重构 matlab代码
clear allclose allclc% 加载信号load leleccum;% 采样点x = leleccum(300:2348);% x = importdata(‘V1.txt’);n = 3;wpt=wpdec(x,n,‘dmey’);% Plot wavelet packet tree (binary tree)plot(wpt)%% wavelet packet coefficie
clear all
close all
clc
% 加载信号
load leleccum;
% 采样点
x = leleccum(300:2348);
% x = importdata(‘V1.txt’);
n = 3;
wpt=wpdec(x,n,‘dmey’);
% Plot wavelet packet tree (binary tree)
plot(wpt)
%% wavelet packet coefficients.default:use the front 4.
cfs0=wpcoef(wpt,7);
cfs1=wpcoef(wpt,8);
cfs2=wpcoef(wpt,9);
cfs3=wpcoef(wpt,10);
figure;
subplot(5,1,1);
plot(x);
title(‘原始信号’);
subplot(5,1,2);
plot(cfs0);
title([‘结点 7’,’ 系数’])
subplot(5,1,3);
plot(cfs1);
title([‘结点 8’,’ 系数’])
subplot(5,1,4);
plot(cfs2);
title([‘结点 9’,’ 系数’])
subplot(5,1,5);
plot(cfs3);
title([‘结点 10’,’ 系数’])
%% reconstruct wavelet packet coefficients.
rex0=wprcoef(wpt,7);
rex1=wprcoef(wpt,8);
rex2=wprcoef(wpt,9);
rex3=wprcoef(wpt,10);
figure;
subplot(5,1,1);
plot(x);
title(‘原始信号’);
subplot(5,1,2);
plot(rex0);
title([‘重构结点7’,’ 系数’])
subplot(5,1,3);
plot(rex1);
title([‘重构结点 8’,’ 系数’])
subplot(5,1,4);
plot(rex2);
title([‘重构结点 9’,’ 系数’])
subplot(5,1,5);
plot(rex3);
title([‘重构结点10’,’ 系数’])

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐
所有评论(0)