小波分解机械信号(MATLAB代码)

该文展示了使用db3和db2小波基进行3层小波分解的过程。在ex4_2中,对sumsin信号进行分解并展示结构;在ex4_3和ex4_4中,对leleccum信号提取不同尺度的低频(cA)和高频(cD)系数。
摘要由CSDN通过智能技术生成

function [ output_args ] = ex4_2( input_args )
%EXAMPLE4_2 Summary of this function goes here
%   Detailed explanation goes here
clc;
clear;
load sumsin; s = sumsin; 
% 进行3层小波分解,小波基函数为'db3' 
[c,l] = wavedec(s,3,'db3');
figure(1)
subplot(211)
plot(s);title('仿真信号');
subplot(212)
plot(c);title('信号3层小波分解的结构');
xlabel('小波系数cA_3、cD_3、cD_2、cD_1');
xlim([0 1000]);
end

function [ output_args ] = example4_3( input_args )
%EXAMPLE4_3 Summary of this function goes here
%   Detailed explanation goes here
clc;
clear;
load leleccum; s = leleccum(1:2000);
% 进行3层小波分解,小波基函数为'db2' 
[c,l] = wavedec(s,3,'db2');
%提取尺度1、2、3的低频系数
cA1=appcoef(c,l,'db2',1);
cA2=appcoef(c,l,'db2',2);
cA3 = appcoef(c,l,'db2',3);
figure(1)
subplot(411)
plot(s);title('原始信号');
xlim([1 length(s)]);
subplot(412)
plot(cA1);ylabel('cA_1');
xlim([0 length(cA1)]);
subplot(413)
plot(cA2);ylabel('cA_2');
xlim([0 length(cA2)]);
subplot(414)
plot(cA3);ylabel('cA_3');
xlim([0 length(cA3)]);

end

 

function [ output_args ] = example4_4( input_args )
%EXAMPLE4_4 Summary of this function goes here
%   Detailed explanation goes here
clc;
clear;
load leleccum; s = leleccum(1:2000);
% 进行3层小波分解,小波基函数为'db2' 
[c,l] = wavedec(s,3,'db2');
%提取尺度1、2、3的高频系数
cD1=detcoef(c,l,1);
cD2=detcoef(c,l,2);
cD3 = detcoef(c,l,3);
figure(1)
subplot(411)
plot(s);title('原始信号');
xlim([1 length(s)]);
subplot(412)
plot(cD1);ylabel('cD_1');
xlim([1 length(cD1)]);
subplot(413)
plot(cD2);ylabel('cD_2');
xlim([1 length(cD2)]);
subplot(414)
plot(cD3);ylabel('cD_3');
xlim([1 length(cD3)]);

end

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

深度学习的奋斗者

你的鼓励是我努力的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值