Knowledge of a truncated Fourier series expansion for a discontinuous
2
π
2\pi
-periodic function, or a truncated Chebyshev series expansion for a discontinuous nonperiodic function defined on the interval
[
−
1
,
1
]
[-1, 1]
, is used in this paper to accurately and efficiently reconstruct the corresponding discontinuous function. First an algebraic equation of degree M for the M locations of discontinuities in each period for a periodic function, or in the interval
(
−
1
,
1
)
(-1, 1)
for a nonperiodic function, is constructed. The M coefficients in that algebraic equation of degree M are obtained by solving a linear algebraic system of equations determined by the coefficients in the known truncated expansion. By solving an additional linear algebraic system for the M jumps of the function at the calculated discontinuity locations, we are able to reconstruct the discontinuous function as a linear combination of step functions and a continuous function.