MATLAB: Overshoot of Fourier series for y=1-t

convergencefourier seriesovershoot

I have recently examined the overshoot of a Fourier series representation of the function 1-t. Included in the PDF file is a plot of the Fourier series approximation along with a plot of the overshoot vs the k value. The k value is the order of the Fourier series summation. I carried it out to 1000 terms. Since the max amplitude of 1-t is UNITY I defined the overshoot as the ratio of the peak amplitude of the approximation. The overshoot is less than UNITY for the k<10, but then after that it exceeds UNITY. It appears the overshoot approaches an asymptotic value above UNITY. However, I was under the impression that if you carry out the Fourier series to enough terms the overshoot will decay back to UNITY since the function will be represented more accurately. My plot indicates that I have the wrong impression.
Is there anyone out there that can comment on this. I also included a plot in the PDF file of the sum of the square of the differences between the Fourier series approximations and the function 1-t. The series is definitely converging, but I do not know about the overshoot. If the overshoot does approach an asymptotic value is there a way to determine that analytically?
I also included my m-file that generated the data for the plots. The plots are:
Pfit vs t
Ppeak vs k
err vs k
Appreciate any feedback

Best Answer

I found an analytical solution to the Gibbs overshoot: https://statweb.stanford.edu/~candes/acm126a/Hw/hw2sol.pdf
I also attached the pdf. The solution is on pages 6 & 7.
Related Question