Talk About Network

Google





Graphics > Image processing > Phase of sine w...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 4927 of 4998
Post > Topic >>

Phase of sine wave or cosinus, fourier transform

by thomas.greenleaf@[EMAIL PROTECTED] Nov 27, 2008 at 01:11 AM

If i generate a signal, using matlab, like this
t=3D0:0.001:1;
y=3Dsin(2*pi*t*17+2);
then I get a sine wave with frequency 17, amplitude 1 and phase****ft
2.

If I then calculate a fast fourier transform
ft =3D fft(y);
and look at the phase for the correct frequency
phase =3D angle(ft(18)); //1 is DC component,s=E5 index is ****fted by one
then I get 0.4822 radians or 37.6 degrees

Initially I expected to get 2, which was the ****ft I used, but after a
little consideration it was obvious that to measure a phase ****ft of
zero one would need to have a cosine wave with a phase ****ft of 0 and
to measure 2 it would have to be a cosine wave with a ****ft of 2.
In other words, I should not generate a sine wave but a cosine wave if
I want to get the correct phase back.

I am somewhat new to fourier transform s=E5 I may be missing something,
but is my thinking correct about this?
I can see why it will work with cosine and not sine, but all the
previous sound generation I have done have been sines.

Perhaps I can be more specific about how I try to look at things.
For a frequency such as 17 (Hz in my example) you have a basis
function exp(-2*pi*t*17*i).
This describes a rotating vector initially the real value 1, but as t
goes from 0 to 1, it will rotate counter clockwise in the complex
plane. When t is 0.25 it will point at 0+i and so on.

When you fold the signal f(t) with the basis g(t) you will, for t=3D0,
get f(0)*1. For t=3D1/17/2 (which is half a full wave) you will get f
(1/17/2)=3D-1. At that time g is also -1, so you get -1*-1=3D1, same as
for f(0).
Point being... the integral of f(t)*g(t) over t will return a complex
number which is 1+0i. The angle of that is zero, and the phase ****ft
of the cosine wave was zero, so it works out. For a sine it would not.

Should I just forget about sinewaves and simply look at the signals as
cosine waves and then just work with the transform and its inverse by
considering complex numbers and ignoring the sine/cosine waves it
represent?
 




 3 Posts in Topic:
Phase of sine wave or cosinus, fourier transform
thomas.greenleaf@[EMAIL P  2008-11-27 01:11:52 
Re: Phase of sine wave or cosinus, fourier transform
Martin Leese <please@[  2008-11-27 18:38:37 
Re: Phase of sine wave or cosinus, fourier transform
thomas.greenleaf@[EMAIL P  2008-11-27 23:13:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Thu Jan 8 19:50:02 PST 2009.