A compressor for waveforms having at least two waveform states separates
the waveform samples into waveform state sample vectors for each waveform
state. Waveform state encoders encode the waveform state sample vectors
separately to provide compressed waveform data. The waveform state
encoder selects waveform state pattern vector and associated codes to
represent the waveform state sample vectors. The differences between
samples of the waveform state sample vector and waveform state pattern
vector are calculated and encoded. Encoding can be lossless or lossy. The
waveform state pattern vectors and other parameters for compression are
determined during a training period. The waveform state encoders detect
features in the waveform state sample vectors and waveform state pattern
vectors that are useful for common oscilloscope measurements. Typical
waveform states include level states and edge states.