函数numpy.fft.fftfreq的含义 [英] Meaning of the function numpy.fft.fftfreq

查看:146
本文介绍了函数numpy.fft.fftfreq的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我遇到了有关 FFT

Some days ago I came across this answer about the usage of the FFT

答案中有一段这样的代码:

In the answer there's a piece of code like this:

w = np.fft.fft(data)
freqs = np.fft.fftfreq(len(w))

我在numpy文档(

I read about the function fftfreq in the numpy documentation (here) and i found that it returns an array with the following content:

f = [0, 1, ...,   n/2-1,     -n/2, ..., -1] / (d*n)   if n is even
f = [0, 1, ..., (n-1)/2, -(n-1)/2, ..., -1] / (d*n)   if n is odd

在我的情况下, d var等于1,而 n 是偶数.

In my case, the d var is equal to 1 and n is an even number.

所以我的问题是: fftfreq 的目标到底是什么?

So my question is: what is exactly the aim of fftfreq?

我想知道它是否是一种三角形的窗口函数.

I was wondering if it was a sort of a triangular window function.

推荐答案

返回的浮点数组f包含频点中心,以每个采样间隔单位的周期为周期(起始为零).例如,如果样本间隔为秒,则频率单位为循环/秒.

The returned float array f contains the frequency bin centers in cycles per unit of the sample spacing (with zero at the start). For instance, if the sample spacing is in seconds, then the frequency unit is cycles/second.

fftfreq给出了可能的频率范围傅立叶变换.

fftfreq gives the range of possible frequencies of Fourier Transform.

这篇关于函数numpy.fft.fftfreq的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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