短时傅立叶变换matlab仿真程序.txt

上传人:聆听****声音 文档编号:700703 上传时间:2023-04-29 格式:TXT 页数:3 大小:3.39KB
下载 相关 举报
短时傅立叶变换matlab仿真程序.txt_第1页
第1页 / 共3页
短时傅立叶变换matlab仿真程序.txt_第2页
第2页 / 共3页
短时傅立叶变换matlab仿真程序.txt_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

短时傅立叶变换matlab仿真程序.txt

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

短时傅立叶变换matlab仿真程序.txt

clearall;

clc;

%------------------>BasicParameters<-----------------

f1=500;

f2=1000;

fN=8000;

n=10000;

t=0:

1/fN:

(n-1)/fN;

%------------------>Generatesignals<-----------------

sig1=sin(2*pi*500*t);

sig2=sin(2*pi*1000*t)/2;

puls=zeros(size(t));

puls(2100)=10;

puls(2132)=10;

x=sig1+sig2+puls;

%------------------>windowwidth<-----------------

win1=12.8*fN/1000;%12.8ms102.4points

win2=6.4*fN/1000;%6.4ms51.2points

win3=3.2*fN/1000;%3.2ms25.6points

%------------------>steppinglength<-----------------

stepping1=16;

stepping2=32;

stepping3=64;

%------------------>nfftpoints<-----------------

nfft=min(256,length(x));

%------------------>painting(TimeFrequencyAnalysis)<-----------------

%----->1.Hammingwindows,differentwindowwidth<-----------

figure

(1)

subplot(311);

specgram(x,nfft,fN,hanning(round(win3)));

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Hammingwindows,windowwidth3.2ms')

subplot(312);

specgram(x,nfft,fN,hanning(round(win2)));

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Hammingwindows,windowwidth6.4ms')

subplot(313);

specgram(x,nfft,fN,hanning(round(win1)));

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Hammingwindows,windowwidth12.8ms')

%-------------------------------------

%----->2.Gausswindow,differentwindowwidth<-----------

figure

(2)

subplot(311);

specgram(x,nfft,fN,gausswin(round(win3)));

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Gausswindow,windowwidth3.2ms')

subplot(312);

specgram(x,nfft,fN,gausswin(round(win2)));

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Gausswindow,windowwidth6.4ms')

subplot(313);

specgram(x,nfft,fN,gausswin(round(win1)));

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Gausswindow,windowwidth12.8ms')

%---------------------------------------

%------>3.Hammingwindows,differentsteppinglength<-----------

figure(3)

subplot(311);

specgram(x,nfft,fN,hanning(round(win1)),stepping1);

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Hammingwindows,windowwidth12.8ms,steppinglength16')

subplot(312);

specgram(x,nfft,fN,hanning(round(win1)),stepping2);

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Hammingwindows,steppinglength32')

subplot(313);

specgram(x,nfft,fN,hanning(round(win1)),stepping3);

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Hammingwindows,windowwidth12.8ms,steppinglength64')

%---------------------------------------

%------>4.Gausswindow,differentsteppinglength<-----------

figure(4)

subplot(311);

specgram(x,nfft,fN,gausswin(round(win1)),16);

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Gausswindow,windowwidth12.8ms,steppinglength16')

subplot(312);

specgram(x,nfft,fN,gausswin(round(win1)),32);

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Gausswindow,windowwidth12.8ms,steppinglength32')

subplot(313);

specgram(x,nfft,fN,gausswin(round(win1)),64);

xlabel('time(ms)')

ylabel('frequency(kHz)')

title('STFTTime-FrequencyMap,Gausswindow,windowwidth12.8ms,steppinglength64')

%---------------------------------------

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

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

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

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