From: Budding MATLAB Jockey on
Okay this was spurred by the
"Understanding phase in the FFT"
thread

If you have an FFT of a sin wave how do you know the phase?
You can get your ratio of imaginary to real parts of the FFT conjugate output but how do you know which quadrant the angle is in?

Thanks!
From: Dave Robinson on
"Budding MATLAB Jockey " <chico1st(a)hotmail.com> wrote in message <houkoq$5e7$1(a)fred.mathworks.com>...
> Okay this was spurred by the
> "Understanding phase in the FFT"
> thread
>
> If you have an FFT of a sin wave how do you know the phase?
> You can get your ratio of imaginary to real parts of the FFT conjugate output but how do you know which quadrant the angle is in?
>
> Thanks!

It is encoded in the signs of the Real & Imaginary parts of the frequency component

1) Real is positive, Imaginary is positive --> Quadrant 1
2) Real is positive, Imaginary is negative --> Quadrant 2
3) Real is negative, Imaginary is negative --> Quadrant 3
4) Real is negative, Imaginary is positive --> Quadrant 4

Assuming a clockwise quadrant definition with 0 at 12ock.

If you are after further phase unwrapping it gets slightly more complicated.

Hope that helps

Dave Robinson
From: Wayne King on
"Budding MATLAB Jockey " <chico1st(a)hotmail.com> wrote in message <houkoq$5e7$1(a)fred.mathworks.com>...
> Okay this was spurred by the
> "Understanding phase in the FFT"
> thread
>
> If you have an FFT of a sin wave how do you know the phase?
> You can get your ratio of imaginary to real parts of the FFT conjugate output but how do you know which quadrant the angle is in?
>
> Thanks!

Hi, if you use atan2(imag(z),real(z)) that returns the four quadrant inverse tangent. You won't have any ambiguity about what the angle is, well other than the uncertainty that's part of computing the DFT value at that frequency index.

Wayne
From: Budding MATLAB Jockey on
> Hi, if you use atan2(imag(z),real(z)) that returns the four quadrant inverse tangent. You >won't have any ambiguity about what the angle is, well other than the uncertainty >that's part of computing the DFT value at that frequency index.
>
> Wayne

But the imaginary part of the fourier transform is positive on 1 side on negative on the other.

Which part do i use?
From: Wayne King on
"Budding MATLAB Jockey " <chico1st(a)hotmail.com> wrote in message <hovrnq$gdn$1(a)fred.mathworks.com>...
> > Hi, if you use atan2(imag(z),real(z)) that returns the four quadrant inverse tangent. You >won't have any ambiguity about what the angle is, well other than the uncertainty >that's part of computing the DFT value at that frequency index.
> >
> > Wayne
>
> But the imaginary part of the fourier transform is positive on 1 side on negative on the other.
>
> Which part do i use?

That's because the Fourier transform of a real-valued signal is conjugate symmetric. The Fourier transform at a "positive" frequency is the complex conjugate of the Fourier transform at the corresponding negative frequency. Accordingly, if the phase is pi/4 radians at a positive frequency, it is -pi/4 at the negative frequency. If you are using it to plot a phase response, the convention is to report (show) just the positive frequencies.

Of course, you should keep in mind that there is inherent uncertainty in the phase. That's why most phase response plots use unwrap().

Wayne