Fourier Transform questions

Started by
6 comments, last by alvaro 12 years, 5 months ago
I've been implementing a (Discrete) Fourier transform (and it's inverse) in C++ and was wondering about two things in particular,

1. How does e^-i (negative) differ from e^i when representing this using Euler's formula?

I know that anything to the power of a negative value is it's reciprocal (e.g. 2^-1 = 1/2) but I'm a bit confused whether this changes the Euler's formula (cos(w) + isin(w)) or not.

and

2. Why does the inverse Fourier transform get normalized at the end (i.e sum/numsamples) whereas the normal Fourier transform does not?
Advertisement

I've been implementing a (Discrete) Fourier transform (and it's inverse) in C++ and was wondering about two things in particular,

1. How does e^-i (negative) differ from e^i when representing this using Euler's formula?

I know that anything to the power of a negative value is it's reciprocal (e.g. 2^-1 = 1/2) but I'm a bit confused whether this changes the Euler's formula (cos(w) + isin(w)) or not.

e^-i = e^(-1)i = cos(-1) + isin(-1) = cos(1) - isin(1)
e^i = e^(1)i = cos(1) + isin(1)

and

2. Why does the inverse Fourier transform get normalized at the end (i.e sum/numsamples) whereas the normal Fourier transform does not?


Which one gets normalized is a convention. You could multiply the normal one instead of dividing the inverse one. The reason you have to do it is (vaguely) because when going from time domain to frequency domain your "unit of measure" changes from s to rad/s.

I know that anything to the power of a negative value is it's reciprocal (e.g. 2^-1 = 1/2) but I'm a bit confused whether this changes the Euler's formula (cos(w) + isin(w)) or not.


Barsiwek has answered your questions, but I just wanted to elaborate a little on this point.

Euler's formula gives exp(ia) = cos(a) + i * sin(a), and exp(-ia) is the reciprocal of exp(ia), so

exp(-ia) = 1 / (cos(a) + i * sin(a))

But mostly we don't like having imaginary numbers in the denominator so you can use this little trick,

exp(-ia) = (1 / (cos(a) + i * sin(a))) * ((cos(a) - i * sin(a)) / (cos(a) - i * sin(a))

where the new term is the compliment of cos(a) + i * sin(a) over itself, i.e. it is one. But now if we multiply through

exp(-ia) = (cos(a) - i * sin(a)) / (cos^2(a) + sin^2(a))

and since cos^2(a) + sin^2(a) = 1,

exp(-ia) = cos(a) - i * sin(a).

So, just using Euler's formula you can see that taking the reciprocal also works (as it should).

-Josh

--www.physicaluncertainty.com
--linkedin
--irc.freenode.net#gdnet

Thanks for your replies.

So if e^-i is cos(w) - isin(w) does this mean you just negate the imaginary part?

I'm filtering the signal in the frequency domain to blur the image and it seems to be working but after looking at the code I've realized that I'm not
accounting for the e^-i at all. The fourier transform and it's inverse seem to be practically identical apart from the normalization part I perform in the inverse.


Edit:

Ok, A problem I was having was that the image was transposed on output. I changed cos(w) + isin(w) to cos(w) - isin(w) by negating the imaginary part (in the forward fourier transform) and it seems to be outputting correctly now. I take it all I had to do was negate this imaginary part?

Thanks for your replies.

So if e^-i is cos(w) - isin(w) does this mean you just negate the imaginary part?

That should be e^(-iw). And yes, it does mean that, but you can deduce it yourself from Euler's identity and the fact that sin(-x) = -sin(x). You can answer most questions in Math yourself, and you should try to get in the habit of doing that.
Thanks, I just never knew if e.g. (1 - i) was any different than (1 + (-i)) when talking about complex numbers.
What is confusing me even more now is that my lecture has given me this definition of a Fourier transform:


fourier1.gif


and on Wikipedia it has it as:


fourier2.gif

And the inverse transforms are pretty much these two again switched around and they are integrating with respect to omega. Which one is correct?
It's a matter of convention, and I believe different fields use different conventions.

I think applying the 1/(2*pi) scale during the inverse transform is more common. I have even see people using 1/sqrt(2*pi) in front of both, thus making the transform and its inverse only differ by the sign in front of "iwt". All these options only differ in scale and perhaps one complex conjugation, so it's no big deal.

This topic is closed to new replies.

Advertisement