I'm working on some oscillator classes right now and perform FFT around 100 times per second. The issue I'm running into is interpolating between the bins so there is not a noticeable change from each execution of FFT. I'm fairly new to using FFTW right now and I'm still getting to know its functions.

For some more context, I'm working on some spectral morph functions and other fun like that. As of right now, I'm not using SIMD for my interpolation and it's just a basic for loop that writes to a fftw_complex pointer based on the two fft_complex bins I'm interpolating on. The idea is that I only do FFT when needed, at a max of roughly 100 times per second, and between every n number of frames or so, calculate the interpolated bin between the current one and the last one. My FFT length is currently 2048 samples because I've found that's the sweet spot for CPU and low harmonics. This makes the FFT bin a size of [2048][2].

I'm also only a few months into SIMD, and plan on using it for the final interpolation algorithm. Am I missing an FFTW function that can do a lot of this for me, or is there some other method out their that is faster?

Edit: My bad - When I mean interpolating the bins, I am referring to them being in the time domain, not frequency. I am storing my waveform in the bin in time domain so I don't need to do memory stuff when I want to do forward FFT.

Second Edit: I suppose I was a little off, but I had the right idea. I was working with another FFT library for a while that did not allow easy conversions from complex objects to arrays. I was under the presumption that I had to be restrained to only using FFT bins. This clears a lot up

  • $\begingroup$ What do you mean interpolate between the bins? What is your goal: to find the true amplitude, or to morph, as you say? If the first, it might be impossible (for an exact result) but the second could be as simple as a*x+(1-a)*y. Or x^a*y^(1-a), or <insert_favourite_median>. Also, FFTW is an acronym for the "fastest FT in the West", and if it is so, it's for a reason. Which means trying to optimize an already optimized product might be fruitless. Though maybe not impossible, but from the way you described the problem, very plausible. $\endgroup$ – a concerned citizen Mar 31 at 15:34
  • $\begingroup$ Your terminology is really hard to understand. A "FFT bin" is typically the value of the FFT at a specific point on the FFT frequency grid and "interpolation between bins" means spectral interpolation within a single FFT frame in the frequency domain. I don't think that's what you mean at all. I'm guessing you are doing a short time Fourier transform with an irregular frame spacing and you want to interpolate spectra across time at each individual frequency. Is that correct ? $\endgroup$ – Hilmar Mar 31 at 17:02
  • $\begingroup$ @Hilmar Thanks, that actually clears a bit of stuff up. My apologies that my question was a little confusing. I have a much better idea for what to do now. $\endgroup$ – Sean Mar 31 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.