1. In a waveform data analyzer that receives a sequence of waveform samples, wherein the sequence of waveform samples represents a waveform, and the waveform samples have one of at least two waveform states, a method of compressing the waveform samples, comprising: providing sets of codes associated with possible waveform states for representing waveform state sample vectors, the waveform state sample vectors including sequences of waveform samples having one of the at least two waveform states; determining amplitudes of waveform samples in the sequence, and classifying respective waveform samples into waveform states based on their amplitudes and the amplitudes of one or more of their neighboring waveform samples in the sequence defining sets of waveform samples including one or more consecutive waveform samples in the sequence as respective waveform state sample vectors based on the waveform states of the consecutive waveform samples; and encoding the waveform state sample vectors using the sets of codes to form compressed waveform data.