Marc-3d / quickPIV

MIT License
16 stars 4 forks source link

Use rfft and irfft for faster computation #5

Closed ErichZimmer closed 2 years ago

ErichZimmer commented 2 years ago

Using rFFTs and irFFTs, the FFT based cross correlations could be up to 75% faster (at least for the python wrapper of fftw3). Maybe take this into consideration to make quickPIV even more "quicker"?

Marc-3d commented 2 years ago

Thanks for the suggestion, I have to revisit the performance of real FFTs.

I remember that I ended up chosing complex-complex FFTs instead of real-complex FFT, because the latter cannot be performed in-place. Therefore, each call to rfft( real_image ) needs to allocate a new complex array for the output, and I believe this will eventually be slower than fft!, in-place complex-complex fft.

ErichZimmer commented 2 years ago

Maybe try using mul!() for real to complex ffts and ldiv!() for complex to real ffts so the fftw plan executions can be "in place"?

ErichZimmer commented 2 years ago

Using mul! and ldiv! with rffts showed no real benefits due to more steps involved in the processing chain.