Refactor Fourier Temporal Pyramid function, adding more comments and
removing unneeded code.