Jump to content

  • Log In with Google      Sign In   
  • Create Account

Fourier Transform questions


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 staticVoid2   Members   -  Reputation: 292

Like
0Likes
Like

Posted 06 November 2011 - 10:30 AM

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?

Sponsor:

#2 barsiwek   Members   -  Reputation: 114

Like
1Likes
Like

Posted 06 November 2011 - 11:22 AM

1320597004[/url]' post='4881088']
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)

1320597004[/url]' post='4881088']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.

#3 jjd   Crossbones+   -  Reputation: 2122

Like
1Likes
Like

Posted 06 November 2011 - 12:15 PM

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


#4 staticVoid2   Members   -  Reputation: 292

Like
0Likes
Like

Posted 10 November 2011 - 07:12 AM

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?

#5 Álvaro   Crossbones+   -  Reputation: 13905

Like
1Likes
Like

Posted 10 November 2011 - 07:54 AM

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.

#6 staticVoid2   Members   -  Reputation: 292

Like
0Likes
Like

Posted 11 November 2011 - 07:03 AM

Thanks, I just never knew if e.g. (1 - i) was any different than (1 + (-i)) when talking about complex numbers.

#7 staticVoid2   Members   -  Reputation: 292

Like
0Likes
Like

Posted 11 November 2011 - 07:56 AM

What is confusing me even more now is that my lecture has given me this definition of a Fourier transform:


Posted Image


and on Wikipedia it has it as:


Posted Image

And the inverse transforms are pretty much these two again switched around and they are integrating with respect to omega. Which one is correct?

#8 Álvaro   Crossbones+   -  Reputation: 13905

Like
1Likes
Like

Posted 11 November 2011 - 08:18 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS