gpt4 book ai didi

matlab - 我可以调整频谱图频率轴吗?

转载 作者:太空宇宙 更新时间:2023-11-03 19:42:52 26 4
gpt4 key购买 nike

MATLAB documentation examples for the spectrogram function给出了将频率轴设置为 [0 500] 的示例。我可以将其更改为类似 [0 100] 的内容吗?显然运行 axis 命令会为我做这件事,但这会调整最终结果并“破坏”结果图,使其像素化。我基本上是想构建一个只查找 0-100 之间频率的频谱图,而不是在构建频谱图后重新缩放。

这是该文档中的一个示例:

T = 0:0.001:2;
X = chirp(T,0,1,150);
spectrogram(X,256,250,256,1E3,'yaxis');

这会产生以下内容: Linear chirp spectrogram

所有低于 350Hz 的东西都是不需要的。有没有办法在构建频谱图时不包括 350 到 500 之间的所有内容,而不是事后调整轴?

最佳答案

来自文档:

[S,F,T] = spectrogram(x,window,noverlap,F) uses a vector F of frequencies in Hz. F must be a vector with at least two elements. This case computes the spectrogram at the frequencies in F using the Goertzel algorithm. The specified frequencies are rounded to the nearest DFT bin commensurate with the signal's resolution. In all other syntax cases where nfft or a default for nfft is used, the short-time Fourier transform is used. The F vector returned is a vector of the rounded frequencies. T is a vector of times at which the spectrogram is computed. The length of F is equal to the number of rows of S. The length of T is equal to k, as defined above and each value corresponds to the center of each segment.

这对你有帮助吗?

关于matlab - 我可以调整频谱图频率轴吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12808147/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com