Skip to content
Prev 387564 / 398502 Next

Weird (wrong?) result for fft

Hi Filippo,

Why do you expect these two expressions to produce the same output?
Especially the second expression contains the first expression. There is no
way to have the same result unless the function "fft( * , inverse = TRUE)"
does nothing but multiplies the input by the input's length. It does not
make any sense.

Actually, both results are correct as Jeff said. The first is the result of
discrete Fourier transform and the second is the reverse of the transform.
That's why the second output is the same as your variable "x". There are
some rounding errors in the computation so you might get very
small imaginary numbers after doing the reverse transformation. That's why
you see "0i" in the second output.

Best,
Jiefei
On Tue, Mar 23, 2021 at 12:17 AM Filippo Monari <ingfimo at gmail.com> wrote: