短时傅里叶变换matlab程序Word下载.docx

上传人:wj 文档编号:220616 上传时间:2023-04-28 格式:DOCX 页数:3 大小:7.04KB
下载 相关 举报
短时傅里叶变换matlab程序Word下载.docx_第1页
第1页 / 共3页
短时傅里叶变换matlab程序Word下载.docx_第2页
第2页 / 共3页
短时傅里叶变换matlab程序Word下载.docx_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

短时傅里叶变换matlab程序Word下载.docx

《短时傅里叶变换matlab程序Word下载.docx》由会员分享,可在线阅读,更多相关《短时傅里叶变换matlab程序Word下载.docx(3页珍藏版)》请在冰点文库上搜索。

短时傅里叶变换matlab程序Word下载.docx

%WinLen汉宁窗长度(默认值64);

%SampFreq信号的采样频率(默认值1);

讦(nargin<

1),

errorfAtleastoneparameterrequired!

1);

end;

Sig=real(Sig);

SigLen=length(Sig);

if(nargin<

4)z

SampFreq=l;

end

3),

WinLen=64;

2),

nLevel=513;

nLevel=ceil(nLevel/2)*2+l;

WinLen=ceil(WinLen/2)*2+l;

WinFun=exp(-6*linspace(-l,l/WinLen).A2);

WinFun=WinFun/norm(WinFun);

Lh=(WinLen-l)/2;

Ln二(nLevel-l)/2;

Spec=zeros(nLevel,SigLen);

wait=waitbar(O/Undercalculation,pleasewait...1);

foriLoop=l:

SigLen,

waitbar(iLoop/SigLen,wait);

iLeft二min([iLoop・l丄h丄n]);

iRight=min(⑸gLen-iLoop丄h,Ln]);

ilndex=-iLeft:

iRight;

ilndexl=ilndex+iLoop;

ilndex2=ilndex+Lh+l;

lndex=ilndex+Ln+1;

Spec(lndex,iLoop)=Sig(ilndexl).*conj(WinFun(ilndex2));

end;

close(wait);

Spec=fft(Spec);

Spec=abs(Spec(l:

(end-l)/2/:

));

Freq=linspace(0/,(nLevel-l)/2)*SampFreq;

t=(O:

(SigLen-l))/SampFreq;

elf

set(gcf;

Position1,[20100500430]);

setfgcf/Color'

/w1);

axesfTosition'

!

]);

mesh(t,Freq,Spec);

axis([min(t)max(t)0max(Freq)J);

colorbar

xlabel('

t/s'

);

ylabelff/Hz'

title('

STFT时频谱图'

axes(,Position,,[]);

plot(t,Sig);

axistight

ylabelCx(t)'

);

title/时域波形J;

axesfPosition'

J]);

PSP=abs(fft(Sig));

Freq=linspace(0,l,SigLen)*SampFreq;

plot(PSP(l:

end/2),Freq(l:

end/2));

titled频谱!

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > IT计算机 > 电脑基础知识

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2