Matlab 的频谱图过时与频谱图替换
在 Matlabs 最新版本中,specgram
函数被 spectrogram
取代,文档指出:
注意。要为删除的频谱图函数获得相同的结果,请指定长度为 256 的“Hann”窗口。
不幸的是,如果我使用频谱图( signal,hann(256)),结果与 specgram(signal)
不同,尽管两者非常相似。有没有办法获得完全相同的输出?
In Matlabs recent versions, the specgram
function is being replaced by spectrogram
, and the documentation states:
Note. To obtain the same results for the removed specgram function, specify a 'Hann' window of length 256.
Unfortunately, that doesn't seem to work for me, if I use spectrogram(signal,hann(256))
, the result is different from specgram(signal)
, although both are quite similar. Is there a way to get the exact same output?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,我只是偶然发现了解决方案:
specgram(singal) =spectrogram(signal, hanning(256))
因为
hann
和hanning
不是' Matlab 中也有同样的事情。感谢大家的支持。
Well, I just stumbled upon the solution:
specgram(singal) = spectrogram(signal, hanning(256))
since
hann
andhanning
aren't the same thing in Matlab.Thanks everyone for the support.
我相信它们在每个函数中的计算有点不同。这是我能得到的最好的:
I believe they are computed a bit differently in each function. This is the best I could obtain:
我目前没有 Matlab 可以尝试,但是
hann(256,'periodic')
可能就是您要找的。I don't currently have Matlab to try, but
hann(256,'periodic')
might be what you're looking for.