Source: http://home.strw.leidenuniv.nl/~keller/Teaching/AOT_2017/AOT_2017_Ex03_Fourier.pdf