1. In a waveform data analyzer that receives a sequence of one-dimensional waveform samples, wherein the sequence of waveform samples of amplitude versus time represents a waveform, and the waveform samples have a plurality of waveform states, a system for compressing the waveform samples, the system comprising: sets of codes associated with possible waveform states stored in memory for representing waveform state sample vectors, wherein the possible waveform states include at least two level states and at least one edge state, wherein the sets of codes provide a plurality of codes associated with each waveform state; a waveform state processor coupled to receive the waveform samples and producing one or more waveform state sample vectors, wherein the waveform state processor determines the amplitudes of the waveform samples in the sequence, classifies 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, and defines groups of waveform samples including one or more consecutive waveform samples in the sequence classified into one of the waveform states as respective waveform state sample vectors; and an encoder coupled to receive the waveform state sample vectors and produce compressed waveform data using the set of codes.