DSPRelated.com
Forums

Real and Complex FFT responses

Started by Bob August 19, 2003

Rune Allnor wrote:

> stenasc@yahoo.com (Bob) wrote in message news:<20540d3a.0308190001.7afc6596@posting.google.com>... > > Hi Folks > > > > Just a quick question to verify if I'm correct. > > > > In a real only FFT, I get a mirror image of the peaks in the output > > symmetrical > > about the half way number of points of the FFT. I know this is > > correct. > > > > However with the complex FFT, I only get the peaks(on one side > > only)...no mirror image. They are at the correct position. Can someone > > tell me if this is correct or not, and explain how this works? > > > > As usual, thanks in advance for all replies. > > > > Bob > > What you see is correct. To see why, check out the chapter on the > properties of the Fourier transform that is found in almost all basic > texts on DSP or Fourier analysis. There you will find an example > that amounts to > > F(-w) = F'(w) for f(t) real > > where F(w) is the Fourier transform of f(t) and F' is the complex > conjugate of F. > > So the "mirror" appears because of the "real-valuedness" of f(t) > and is not a property of the Fourier tranform as such. Complex-valued > data give no mirror images. > > Rune
Sounds right since the Fourier TF of a complex frequency exp(I.w0.t) = delta(w-w0) ie a single impulse - not two. If you take the FT of cos(wot) you will get two impulses however. Tom
"Bernhard Holzmayer" <holzmayer.bernhard@deadspam.com> a &#4294967295;crit dans le
message news: 2296981.FC1uc1BQzq@holzmayer.ifr.rt...
> Bernhard Holzmayer wrote: > > > Bob wrote: > > > >> Hi Folks > >> > >> Just a quick question to verify if I'm correct. > >> > >> In a real only FFT, I get a mirror image of the peaks in the > >> output symmetrical > >> about the half way number of points of the FFT. I know this is > >> correct. > >> > >> However with the complex FFT, I only get the peaks(on one side > >> only)...no mirror image. They are at the correct position. Can > >> someone tell me if this is correct or not, and explain how this > >> works? > >> > >> As usual, thanks in advance for all replies. > >> > >> Bob > > > > A very impressive demonstration (at least for me) is this: > > Given signals > > m1(t) = cos(t) + j*sin(t) and > > m2(t) = cos(t) - j*sin(t) (conjugate of m1) > > FFT(m1) gives you exactly one peak in the frequency domain, > > FFT(m2) gives another peak. > > FFT(m1+m2) gives both peaks (superposition, clear) > > Superposition in the time domain gives: > > m1(t)+m2(t) = 2cos(t), because the imaginary parts compensate. > > > > So you end up with the real function giving two peaks in the > > frequency domain. > > If you have access to Matlab, try it: > > > > clear i; > > t=[ 0; 0.1; 100]; > > m1=cos(t)+i*sin(t) > > m2=cos(t)-i*sin(t) > > plot(t,fft(m1)); > > plot(t,fft(m2)); > > plot(t,fft(m1+m2)); > > > > Bernhard > > > Sorry, I sent too fast :-) > It's the same thing for real and imaginary part of the FFT. > If you do the above, you get the result only by evaluation of the > real part of the FFT. > clear i; > t=[ 0; 0.1; 100];
for me , I have to type : t=[ 0: 0.1: 100];
> m1=cos(t)+i*sin(t) > m2=cos(t)-i*sin(t) > plot(t,imag(fft(m1))); > plot(t,imag(fft(m2))); > plot(t,imag(fft(m1-m2))); > > The other sign in the last line comes from this: > m1-m2 = cos(t)-cos(t)+j*sin(t)-(-j*sin(t)) = 2jsin(t) > > Bernhard > > -- > before sending to the above email-address: > replace deadspam.com by foerstergroup.de
Lotfi wrote:

> for me , I have to type : > t=[ 0: 0.1: 100];
Thanks for the correction. Sorry, I typed it manually - Matlab is on the other PC.. not here. So you get this: clear i; t=[ 0: 0.1: 100]; % for real part: m1=cos(t)+i*sin(t) m2=cos(t)-i*sin(t) plot(t,fft(m1)); plot(t,fft(m2)); plot(t,fft(m1+m2)); % and, for imag part: m1=cos(t)+i*sin(t) m2=cos(t)-i*sin(t) plot(t,imag(fft(m1))); plot(t,imag(fft(m2))); plot(t,imag(fft(m1-m2))); Bernhard -- before sending to the above email-address: replace deadspam.com by foerstergroup.de
On Thu, 11 Sep 2003 12:11:57 +0200, Bernhard Holzmayer
<holzmayer.bernhard@deadspam.com> wrote:

   (snipped)
> >clear i; >t=[ 0: 0.1: 100]; > >% for real part: > >m1=cos(t)+i*sin(t) >m2=cos(t)-i*sin(t) >plot(t,fft(m1)); >plot(t,fft(m2)); >plot(t,fft(m1+m2)); > >% and, for imag part: > > m1=cos(t)+i*sin(t) > m2=cos(t)-i*sin(t) > plot(t,imag(fft(m1))); > plot(t,imag(fft(m2))); > plot(t,imag(fft(m1-m2))); > > >Bernhard
Hi Bernhard, For anyone new to signal processing, it's *VERY *VERY* useful to experiment with code like yours. It helps give physical meaning to Euler's equations. It helps make all of these 'real' and 'imaginary' signals "real". :-) [-Rick-]
Rick Lyons wrote:

> On Thu, 11 Sep 2003 12:11:57 +0200, Bernhard Holzmayer > <holzmayer.bernhard@deadspam.com> wrote: > > (snipped) >> >>clear i; >>t=[ 0: 0.1: 100]; >> >>% for real part: >> >>m1=cos(t)+i*sin(t) >>m2=cos(t)-i*sin(t) >>plot(t,fft(m1)); >>plot(t,fft(m2)); >>plot(t,fft(m1+m2)); >> >>% and, for imag part: >> >> m1=cos(t)+i*sin(t) >> m2=cos(t)-i*sin(t) >> plot(t,imag(fft(m1))); >> plot(t,imag(fft(m2))); >> plot(t,imag(fft(m1-m2))); >> >> >>Bernhard > > Hi Bernhard, > > For anyone new to signal processing, > it's *VERY *VERY* useful to experiment with > code like yours. It helps give physical > meaning to Euler's equations. It helps > make all of these 'real' and 'imaginary' > signals "real". :-) > > [-Rick-]
Thanks, I appreciate your opinion. Bernhard -- before sending to the above email-address: replace deadspam.com by foerstergroup.de