A class of weights is developed for minimizing the error in the approximation of a periodic function by a Fourier series with finitely many terms. The analysis is based on the following problem. Given a function

, find the extrema of the integral

as

ranges over all normalized trigonometric polynomials of specified order.