GuyRon1 / FFT-Hydrodynamic-sensing

This code is a fft algorithm used to analyze the vortex shedding freq
0 stars 0 forks source link

fft.fftshift #3

Open GuyRon1 opened 2 months ago

GuyRon1 commented 2 months ago

https://github.com/GuyRon1/FFT-Hydrodynamic-sensing/blob/78fc2824f8e2e1899d70a738c28c990df7fd24ae/process_fix.ipynb#L108

First of all thanks a lot for the help It was insightful. I looked over the code and the only part I couldn't understand was adding fft.fftshift. When searching, I learned this function moved zero freq components to the middle of the array but I couldn't understand what it means and why it affects the code if it is only for visualization purposes.

Thanks a lot!

alexlib commented 2 months ago

i suggest you to visualize the result of the ifft2 with and without fftshift - that's what I did and then I recalled that the convention of fft and fft2 and ifft2 is some specific order of the result. so fftshift is just a different order of the same values and later when we talk about the position of the peak - we define it relative to mid-windows. ifft2 is not providing it in this order