- 积分
- 26286
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-12-6
- 最后登录
- 1970-1-1

|

楼主 |
发表于 2018-12-15 19:49:55
|
显示全部楼层
%%------------------------------------------------------------------------
%%功能:使用MATLAB对特定信号做短时傅里叶分析
%%------------------------------------------------------------------------
fs=1024;
t=0:1/fs:2;
x=cos(2*pi*50*t).*(t>=0&t<1)+0.2*cos(2*pi*150*t).*(t>=1&t<2);
f=-500:0.1:0;
a=size(f)
subplot(2,1,1);
spectrogram(x,kaiser(60,5),20,f,fs,'yaxis');
title('Kaiser窗,时域宽度为60');
%%或者用下面的语句绘图
%[s,f,t,p]=spectrogram(x,kaiser(60,5),20,f,fs,'yaxis');
%surf(t,f,10*log10(abs(p)),'EdgeColor','none');
%axis xy;
%axis tight;
%colormap(jet);
%view(0,90);
%xlabel('Time');
%ylabel('Frequency (Hz)');
%%以上语句与用无输出参数的spectrogram相同
subplot(2,1,2);
spectrogram(x,kaiser(260,5),20,f,fs,'yaxis');
title('Kaiser窗,时域宽度为260');
http://www.ilovematlab.cn/thread-338529-1-1.html 刚才在ilovematlab找的文件,不知道对不对 |
|