This paper proposes an accurate, compact, and generic method for representing spectral functions. The focus is on smooth functions, the case of most natural spectra. While pursuing the idea of using Fourier series expansion for its advantage in representation generality, we attempt to remove the problem of Gibbs phenomenon. The solution that we propose is a new method called symmetric extension. Given a smooth spectral function S1, we first generate a new function S2 which is a mirror reflection of S1 about the upper bound of the wavelength domain. Then we create another function U that merges S1 and S2, and apply Fourier expansion to U. Because the values of U at its boundaries are equal, Gibbs oscillation is largely reduced. Besides, since U is self symmetric, all sine terms in Fourier expansion vanish and therefore we only need to keep the cosine coefficients. These make our method not only accurate, but also compact. We have tested the method with a large number of real spectra of various types, and compared with the existing methods such as direct Fourier expansion and linear model. The numerical results have confirmed the advantages of the proposed method.