Re: FFT phase errors

From: Martin Leese (please_at_see.Web.for.e-mail.INVALID)
Date: 01/19/05

  • Next message: Martin Leese: "Re: Generation of pseudo colors LUT"
    Date: Tue, 18 Jan 2005 19:16:34 -0700
    To:  attackack@yahoo.com
    
    

    attackack@yahoo.com wrote:

    > I've a c++ code about FFT and when i calculate the phase parameters i
    > see some errors. In a PDF file about FFT i've seen that:
    >
    > ''...this error occurs whenever the real part is negative. This problem
    > can be
    > corrected by testing the real and imaginary parts after the phase has
    > been
    > calculated. If both the real and imaginary parts are negative, subtract
    > 180°
    > (or PI radians) from the calculated phase. If the real part is negative
    > and the
    > imaginary part is positive, add 180°(or PI radians). Drill this into
    > your mind. You have to see the phase only
    > extending to ±1.5708.
    > The smallest possible value is always chosen, keeping
    > the phase between -PI and PI.
    > It is often easier to understand the phase if it does not have these
    > discontinuities, even if it means that the phase extends above PI, or
    > below -PI.
    > This is called unwrapping the phase.
    > .............''
    >
    > Now i ask...there is a c++ code that calculate the phase correctly whit
    > all the different options?
    > P.S.: naturally i have real and imaginary component by FFT.

    The inherent problem is that phase is cyclical so,
    when you represent it with a finite variable, you
    get discontinuities. These discontinuities are not
    errors, merely a limitation of how quantities are
    represented inside a computer.

    One solution is to *display* the phase using a
    representation that is also cyclical. An example
    is a pseudocolour look-up-table which starts and
    ends with the same colour.

    Another solution is to leave the phase in its real
    and imaginary components, perhaps normalized. This
    maintains its cyclical nature

    -- 
    Regards,
    Martin Leese
    E-mail: please@see.Web.for.e-mail.INVALID
    Web: http://members.tripod.com/martin_leese/
    

  • Next message: Martin Leese: "Re: Generation of pseudo colors LUT"

    Relevant Pages

    • DFT Function
      ... FFT) purely for educational purposes. ... it appears correct if the input is just a cosine wave with ... imaginary component of the input or output. ...
      (sci.math)
    • FFT Fourier code
      ... I'm trying to implemet the code about FFT or DFT but i can't ... now i need the real and the imaginary component from them to use FFT ...
      (comp.programming)
    • Floating point Mathematics
      ... I am working on a project to implement an FFT using an FPGA. ... FFT i would need to use floating point numbers. ... I would prefer to implement a fix point representation. ...
      (comp.lang.vhdl)
    • FFT numeric range?
      ... I'm trying to integrate fftw into the netpbm ... I'm currently struggling to find a representation ... for the FFT transformed data. ... of the range of values for FFT, ...
      (sci.image.processing)