Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 1.42 KB

README.md

File metadata and controls

18 lines (15 loc) · 1.42 KB

fft-from-scratch

This is a Python implementation of Fast Fourier Transform (FFT) in 1d and 2d from scratch and some of its applications in:

  • Photo restoration (paper texture pattern removal)
  • convolution (direct fft and overlap add fft method, including a comparison with the direct matrix multiplication method and ground truth using scipy.signal.convolve. It also includes a speed and accuracy comparison with torch.nn.Conv2d)
  • large integer multiplication.

The honeycomb pattern on old photos is due to the "silk finish" paper texture, which was used a lot back in the day. We can remove them in frequency domain using fft.

view on larger screen, small screen will show aliasing effect. We can use a low pass filter later.

achieves O(nlogn) complexity, whereas a direct matrix multiplication approach is O(n^2). It is more efficient when n is large.

inspired from the multiplication of polynomials in chap.30 of Introduction to algorithms book.