1. An implantable medical device (IMD) comprising: a memory; an analog to digital converter (ADC) configured to receive an analog waveform and sample the waveform into digitized data; a predictive encoding module operatively coupled with the ADC to generate an encoded waveform data point for each of an equivalent data point from a subset of the digitized data; and an entropy encoding module operatively coupled with the predictive encoder and configured to replace one or more encoded waveform data points with a codeword for a data point or for a predefined string of data points when a predetermined condition is met, wherein the codeword is stored into the memory when the predetermined condition is met or the encoded waveform data point is stored into the memory when the predetermined condition is not met.