[Matlab] 短时傅里叶变换spectrogram函数

Matlab 文档:https://ww2.mathworks.cn/help/signal/ref/spectrogram.html#bultmx7-x

调用:[~,f,t,ps] = spectrogram(data,opt.window,opt.noverlap,freqRange(1):freqRange(2),sample_freq,'reassigned');

有两个细节:reassigned 解释如下:

[___] = spectrogram(___,'reassigned') reassigns each PSD or power spectrum estimate to the location of its center of energy. If your signal contains well-localized temporal or spectral components, then this option generates a sharper spectrogram.

示例:

openExample('signal/ReassignedSpectrogramOfQuadraticChirpExample')

这是我自己花了两张对比图,效果如下:

图1 无reassign选项

 图2 有reassign选项

原文地址:https://www.cnblogs.com/virter/p/14130408.html