ejmahler / RustFFT

RustFFT is a high-performance FFT library written in pure Rust.
Apache License 2.0
678 stars 47 forks source link

output multiplied by n when doing fft forward then inverse of length n #103

Closed epita-whatever closed 1 year ago

epita-whatever commented 1 year ago

Hi, I've been messing around with the library to familiar myself with it. I wanted to test how precise it was so I did a fft forward then an inverse (both of length n) on the result and compared it to the initial input. However I find that the result correspond to the initial input with a factor of n. I've been looking in the library and did some research but I just can't find a reason for it to that.

Is there something I'm missing ? Or is it a bug issue ?

WalterSmuts commented 1 year ago

https://docs.rs/rustfft/latest/rustfft/#normalization

epita-whatever commented 1 year ago

How did I missed it ... I'm so sorry and thank you.

WalterSmuts commented 1 year ago

Perhaps we need to draw more attention to it in the docs? Have it earlier and surrounded by "⚠️" or "🚨" characters?

epita-whatever commented 1 year ago

It might help but I think the issue is just me being an idiot.

HEnquist commented 1 year ago

Perhaps we need to draw more attention to it in the docs? Have it earlier and surrounded by "⚠️" or "🚨" characters?

Yeah there seems to be some confusion about this. It would probably be a good thing to make the normalization section more visible. Maybe a link from the "Usage" section? Or moving the whole Normalization up before cargo features