I was trying to fit some data to a Fourier series expansion, and ended up with the following:
Why is there no improvement near the gap when adding more terms to the expansion? I was hoping to get some kind of convergence like with the step-function.
Something like this:
I'm interested in the mathematical reason behind this. Why the approximation near the discontinuity zone doesn't improve?


The truncated Fourier series will always be a periodic continuous function. So, the Fourier series cannot converge uniformly to a periodic discontinuous function, because the uniform limit of a sequence of periodic continuous functions is a periodic continuous function. That means that the truncated Fourier series $S_n^f(x)$ for your function cannot converge uniformly. So, there exists an $\epsilon > 0$ such that, for every $N$ (no matter how large,) there will be $n,m \ge N$ and $x$ such that $|S_n^f(x)-S_m^f(x)| > \epsilon$. That's what it means for the series to not converge uniformly. The specifics of this leads to an explanation of the Gibbs phenomena.