对称频谱的iFFT [英] iFFT of symmetric spectrum

查看:163
本文介绍了对称频谱的iFFT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在对称频谱上执行iFFT(使用Python).为什么结果不是实值信号却包含复杂值?

I perform the iFFT on a symmetric spectrum (using Python). Why is the result not an real-valued signal but contains complex values?

# My symmetric spectrum
spectrum = numpy.array( [1+1j,2+2j,3+3j,3-3j,2-2j] )

# Perform the iFFT
print numpy.fft.ifft(spectrum)

输出:

(2.2+0.2j)
(-1.98979431354+0.2j)
(0.59464641547+0.2j)
(-0.74743281997+0.2j)
(0.942580718037+0.2j)

推荐答案

尝试如下:

# My symmetric spectrum
spectrum = numpy.array( [0+0j,1+1j,2+2j,3+3j,0+0j,3-3j,2-2j,1-1j] )

# Perform the iFFT
print numpy.fft.ifft(spectrum)

通常bin 0是DC,bin N/2是Nyquist,这两个值都是实数.对于其他术语,对称性是围绕奈奎斯特的复共轭.

Normally bin 0 is DC, bin N/2 is Nyquist, and both of these values are real. For the other terms the symmetry is complex conjugate around Nyquist.

使用八度音阶(MATLAB克隆),您得到的原始输入数据结果与您相同:

With Octave (MATLAB clone) I get the same result as you for your original input data:

octave-3.4.0:1> x = [1+1j,2+2j,3+3j,3-3j,2-2j];
octave-3.4.0:2> y = ifft(x)
y =

   2.20000 + 0.20000i  -1.98979 + 0.20000i   0.59465 + 0.20000i  -0.74743 + 0.20000i   0.94258 + 0.20000i

使用上面的输入数据,我得到的是纯粹真实的结果:

whereas with my input data above I get a purely real result:

octave-3.4.0:3> x = [0+0j,1+1j,2+2j,3+3j,0+0j,3-3j,2-2j,1-1j];
octave-3.4.0:4> y = ifft(x)
y =

   1.50000  -1.56066   0.00000   0.14645  -0.50000   0.56066  -1.00000   0.85355

我假设numpy可能使用相同的约定对FFT/IFFT输入/输出数据进行排序.

I assume that numpy probably uses the same comnventions for ordering FFT/IFFT input/output data.

这篇关于对称频谱的iFFT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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