DSPRelated.com
Forums

complex output from matlab IFFT

Started by jere...@gmail.com March 13, 2006
Why am i getting complex output when i compute the inverse fft of a
vector of complex numbers? This does not happen always and the
imaginary part of the output is very small compared to the real part.

thanks for any insight

jeremy

ok this is really dumb...i will reply to myself!
rounding errors contribute to this, should take real(ifft(s)) or
abs(ifft(s)), i think there is not much difference since imaginary
parts are really small.

jeremy

jeremyscerri@gmail.com schrieb:

> ok this is really dumb...i will reply to myself!
Don't worry, I sometimes do that as well. Often just asking the question out loud is enough to find the answer.
> rounding errors contribute to this, should take real(ifft(s)) or > abs(ifft(s)), i think there is not much difference since imaginary > parts are really small.
In your original post, you wrote that the IFFT of a complex vector gave you a complex vector. In general, that is perfectly valid. You can only expect a real-valued output if the frequency domain vector has Hermitian symmetry. In that case, just discard the imaginary IFFT output - don't take the absolute of the IFFT, as the real output could become negative (you'd lose that information in the abs() routine). Regards, Andor
> > jeremy
10x for highlighting the difference bweteeen the real() and abs(). As
for the Hermitian symmetry property, i never heard of this, if you
could elaborate more or point out some links, would be gratefull.

jeremy

<jeremyscerri@gmail.com> wrote in message
news:1142352880.796375.229350@z34g2000cwc.googlegroups.com...
> 10x for highlighting the difference bweteeen the real() and abs(). As > for the Hermitian symmetry property, i never heard of this, if you > could elaborate more or point out some links, would be gratefull. > > jeremy
"10x" ?? That's a first...is this what results from too much SMS use?
Bhaskar Thiagarajan wrote:
> <jeremyscerri@gmail.com> wrote in message > news:1142352880.796375.229350@z34g2000cwc.googlegroups.com... > >>10x for highlighting the difference bweteeen the real() and abs(). As >>for the Hermitian symmetry property, i never heard of this, if you >>could elaborate more or point out some links, would be gratefull. >> >>jeremy > > > "10x" ?? That's a first...is this what results from too much SMS use?
It took me a while to realize that it's not an optical magnification, but a crypto-cutsie "thanks". The writer needs to take the fourth bullet in http://users.erols.com/jyavins/procfaq.htm to heart. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:
> Bhaskar Thiagarajan wrote: > > <jeremyscerri@gmail.com> wrote in message > > news:1142352880.796375.229350@z34g2000cwc.googlegroups.com... > > > >>10x for highlighting the difference bweteeen the real() and abs().
it's the same as the difference bweteeen Re(z) and |z| in any complex mathematics textbook.
> >> As > >>for the Hermitian symmetry property, i never heard of this, if you > >>could elaborate more or point out some links, would be gratefull. > > > > "10x" ?? That's a first...is this what results from too much SMS use? > > It took me a while to realize that it's not an optical magnification, > but a crypto-cutsie "thanks".
if that's the case, it's really a stretch. i want my "10x". (i intend to sell it on eBay.)
> The writer needs to take the fourth bullet > in http://users.erols.com/jyavins/procfaq.htm to heart.
or at least take it to "brain". jeremy, the FFT or iFFT of a real input results in X(N-n) = conj(X(n)). if the input to the FFT or iFFT satisfies that symmetry, you can expect purely real output. if not, you cannot. roundoff error might result where the input satisfied such symmetry but resulted in very tiny imaginary parts which you should ignore (using real() in MATLAB). r b-j
jeremyscerri@gmail.com wrote:

> ... or point out some links, would be gratefull.
http://en.wikipedia.org/wiki/Discrete_Fourier_transform#The_real_DFT
comp.dsp should include this in the acronyms list...

jeremy

jeremyscerri@gmail.com wrote:
> comp.dsp should include this in the acronyms list...
We can do without cutsie for cutsie's sake, thank you. Even "tnx" is off the mark, but it's better, and as short. Much slang supports an "us vs. them" outlook; knowing the meaning shows that one is part of the "in" group. Everybody is welcome in comp.dsp, even those who struggle with English. There is no need to demonstrate one's "membership". Remember: this is a quasi-professional international forum, not a chat room where quick turnaround can outweigh clarity and precision of expression. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;