gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > ADPCM and choir synthesis

#25349 - lordmetroid - Sat Aug 21, 2004 7:26 am

A dicussion on #gbadev got me interested to use synthesis instead of samples for my music files to save memory... Now I have tried to get an understanding of ADPCM by browsing the net in random locations...

If I understood this correctly, one only saves the frequenzy of the wave at distinct points and then interpolate between them to get a curve of preference...
However this is very uncertain to me, perhaps someone can explain this a little bit further
_________________
*Spam*
Open Solutions for an open mind, www.areta.org

Areta is an organization of coders codeing mostly open source project, but there is alot of sections like GBA dev, Language learning communities, RPG communities, etc...

#25373 - tepples - Sat Aug 21, 2004 5:48 pm

First start with PCM (pulse code modulation). Measure the microphone's potential thousands of times a second and encode each potential as a number.

Then go to DPCM (delta PCM). Because low frequencies dominate audio, a PCM signal will have quite a bit of redundancy. Remove some redundancy from the audio signal by predicting the next sample based on the previous sample or samples and storing the differences between each sample and its predicted value. Collectively, these differences are called the "residue" or the "excitation."

ADPCM (adaptive DPCM) adds automatic gain control. Straight DPCM will either clip in loud parts ("slope overload") or add noise to soft parts ("granular noise"). Based on the stored differences, it predicts about how much larger or smaller the next few differences will be.

LPC (linear predictive coding) uses more sophisticated methods to decorrelate audio. Whereas DPCM uses the simple convolution filter [1 -1], LPC creates its own filter of 2 to 10 elements based on measuring the shape of the audio's frequency curve.

LPC with long term prediction squeezes out redundancy of a waveform with a definite pitch (such as a human voice or a musical instrument) by predicting sample values based on samples one period of the pitch ago. That, along with a few other tricks to approximate the excitation efficiently, is the essence of GSM 06.10 audio.

lordmetroid: What you're talking about is downsampling during recording and then upsampling during playback. This saves 2:1 over raw 8-bit PCM, but in general, ADPCM at 4 bits per sample preserves more subjective sound quality than downsampling.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.