English
Language : 

VS1033 Datasheet, PDF (41/70 Pages) List of Unclassifed Manufacturers – MP3/AAC/WMA/MIDI AUDIO CODEC
VLSI
Solution y
VS1033a PRELIMINARY
VS1033A
9. OPERATION
9.4 ADPCM Recording
This chapter explains how to create RIFF/WAV file with IMA ADPCM format. This is a widely sup-
ported ADPCM format and many PC audio playback programs can play it. IMA ADPCM recording
gives roughly a compression ratio of 4:1 compared to linear, 16-bit audio. This makes it possible to
record 8 kHz audio at 32.44 kbit/s.
9.4.1 Activating ADPCM mode
IMA ADPCM recording mode is activated by setting bits SM RESET and SM ADPCM in SCI MODE.
Optionally a high-pass-filter can be enabled for 8 kHz sample rate by also setting SM ADPCM HP at the
same time. Line input is used instead of mic if SM LINE IN is set. Before activating ADPCM recording,
user must write a clock divider value to SCI AICTRL0 and gain to SCI AICTRL1.
The differences of using SM ADPCM HP are presented in figure 13 (page 33). As a general rule, audio
will be fuller and closer to original if SM ADPCM HP is not used. However, speech may be more
intelligible with the high-pass filter active. Use the filter only with 8 kHz sample rate.
Before activating ADPCM recording, user should write a clock divider value to SCI AICTRL0. The
sampling
frequency
is
calculated
from
the
following
formula:
fs
=
Fc
256×d
,
where
Fc
is
the
internal
clock
(CLKI) and d is the divider value in SCI AICTRL0. The lowest valid value for d is 4. If SCI AICTRL0
contains 0, the default divider value 12 is used.
Examples:
Fc
=
2.0 × 12.288 MHz,
d
=
12.
Now
fs
=
2.0×12288000
256×12
=
8000 Hz.
Fc
=
2.5 × 14.745 MHz,
d
=
18.
Now
fs
=
2.5×14745000
256×18
=
8000 Hz.
Fc
=
2.5 × 13 MHz,
d
=
16.
Now
fs
=
2.5×13000000
256×16
=
7935 Hz.
Also, before activating ADPCM mode, the user has to set linear recording gain control to register
SCI AICTRL1. 1024 is equal to digital gain 1, 512 is equal to digital gain 0.5 and so on. If the user
wants to use automatic gain control (AGC), SCI AICTRL1 should be set to 0. Typical speech appli-
cations usually are better off using AGC, as this takes care of relatively uniform speech loudness in
recordings.
9.4.2 Reading IMA ADPCM Data
After IMA ADPCM recording has been activated, registers SCI HDAT0 and SCI HDAT1 have new
functions.
The IMA ADPCM sample buffer is 1024 16-bit words. The fill status of the buffer can be read from
SCI HDAT1. If SCI HDAT1 is greater than 0, you can read as many 16-bit words from SCI HDAT0. If
the data is not read fast enough, the buffer overflows and returns to empty state.
Note: if SCI HDAT1 ≥ 896, it may be better to wait for the buffer to overflow and clear before reading
samples. That way you may avoid buffer aliasing.
Each IMA ADPCM block is 128 words, i.e. 256 bytes. If you wish to interrupt reading data and possibly
continue later, please stop at a 128-word boundary. This way whole blocks are skipped and the encoded
Version 0.6, 2005-01-05
41