Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    [Learning] FFT in Qt using FFTW

    General and Desktop
    5
    6
    6367
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jafarabadi.qt last edited by

      h1. How to compute FFT using FFTW in Qt

      h2. Getting Start

      Note that I do this in Ubuntu operating system, in Windows some steps are different.

      • Step1: Download FFTW ([[http://www.fftw.org/download.html]])

      • Step2: Extract and Configure it (my path: /home/jafarabadi/Documents/fftw-3.3.4)
        @cd /home/jafarabadi/Documents/fftw-3.3.4
        chmod +x configure
        ./configure
        make
        make install@

      • Step 3: Add library to project: first open [your_project_name].pro file in Qt Creator and add this line:
        @LIBS += -lfftw3@

      • Step 4: Example
        @#include <fftw3.h>@
        @int N;

      fftw_complex *in, out;
      in = (fftw_complex
      ) fftw_malloc(sizeof(fftw_complex)N);
      out = (fftw_complex
      ) fftw_malloc(sizeof(fftw_complex)*N);

      fftw_plan my_plan;
      my_plan = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
      fftw_execute(my_plan);

      fftw_destroy_plan(my_plan);
      fftw_free(in);
      fftw_free(out);

      // A short tutorial: http://www2.math.uu.se/~figueras/fftw_tutorial/text/fftw_tutorial.pdf@

      • Step 5: Enjoy :) [Written by Ali Jafarabdi :: Qt is an awesome programming language.]
      R 1 Reply Last reply Reply Quote 0
      • M
        MuldeR last edited by

        Sorry, I know FFTW is great for computing discrete Fourier transforms, but in what way is this related to Qt? The FFTW build process is straight forward and you are not even using any Qt class whatsoever in your sample code...

        My OpenSource software at: http://muldersoft.com/

        Qt v4.8.6 MSVC 2013, static/shared: http://goo.gl/BXqhrS

        Go visit the coop: http://youtu.be/Jay...

        1 Reply Last reply Reply Quote 0
        • J
          jafarabadi.qt last edited by

          Hi MuldeR MuldeR :)
          before any thing please excuse me for my low English ability :(
          a week ago i need to compute FFT for first time, and i started to search in Google.
          in Qt case just found FFT for real-numbers :(
          when i found clFFT, cuFFT and FFTW it was so awesome for me
          but why i wrote it here:

          increase forum keywords and keep beginners in Qt-project.org

          as soon as possible i will start a new thread here which in it i will going to Compute FFT using FFTW on QMatrix and QVector (complex type container) that support complex and real numbers and casting it into FFTW complex types for executing FFT function. this temporary wrote to refer in my next thread.

          Thanks dear friend ;)

          1 Reply Last reply Reply Quote 0
          • hskoglund
            hskoglund last edited by

            Just to chime in with MuldeR, while computation of FFTW is good to know, the threads in these forums are more like questions and answers, i.e. first someone asks a question and then (hopefully) answers are posted.

            I have also grown to like Qt very much, so I started a Wordpress blog about it, it's free and in my blog I can talk about anything as much as I like, perhaps this is a good suggestion for you also?

            1 Reply Last reply Reply Quote 0
            • R
              rabeb @jafarabadi.qt last edited by

              @jafarabadi.qt
              How to compute FFT using FFTW in Qt in Windows

              ? 1 Reply Last reply Reply Quote 0
              • ?
                A Former User @rabeb last edited by

                @rabeb Hi! This thread is pretty old. I don't think @jafarabadi.qt is still around. The FFTW documentation states that they provide precompiled binaries (http://www.fftw.org/install/windows.html). Are you using these? What exactly is your problem?

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post