小波分解机械信号

小波分解机械信号_第1张图片

 

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

小波分解机械信号_第2张图片 

 

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

 小波分解机械信号_第3张图片

 

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

 

 

 

你可能感兴趣的:(可创新代码,前端,linux,javascript)