The pilot waveform that can suppress power spectral sidelobes while achieving accurate channel estimation is desirable for orthogonal frequency division multiplexing systems and standards. However, the conventional pilot waveforms either suffer large power spectral sidelobes or can suppress sidelobe power effectively only when the number of pilot subcarriers has a large positive integer power of two as a factor. To overcome the problem, two design procedures are proposed in the paper to construct spectrally compact pilot waveforms with optimal channel estimation even when the number of pilot subcarriers does not have a large positive integer power of two as a factor.