0
$\begingroup$

I am interested to use the pffft library, available here:

https://bitbucket.org/jpommier/pffft/src/master/

I am currently using Intel MKL library, as well as a naive optimized reference implementation. Both of these work fine for me with the same data that I am trying to use with pffft.

Specifically while the forward FFT returns expected results, the inverse doesn't.

I am using the pffft_transform_ordered function, and 16byte aligned data.

For reference, my MKL settings are using DFTI_SINGLE, DFTI_COMPLEX.

$\endgroup$
1
  • $\begingroup$ Interesting. I encountered the same problem with pffft. The inverse FFT may be returning the results with the “wrong” order or scaling from your expectations. Test those two hypothesis. $\endgroup$
    – hotpaw2
    Commented Jun 17, 2021 at 4:12

1 Answer 1

0
$\begingroup$

the inverse doesn't.

Then you are probably doing something wrong, but since you didn't post your code or describe how the data is different then expected, we can't possibly tell what the problem is.

Standard debug steps:

  1. Read the documentation. There are different ways of ordering frequencies, scaling, managing complex data, etc. and all FFTs have their individual flavors of it. For example pffft doesn't do any scaling at all, so the inverse needs to be scaled by $1/N$
  2. Try some known test signals. Figure out which ones "pass" and HOW the "fails" are different from the expected result. You can try just DC, just Nyquist, a single frequency, a one tap delay, a gaussian, etc. All of these have known inverse FFTs that you can use as a reference.
  3. If all else fails you can simply implement an inverse FFT using a forward FFT on the complex conjugated frequency vector:

$$\mathcal{F}^{-1}(x) = \frac{1}{N} \cdot \mathcal{F}(x') $$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.