clc clear all close all t=0:0.01:pi; %%%%测试结果是幅值还原的不太对,频率的分离还可以 %%%%可以调用 x1=10*sin(100*t/(2*pi)); x2=10*sin(400*t/(2*pi)); x3=5*sin(600*t/(2*pi)); figure(1) for flag=1:6 x=x1+x2+x3; [Am_d1 Fm_d]=lmd(x,flag); subplot(2,3,flag) hold on plot(x) plot(Fm_d,'r') x=x-Am_d1.*Fm_d; [Am_d2 Fm_d]=lmd(x,flag);%%%%第二阶 hold on plot(Am_d2.*Fm_d,'g') x=x-Am_d2.*Fm_d; [Am_d3 Fm_d]=lmd(x,flag);%%%%第三阶 plot(Am_d3.*Fm_d,'k') legend('原始信号','第一阶分解信号','第二阶分解信号','第三阶分解信号') switch flag case 2% %极值平均 psnr1 = PSNR(x1, Am_d1); psnr2 = PSNR(x2, Am_d2); psnr3 = PSNR(x3, Am_d3); % disp(['极值平均端点延拓分解信号平均信噪比psnr=',num2str( psnr1+ psnr2+ psnr3)]) title(['极值平均端点延拓']) case 3 psnr1 = PSNR(x1, Am_d1); psnr2 = PSNR(x2, Am_d2); psnr3 = PSNR(x3, Am_d3); % disp(['边界局部特征尺度延拓法端点延拓分解信号平均信噪比psnr=',num2str( psnr1+ psnr2+ psnr3)]) title(['边界局部特征尺度延拓法端点延拓']) case 4 psnr1 = PSNR(x1, Am_d1); psnr2 = PSNR(x2, Am_d2); psnr3 = PSNR(x3, Am_d3); % disp(['极值延拓法端点延拓分解信号平均信噪比']) title(['极值延拓法端点延拓']) case 5 psnr1 = PSNR(x1, Am_d1); psnr2 = PSNR(x2, Am_d2); psnr3 = PSNR(x3, Am_d3); % disp(['基于ISBM延拓端点延拓分解信号平均信噪比']) title(['基于ISBM延拓端点延拓']) case 6 psnr1 = PSNR(x1, Am_d1); psnr2 = PSNR(x2, Am_d2); psnr3 = PSNR(x3, Am_d3); % disp(['平行延拓法端点延拓分解信号平均信噪比']) title(['平行延拓法端点延拓']) case 1 psnr1 = PSNR(x1, Am_d1); psnr2 = PSNR(x2, Am_d2); psnr3 = PSNR(x3, Am_d3); % disp(['改进前分解信号平均信噪比']) title(['改进前']) end hold off end