程序主要是用到一个自己编的短时傅里叶变换,
function [spec, freq]=STFT(sig, nlevel,winlen,sampfreq)
%计算信号的短时傅里叶频谱
%sig: 带分析信号
%nlevel:频率轴长度划分,默认512
% winlen: 汉宁窗长度,默认64
% sampfreq: 信号的采样频率,默认1
% sampfreq=100;
% t=0:1/sampfreq:5;
% sig=sin(2*pi*(5*t+4*t.^2));
% sig=sig+sin(2*pi*(45*t-4*t.^2));
% STFT(sig,512,128,100)
if (nargin<1),
error('at least one parameter required');
end
sig=real(sig);
siglen=length(sig);
if (nargin<4)
sampfreq=1;
end
if (nargin<3)
winlen=64;
end
if (nargin<2)
nlevel=512;
end
nlevel=ceil(nlevel/2)*2+1;
winlen=ceil(winlen/2)*2+1;
winfun=exp(-6*linspace(-1,1,winlen).^2);
winfu