Robert B. wrote: > M. Adam Davis wrote: > > I'm looking for a fast block oriented compression routine that works > > well on an 8bit microcontroller. Just blurt out some ideas or > > compression standards you think might fit - I'm prepared to do the > > research, I'd just like a good starting point. > > > > My input is going to be voice (8ksps, 8bits per sample, 64kbps total) > > and I'd like to be able to compress consistantly sized chunks into > > smaller consistantly sized chunks without any knowledge of previous or > > following data. > > The sampling method you've chosen is actually the voice transmission > standard for telephone, and there are quite a few applicable standards. > > ADPCM is a pretty good one that doesn't require much knowledge of the data > before or after, though all compression methods will require *some* > knowledge of whats going out. ADPCM simply stores a delta-amplitude instead > of the full amplitude. If I remember right, it does use some sort of > adaptive predicting scheme to (pretty accurately) predict what's coming > next, based on the past few inputs. Yes, ADPCM can reduce voice data from 64 kbps to 32, 24 or even 16 kbps with good quality. You can buy standalone chips that encode and decode ADPCM in serial format. To get lower bit rates than this requires a different class of encoder, such as CELP, but now you're talking about some serious DSP. > Another decent, but slightly lower quality method, is known as CVSD > (continuously variable slope delta), which I happen to be using for a > project right now. In this method, you actually increase the sample rate > to about 32kHz, then use a single bit to indicate whether the signal's > amplitude is increasing or decreasing. If you can't hack 32kHz, you can > reduce the sampling rate with a roughly proportional decrease in quality. Not quite. You're implementing simple delta coding. This works much better if you high-pass filter (differentiate) the signal before coding and low-pass (integrate) it after decoding. CVSD actually varies the slope in the coder/decoder based on the number of contiguous ones or zeros seen in a row (a very simple form of prediction), so it's a little more complicated and performs a little better. -- Dave Tweed -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.