时频分析的一段代码注解

《MATLAB R2016a完全自学一本通》第461页,例14-27。

使用短时傅里叶变换对线性扫描频率信号进行谱估计的命令如下:

MATLAB代码如下:

clear all;clc;close all;  %clear all清空工作区,clc清空命令(可能是clear command缩写),close all关闭所有窗口
T=0:0.001:2;
X=chirp(T,0,1,150);
subplot(121);plot(T,X);
xlabel('Time (Seconds)');ylabel('Amp');
subplot(122);[S,F,T,P]=spectrogram(X,256,250,256,1E3);
surf(T,F,10*log10(P),'edgecolor','none');axis tight;
xlabel('Time (Seconds)');ylabel('Hz');
view(0,90);
colorbar;

图片结果为:

  

其中,chirp函数用法,参看Swept-frequency cosine - MATLAB chirp - MathWorks 中国,部分翻译如下:

chirp:

扫频余弦(Swept-frequency cosine

语法(Syntax):

y=chirp(t,f0,t1,f1)

y=chirp(t,f0,t1,f1,'method')

y=chirp(t,f0,t1,f1,'method',phi)

y=chirp(t,f0,t1,f1,'quadratic',phi,shape)

说明(Description):

y = chirp(t,f0,t1,f1) generates samples of a linear swept-frequency cosine signal at the time instances defined in array t, where f0 is the instantaneous frequency at time 0, and f1 is the instantaneous frequency at time t1. f0 and f1 are both in hertz. If unspecified, f0 is e-6 for logarithmic chirp and 0 for all other methods, t1 is 1, and f1 is 100.

y = chirp(t,f0,t1,f1)在数组 t 中定义的时间实例中生成线性扫描余弦信号的样本,其中 f0 是时刻 0 的瞬时频率,f1 是时刻t1的瞬时频率。f0 和 f1 的单位都是赫兹(Hertz)。如果没有明确的数值,对于对数的扫频余弦,f0 取e^-6,其他情况下,f0 取0。t1默认取1,f1默认取100。

后面用法有用到再补充。

view函数用法参看:视点的指定 - MATLAB view - MathWorks 中国

转载于:https://www.cnblogs.com/zhangziyan/p/8809982.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值