A piecewise regular function that
1. Has a finite number of finite discontinuities and
2. Has a finite number of extrema
can be expanded in a Fourier series which converges to the function at continuous points and the mean of the positive and negative limits at points of discontinuity.