Results 1 to 4 of 4

Thread: fftw help

  1. #1
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question fftw help

    Hi
    I have a question regarding the way the data is stored in a 2d fourier transform. I am using a fftw_plan_dft_r2c_2d transform, and here is my question:

    From what i understand of 2d fourier transforms, the dc component lies in the centre of the transform, i.e. for a transform of size (nx,ny), the dc component would be at value (nx/2,ny/2).

    The fftw_plan_dft_r2c_2d transform returns a matrix of size (nx,ny/2+1). The dc component of this matrix is the value (0,0).

    So my question is, which part of the complete 2d fourier transform is reflected in the matrix? In other words, how do I obtain the actual 2d fourier transform from the (nx,ny/2+1) sized matrix i am getting by using the plan? I want to know this so i can design a filter for the same.

    With best regards,
    superutsav

    P.S. If anyone here could give me example code of image filter usage with fftw libraries i would be really grateful
    Last edited by superutsav; 10th April 2006 at 12:15.
    He who laughs last thinks slowest.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: fftw help

    You are probably getting just the (right -- positive) half of the transform as it should be (AFAIR) symmetric to the OY axis.

  3. #3
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: fftw help

    Quote Originally Posted by wysota
    You are probably getting just the (right -- positive) half of the transform as it should be (AFAIR) symmetric to the OY axis.
    Yes, thats exactly what i intially thought... but in that case the dc component will not be the (0,0) value... it will be the (0,nx/2) element...

    superutsav
    He who laughs last thinks slowest.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: fftw help

    If this is a 2D transform then the lowest frequencies are towards the middle of the transform, thus DC will be exactly in the middle (0,0). X axis gives you one dimension of FT and Y axis gives you the other one, so (0, nx/2) gives you the constant for one dimension interfered with "nx/2" frequency for the other. At least that's what I think I remember about FT

    And all that of course means you only have the quarter of the result and not half of it.

  5. The following user says thank you to wysota for this useful post:

    superutsav (11th April 2006)

Similar Threads

  1. Linking fftw, etc with qt
    By metanoya in forum Newbie
    Replies: 2
    Last Post: 15th June 2008, 20:13
  2. linking fftw 3.0.1
    By Yacob in forum General Programming
    Replies: 4
    Last Post: 18th January 2007, 15:14
  3. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  4. undefined reference to fftw libraries
    By kmyadam in forum General Programming
    Replies: 2
    Last Post: 9th March 2006, 01:01
  5. fftw unable to compile
    By superutsav in forum General Programming
    Replies: 7
    Last Post: 24th January 2006, 14:10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.