In sonic well logging, a source-generated wave field is recorded at various points on the axis of a borehole. The recorded waveforms are extremely complicated because various wave components overlap in time and in frequency. I use the Karhunen-Loeve (KL) transformation, also known as principal-component analysis, to isolate a particular wave component of interest. The wave features of the primary P, S, and Stoneley waves are extracted by projecting (or transforming) the data into the KL space. The extracted wave features allow us to identify wave responses to different formations. Furthermore, the extracted features can be used as a data compression scheme. To reduce the computational burden, a quick way to obtain the approximations to the first and second eigenvectors, supplemented by a procedure to evaluate their accuracies, is given with the examples. Finally, although the examples appear only for the single-receiver waveforms, the technique, in principle, has direct extension to arrays of waveforms.