我怎么找不到错误呢 求助
%xiaobobao xiaozaofs=12000;N=1024;
fd=fopen('C:\张\120.mat','rb');
xdata=(fread(fd,N+25,'float64'));
fclose(fd);
xdata=xdata(26:N+25);
xdata=xdata-mean(xdata);
%小波包分解
layer=2;wpname='db1';
T=wpdec(xdata,layer,wpname);
%小波包重构
rfs0=wprcoef(T,);
rfs1=wprcoef(T,);
rfs2=wprcoef(T,);
figure(1)
subplot(411);plot(xdata,'linewidth',2);
title('yuanshixinhao','fontsize',12);axis();
subplot(412);plot(rfs0,'linewidth',2);title('Reconstructed Packet(0,0)');axis();
subplot(413);plot(rfs1,'linewidth',2);title('Reconstructed Packet(1,0)');axis();
subplot(414);plot(rfs2,'linewidth',2);title('Reconstructed Packet(1,1)');axis();
xlabel('caiyangdianshu');
%packet(1,1)信号的络图
y=hilbert(rfs2);
ydata=abs(y);ydata=ydata-mean(ydata);
nfft=1024;p=abs(fft(ydata,nfft));
=max(p);
fmax=4/1024*12000;
figure(2)
subplot(111);
plot((1:nfft/2-1)nfft*fs,p(2:nfft/2),'linewidth',2);
title('packet(1,1)的包络图','fontsize',12);
grid on
text(fmax,pmax,int2str(fmax));
set(gca,'xlim',);
set(gca,'xtick',);
xlable('频率f/HZ','fonsize',12);ylabe('功率谱幅值/微米','fontsize',12);
set(gca,'linewidth',2);
grid off
图形显示
回复 #1 sunlc 的帖子
plot((1:nfft/2-1)nfft*fs,p(2:nfft/2),'linewidth',2);这一行错误,((1:nfft/2-1)nfft*fs?不理解,错了吧这里
页:
[1]