Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Learning] FFT in Qt using FFTW
QtWS25 Last Chance

[Learning] FFT in Qt using FFTW

Scheduled Pinned Locked Moved General and Desktop
6 Posts 5 Posters 7.5k Views
  • 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 Offline
    J Offline
    jafarabadi.qt
    wrote on last edited by
    #1

    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
    0
    • M Offline
      M Offline
      MuldeR
      wrote on last edited by
      #2

      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
      0
      • J Offline
        J Offline
        jafarabadi.qt
        wrote on last edited by
        #3

        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
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #4

          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
          0
          • J jafarabadi.qt

            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 Offline
            R Offline
            rabeb
            wrote on last edited by
            #5

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

            ? 1 Reply Last reply
            0
            • R rabeb

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

              ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              @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
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved