Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8695341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:00:35+00:00 2026-06-13T01:00:35+00:00

I am using fftw3 lib for computing a fourier transform in c++. I have

  • 0

I am using fftw3 lib for computing a fourier transform in c++. I have to repeatedly call it with a different input array everytime. I am initializing my array (called ‘input’ in code ) just once with size MAX_ELEMS and then using it as input to the fftw_plan function (changing contents and their size) on every call. However I am changing my n_samples everytime according to actual size of my array (number of valid data samples in the array). I wanted to know if this will cause any problems in my implementation- execution/accuracy wise.

fftw_plan fftw_plan_dft_r2c_1d(int n_samples,
                                double *in, fftw_complex *out,
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T01:00:36+00:00Added an answer on June 13, 2026 at 1:00 am

    Ideally you want to pick a specific size of FFT and stick with it, for two reasons:

    • creating/destroying plans takes a lot of time relative to the FFT itself, so you’re throwing away any speed advantage from using FFTW if you create/destroy a plan for evert FFT you perform
    • the frequency resolution will be different for each different size of FFT, which could make interpretation of successive output data troublesome.

    Ideally you should use a fixed FFT size so that you create/destroy a plan just once.

    If your data stream is contiguous then just pick an appropriate FFT size, N, and accumulate samples in a buffer until you have N samples to process, and save the rest until you have N samples again.

    If your data is not contiguous then pick a reasonable size FFT, N, and then when you get < N samples you can pad the input with zeroes. When you get > N samples you can discard the extra samples.

    In all cases of course you must apply a suitable window function prior to the FFT.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using VB.Net2010 I need to call a C# DLL The problem I have is
Using RestKit 0.10.1, I have objects served similar to this json format: {objects: [
I'm trying to implement the Matlab fft2() function in C using the FFTW3 library.
Using MVC2 I have an AJAX form which is posting to a bound model.
The problem I have is that I open an Image from a GUI using
Using android 2.3.3, I have a background Service which has a socket connection. There's
I'm currently working with the FFTW2 (Fastest Fourier Transform in the West) library, and
Using online interfaces to a version control system is a nice way to have
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
Using C#, I need a class called User that has a username, password, active

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.