Help speeding up FFT processing code

As general remarks:

  • slicing A[i, :] creates a copy (-> more memory allocations), consider using @view
  • you can do a few operations in-place, like
    fft!(fftshift(ph0_rgb, 3), 3)
    
    and
    im0_rgb[i, :, :] .*= scale_factor
    
2 Likes