English 中文(简体)
Discrete Fourier Transformation: 如何以偷窃的方式正确使用轮班
原标题:Discrete Fourier Transform: How to use fftshift correctly with fft

我想从数字上计算一下FFT在一阵列Y。 四种变换(代谢)为Y = 不变(-k^2/4)。

import numpy
X = numpy.arange(-100,100)
Y = numpy.exp(-(X/5.0)**2)

冷漠做法失败了:

from numpy.fft import *
from matplotlib import pyplot

def plotReIm(x,y):
    f = pyplot.figure()
    ax = f.add_subplot(111)
    ax.plot(x, numpy.real(y),  b , label= R() )
    ax.plot(x, numpy.imag(y),  r: , label= I() )
    ax.plot(x, numpy.abs(y),  k-- , label= abs() )
    ax.legend()


Y_k = fftshift(fft(Y))
k = fftshift(fftfreq(len(Y)))
plotReIm(k,Y_k)

真正的(Y_k)在积极和消极的价值观之间跳跃,这相当于一个跳跃的阶段,而这个阶段并不具有象征意义。 这当然不可取。 (这一结果在技术上是正确的,因为如果偷窃(Y_k)是Y., a(Y_k)会给大鼠带来预期的影响。)

这里,功能轮班使阵列单单增加,并相应改变Y_k。 奶粉(k、Y_k)不会通过将这种手术应用到这两种病媒而改变。

This changes appears to fix the issue:

Y_k = fftshift(fft(ifftshift(Y)))
k = fftshift(fftfreq(len(Y)))
plotReIm(k,Y_k)

www.un.org/Depts/DGACM/index_spanish.htm 如果需要独一无二的Y和Y_k,则采用这种方式是否正确?

上文提到的相反行动是:

Yx = fftshift(ifft(ifftshift(Y_k)))
x = fftshift(fftfreq(len(Y_k), k[1] - k[0]))
plotReIm(x,Yx) 

在本案中,。 明确指出,Y_k必须分类,使之与偷窃和偷窃(如果适用的话)的产出相符。

这些问题长期以来一直困扰着我: 输出和输入阵列是否始终如一,<代码>a[0]应当包含零频率术语,[1:n/2+1]应当包含正频术语,[n/2+1:]应当包含负频率术语,以便减少负频率:[假设参考],频率是独立的变数?

Gaussian的转变不是Gaussian的问题。

最佳回答

可以认为,公平贸易论坛是产生一套病媒的,每个途径都有一个振幅和阶段。 轮班业务将零角的参照点从FFT孔径的边缘改为原始输入数据矢量的中心。

成果的阶段(因而成为复杂病媒的真正组成部分)在完成时有时不太“假设”,特别是如果某些投入功能被打破,从而在公平贸易论坛的边缘周围不连续。 或者如果这些投入在FFT孔径中心周围是不对称的,FFT结果的阶段总是在轮班后为零。

轮班可以由N/2的病媒轮流进行,也可以简单地在FFT的结果中绕过旋转的标志,而后者可能更友好。

问题回答




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签