Optimal pulse width modulation (PWM) problem is an established method of generating PWM waveforms with low baseband distortion. In this paper we focused on computation of optimal switching angles of a odd PWM waveform for generating general odd symmetric waveforms. We introduce an exact and fast algorithm with the complexity of only O(n log2 n) arithmetic operations. This algorithm is based on transformation of appropriate trigonometric equations for each harmonics to a polynomial system of equations that is transferred to a special system of sum of powers. The solution of this system is carried out by modification of Newtonpsilas identity via Pade approximation and orthogonal polynomials theory and property of symmetric polynomials. Finally, the optimal switching sequence is obtained by computing the zeros of two orthogonal polynomials in one variable.