This project has moved and is read-only. For the latest updates, please go here.

Fourier Transformation

Aug 11, 2011 at 2:10 PM
Edited Aug 11, 2011 at 2:11 PM

Hello everybody,

I thought that Math.Net Numerics library is expected to run Fourier forward and backward transformations even on data with sizes different from power of 2. I think that both transformations work well on data of power of 2 size but I get unexpected results when running them on data of non-power of 2 sizes.

Thanks for answers


Aug 13, 2011 at 10:15 AM

Hi Pavel,

Yes, Transform.FourierForward / FourierInverse are supposed to support arbitrary vector lengths (Bluestein FFT). Can you reproduce the unexpected results in a short sample you can share publicly or with me, so I can have a look at it?


Aug 17, 2011 at 4:31 PM

Hi Christoph,

the signal I run it on has 967800 samples which is a size that surely does not fit into a forum post. I can send it in CSV format by email. Is that possible?

I can get anticipated resluts with the following procedure:

  1. Center the signal around zero (by subtracting average value from each sample).
  2. Zero-pad the signal to factor 2 length.
  3. Run FFT.

I think I should get equal result if the second step is skipped. However, the results differ.