1、fs=30000;%fid=fopen(e:1.dat,r);N=3072;x1=fread(fid,N,int16);fclose(fid);%fid=fopen(e:2.dat,r);x2=fread(fid,N,int16);fclose(fid);t=1:3072;%-figure(1);subplot(211);plot(t,x1);axis(1,1000,-600,600);title();subplot(212);plot(t,x2);title();axis(1,1000,-600,600);%-figure(2);%2c,l=wavedec(x1,2,db2);%2d=wrc
2、oef(d,c,l,db2);%2a=wrcoef(a,c,l,db2);subplot(221);plot(d);title();axis(1,500,-2000,2000);subplot(222);plot(a);title();axis(1,500,-2000,2000);%2c,l=wavedec(x2,2,db2);%2d=wrcoef(d,c,l,db2);%2a=wrcoef(a,c,l,db2);subplot(223);plot(d);title();axis(1,500,-2000,2000);subplot(224);plot(a);title();axis(1,500
3、,-2000,2000);%-c,l=wavedec(x1,2,db2);d1=wrcoef(d,c,l,db2,1);y=hilbert(d1);%任y=abs(y);nfft=3072;%p=abs(fft(y,nfft);figure(3);subplot(211);stem(0:nfft/2-1)/nfft*fs,p(1:nfft/2);axis(1000,1500,1,300000);title();xlabel(f/Hz);ylabel();c,l=wavedec(x2,2,db2);d1=wrcoef(d,c,l,db2,1);%任y=hilbert(d1);%y=abs(y);nfft=3072;p=abs(fft(y,nfft);subplot(212);stem(0:nfft/2-1)/nfft*fs,p(1:nfft/2);axis(1000,1500,1,300000);title();xlabel(f/Hz);ylabel();