如何获取定义频段内的所有fft箱数量? [英] How do i get all the numbers of fft bins in a defined frequency band?
问题描述
我使用matlab软件.对我的问题.
我有一个音频信号,正在对其上应用STFT.我分段
我的信号y(audio signal)
中的(46 ms, specifially chosen)
,并在其上使用了FFT
.然后我转到下一个片段,直到音频信号结束.
I use the matlab software. To my question.
I have a audio signal, on which i am applying a STFT. I take a segment
(46 ms, specifially chosen)
out of my signal y(audio signal)
and use a FFT
on it. Then i go to the next segment, until to end of my audio signal.
我的WAV文件长10.8526秒.如果我的采样频率为
44100Hz,这意味着我的y
是10.8526*fs = 478599.66
在工作区中显示为478 6000 x2 double
.
My WAV-File is 10.8526 seconds long. If I have a sample frequency of
44100Hz, this means my y
is 10.8526*fs = 478599.66
which is
shown in the workspace as 478 6000 x2 double
.
我的fft
的长度是2048
.我的信号在[0 300]
,mfb [301 5000]
和hfb [5001 22050(fs/2)]
较低频段下有所区别.
The length of my fft
is 2048
. My signal are differentiated under lower frequency band [0 300]
, mfb [301 5000]
and hfb [5001 22050(fs/2)]
.
这些频段仅是示例,并非实际的matlab
代码. Basicall
我想要的(或我想做的)是获取定义频段中箱的值并对其进行算术平均值.
The bands are just an example and not the actual matlab
code. Basicall
what i want (or what I am trying to do), is to get the values of my bins in the defined frequency band and do a arithmetic mean on it.
我选择46毫秒是因为,我希望它与fft
长度一样长,或者几乎与fft
一样长. (It is not exact).Afterwards
,我想尝试绘制它,但是现在这并不重要.任何帮助表示赞赏.
I chose 46 ms because, I want it as long as the fft
length, or nearly as long as the fft
. (It is not exact).Afterwards
, I want to try plotting it, but that is not important right now. Any help is appreciated.
推荐答案
在大小为n的向量中进行时域信号的傅立叶变换,将返回在频率域中相同信号的大小为n的另一个向量.
Fourier transform of a signal in time domain in a vector of size n will return another vector of size n of same signal but in frequency domain.
频率域将从0(直流偏移)到您的采样频率.但是您将只能使用其中的一半.下半部分将具有相同的值,但会被镜像.
Frequency domain will be from 0 (dc offset) to your sampling frequency. But you will only be able to use half of that. Second half would have same values but mirrored.
您可以使用以下方法获得每个有用仓的中心频率:
You can obtain the center frequency of each useful bin with:
f = Fs*(0:(n/2))/n;
这篇关于如何获取定义频段内的所有fft箱数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!