Modify function for Gauss-Legendre of Fourier series