0

Real-input FFT is usually expressed rfft and inverse is irfft in many programming languages (like python or julia). As numpy docs or julia docs said, they are doing normalized FFT not like FFTW's unnormalization FFT

Hence, if I have real input 1D array a, I understood irfft(rfft(a), len(a)) == a. However, if I assume another 1D array b but complex, rfft(irfft(b), (len(b) - 1) * 2) != b, even I considered normalization. I think rfft(irfft(b), (len(b) - 1) * 2) should be same as b like a.

I tested this using FFTW by Fortran and Julia's FFTW library but got a same results.

Why this happens? Is this mathematically right or implementation issue?

EDIT 1: more exact explanation is here

Jongsu Liam Kim
  • 717
  • 1
  • 7
  • 23
  • 2
    Because `irfft` and `rfft` only work on the real component of `b`, and ignore the imaginary part. Unless your array `b` has all zero imaginary components? – meowgoesthedog Aug 08 '17 at 15:05
  • Aha! thank you! I removed all imaginary part and then check the results, then it shows same original array (without imaginary part) – Jongsu Liam Kim Aug 08 '17 at 15:09

0 Answers0