《Matlab的时频分析程序.doc》由会员分享,可在线阅读,更多相关《Matlab的时频分析程序.doc(7页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.-author-dateMatlab的时频分析程序Matlab的时频分析程序clcclear allfname,fpath=uigetfile(*.xls,选择文件);du=fopen(strcat(fpath,fname),r);data=xlsread(strcat(fpath,fname);fclose(du);for n=1:8000t(n)=data(n,1);endfor n=1
2、:8000data1(n)=data(n,2);end%subplot(2,1,1);plot(t,data1)xlabel(时间/ms);ylabel(幅值);z0=fft(data1);Ts=6.64e-7;Ws=1/Ts;Wn=Ws/2;n1=linspace(0,Wn,length(t)/2);z1=abs(z0(1:length(t)/2);subplot(2,2,3);plot(n1,z1);xlabel(频率/Hz);ylabel(幅值);z3=fft(data3);Ts3=6.64e-7;Ws3=1/Ts;Wn3=Ws3/2;n3=linspace(0,Wn3,length(t3)/2);z4=abs(z3(1:length(t3)/2);subplot(2,2,4);plot(n3,z4);xlabel(频率/Hz);ylabel(幅值);-