我可以调整频谱频率轴吗? [英] Can I adjust spectogram frequency axes?

查看:169
本文介绍了我可以调整频谱频率轴吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

spectrogram函数的 MATLAB文档示例给出了频率轴设置为[0 500]的示例.我可以将其更改为[0 100]之类的内容吗?显然,运行axis命令将为我完成此操作,但这会调整最终结果并炸毁"生成的图,使其像素化.我基本上是希望构建一个频谱图,该频谱图仅查找0-100之间的频率,而不在构建频谱图后重新缩放.

The MATLAB documentation examples for the spectrogram function gives examples that have the frequency axis set to [0 500]. Can I change this to something like [0 100]? Obviously running the axis command will do this for me, but that adjusts the end result and "blows up" the resultant plot, make it pixelated. I am basically looking to build a spectrogram that only looks for frequencies between 0-100, not rescaling after building the spectrogram.

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

Here's an example from that documentation:

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

这将产生以下结果:

This produces the following:

不需要任何低于350Hz的东西.构建光谱图时,是否有办法不包含350至500之间的所有内容,而不是事后调整轴?

Everything below 350Hz is unneeded. Is there a way to not include everything between 350 to 500 when building the spectrogram, rather than adjusting axes after the fact?

推荐答案

来自文档:

[S,F,T] =频谱图(x,window,noverlap,F)使用频率为Hz的向量F. F必须是至少包含两个元素的向量.这种情况下使用Goertzel算法以F处的频率计算频谱图.将指定的频率四舍五入到与信号分辨率相称的最接近的DFT格.在使用nfft或nfft的默认值的所有其他语法情况下,将使用短时傅立叶变换.返回的F向量是四舍五入频率的向量. T是计算频谱图的时间向量. F的长度等于S的行数.T的长度等于k(如上所述),每个值对应于每个段的中心.

[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.

这对您有帮助吗?

这篇关于我可以调整频谱频率轴吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆