📄 testexpdesa.m
字号:
%function testPDESA
%测试仿真exp(-t)*sin( 2*pi*50*t)数据的包络
clear
clc
fs=5120;
Ns=2048;
t=[0:Ns-1]/fs;
x=exp(-5*t).*cos(2*pi*20*t).*sin( 2*pi*500*t);%+cos(2*pi*35*t).*sin( 2*pi*300*t);
x2=exp(-5*t).*cos(2*pi*20*t);
y=DESA(x);
yhilbert=abs(hilbert(x));
subplot(2,1,1),
plot(t,x,'g-'),grid on,title('原始数据');
hold on ,plot(t,y,'b -','LineWidth',2),grid on,title('能量算子包络结果')
xlabel('t/s');ylabel('幅值/mm');
legend('原始数据','包络');
%,plot(t,y,'b -'),
subplot(2,1,2)
plot(t,yhilbert,'k -')
grid on,title('Hibert包络结果')
figure
plot(t,abs(x2)-y,'r-+')
grid on
axis([0 0.4 -0.02 0.02]);
xlabel('t/s');ylabel('误差/mm');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -