Code design for a specified power spectrum.