利用小波分解信号,再重构

 

利用小波分解信号,再重构_第1张图片

 

function [ output_args ] = example4_5( input_args )
%EXAMPLE4_5 Summary of this function goes here
%   Detailed explanation goes here
clc;
clear;
load leleccum; s = leleccum(1:3920);
% 进行3层小波分解,小波基函数为'db2' 
[c,l] = wavedec(s,3,'db2');
%进行小波重构
rs= waverec(c,l,'db2');
figure(1)
subplot(211)
plot(s);title('原始信号');
subplot(212)
plot(rs);title('重构信号');
%计算重构的误差
erro=norm(s-rs)
end

 

 利用小波分解信号,再重构_第2张图片

 

function [ output_args ] = example4_11( input_args )
%EXAMPLE4_11 Summary of this function goes here
%   Detailed explanation goes here
clc;
clear;
load noisdopp; x = noisdopp;
T = wpdec(x,3,'db1','shannon');
X=wprcoef(T,[2,1]);
figure(1)
subplot(211)
plot(x);title('原始信号');
xlim([0 length(x)]);
subplot(212)
plot(X);title('小波包[2,1]系数的重构信号');
xlim([0 length(X)]);
end

你可能感兴趣的:(可创新代码,重构)