f10_11.m
来自「这个是matlab下的小波分析在信号处理中的应用的全部代码」· M 代码 · 共 31 行
M
31 行
%装载采集的信号leleccum.mat
load leleccum;
%将信号中第2200到第3600个采样点赋给s
index=2200:3600;
s=leleccum(index);
%画出原始信号
figure(1);
plot(index,s);
xlabel('样本序号 n');
ylabel('幅值 A');
%用db3小波进行5层分解
[c,l]=wavedec(s,5,'db3');
%重构第1-5层细节系数
d5 = wrcoef('d',c,l,'db3',5);
d4 = wrcoef('d',c,l,'db3',4);
d3 = wrcoef('d',c,l,'db3',3);
d2 = wrcoef('d',c,l,'db3',2);
d1 = wrcoef('d',c,l,'db3',1);
%显示细节系数
figure(2)
subplot(3,1,1);
plot(index,d3,'LineWidth',2);
ylabel('d3');
subplot(3,1,2);
plot(index,d2,'LineWidth',2);
ylabel('d2');
subplot(3,1,3);
plot(index,d1,'LineWidth',2);
ylabel('d1');
xlabel('样本序号 n');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?