使用小波包变换分析信号的matlab程序,使用小波包变换分析信号的MATLAB程序.docx...

使用小波包变换分析信号的MATLAB程序

使用小波包变换分析信号的MATLAB程序,下面是使用小波包变换分析两个信号的特征向量和各频率成分的功率谱%t=0.001:0.001:1; t=1:1000; s1=sin(2*pi*50*t*0.001)+sin(2*pi*120*t*0.001)+rand(1,length(t)); for t=1:500; s2(t)=sin(2*pi*50*t*0.001)+sin(2*pi*120*t*0.001)+rand(1,length(t)); end for t=501:1000; s2(t)=sin(2*pi*200*t*0.001)+sin(2*pi*120*t*0.001)+rand(1,length(t)); end subplot(9,2,1) plot(s1) title('原始信号') ylabel('S1') subplot(9,2,2) plot(s2) title('故障信号') ylabel('S2') wpt=wpdec(s1,3,'db1','shannon'); %plot(wpt); s130=wprcoef(wpt,[3,0]); s131=wprcoef(wpt,[3,1]); s132=wprcoef(wpt,[3,2]); s133=wprcoef(wpt,[3,3]); s134=wprcoef(wpt,[3,4]); s135=wprcoef(wpt,[3,5]); s136=wprcoef(wpt,[3,6]); s137=wprcoef(wpt,[3,7]); s10=norm(s130); s11=norm(s131); s12=norm(s132); s13=norm(s133); s14=norm(s134); s15=norm(s135); s16=norm(s136); s17=norm(s137); st10=std(s130); st11=std(s131); st12=std(s132); st13=std(s133); st14=std(s134); st15=std(s135); st16=std(s136); st17=std(s137); disp('正常信号的特征向量'); snorm1=[s10,s11,s12,s13,s14,s15,s16,s17] std1=[st10,st11,st12,st13,st14,st15,st16,st17] subplot(9,2,3);plot(s130); ylabel('S130'); subplot(9,2,5);plot(s131); ylabel('S131'); subplot(9,2,7);plot(s132); ylabel('S132'); subplot(9,2,9);plot(s133); ylabel('S133'); subplot(9,2,11);plot(s134); ylabel('S134'); subplot(9,2,13);plot(s135); ylabel('S135'); subplot(9,2,15);plot(s136); ylabel('S136'); subplot(9,2,17);plot(s137); ylabel('S137'); wpt=wpdec(s2,3,'db1','shannon'); %plot(wpt); s230=wprcoef(wpt,[3,0]); s231=wprcoef(wpt,[3,1]); s232=wprcoef(wpt,[3,2]); s233=wprcoef(wpt,[3,3]); s234=wprcoef(wpt,[3,4]); s235=wprcoef(wpt,[3,5]); s236=wprcoef(wpt,[3,6]); s237=wprcoef(wpt,[3,7]); s20=norm(s230); s21=norm(s231); s22=norm(s232); s23=norm(s233); s24=norm(s234); s25=norm(s235); s26=norm(s236); s27=norm(s237); st20=std(s230); st21=std(s231); st22=std(s232); st23=std(s233); st24=std(s234); st25=std(s235); st26=std(s236); st27=std(s237); disp('故障信号的特征向量'); snorm2=[s20,s21,s22,s23,s24,s25,s26,s27] std2=[st20,st21,st22,st23,st24,st25,st26,st27] subplot(9,2,4);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值