1

As far as I know the IFFT of spectrum which amplitude part is even symmetric and phase part is odd symmetric should be real.

Let's consider this example:

signal_spectrum = [1 2+i 3+2*i 4+8*i 5 4-8*i 3-2*i 2-i 1];

It's clear that this spectrum meets two conditions that I listed above. When I perform IFFT using Matlab I obtain:

signal= ifft(signal_spectrum) = 
   2.7778          
   0.8003 - 0.2913i
  -1.2861 + 1.0792i
   0.5218 - 0.9038i
  -0.0812 + 0.4604i
   0.0976 + 0.5536i
  -0.6329 - 1.0962i
   1.3343 + 1.1196i
  -2.5316 - 0.9214i

Obtained signal is complex-valued. Why? What's the problem?

A. Donda
  • 8,381
  • 2
  • 20
  • 49
Pawel
  • 29
  • 1
  • 3

1 Answers1

5

Just remove the last 1 from the vector :) The symmetry should be relative to the first element. You can think of it like circular buffer or one period of a periodical signal.

Dmitry Markin
  • 1,145
  • 8
  • 8
  • Thanks a lot, that was a point! The symmetry should be circular symmetry. I'm working on 'spectral substraction' algorithm in order to enhance speech signal quality. I have a frame of spectrum which contains 441 samples. I'm sure that it has circular symmetry, but the output of IFFT gives a complex array. The imaginary parts are really small (like e-20), but they still exist. If I ignore them and play the sound from real parts, the quality is preserved. However, I don't have any idea why this imaginary parts occur. Does anyone know what can be the reason? – Pawel Jan 03 '14 at 21:44
  • 1
    The floating point operations in the FFT are not symmetric, so their rounding will be different and errors do not cancel. A relative error of 1e-20 for a floating point operation can be ignored. It would be different if the real part were also of size 1e-10, but I assume that the signal will have a scale of about 1 or larger. – Lutz Lehmann Jan 04 '14 at 13:16