小波包分解、重构 matlab代码

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’,’ 系数’])

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值