12.07.2015 Views

VS1033 - MP3/AAC/WMA/MIDI AUDIO CODEC - VLSI Solution

VS1033 - MP3/AAC/WMA/MIDI AUDIO CODEC - VLSI Solution

VS1033 - MP3/AAC/WMA/MIDI AUDIO CODEC - VLSI Solution

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>VLSI</strong><strong>Solution</strong> y<strong>VS1033</strong>c<strong>VS1033</strong>C9. OPERATION9.4 ADPCM RecordingThis chapter explains how to create RIFF/WAV file with IMA ADPCM format. This is a widely supportedADPCM format and many PC audio playback programs can play it. IMA ADPCM recordinggives roughly a compression ratio of 4:1 compared to linear, 16-bit audio. This makes it possible torecord 8 kHz audio at 32.44 kbit/s.9.4.1 Activating ADPCM modeIMA 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 thesame 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 15 (page 37). As a general rule, audiowill be fuller and closer to original if SM ADPCM HP is not used. However, speech may be moreintelligible 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. Thesampling frequency is calculated from the following formula: f s =F c256×d , where F c is the internalclock (CLKI) and d is the divider value in SCI AICTRL0. If the sample rate is < 16000 Hz, additionalsoftware decimation by two is performed and the lowest valid value for d is 4, otherwise the lowest validvalue for d is 2. If SCI AICTRL0 contains 0, the default divider value 12 is used.Examples:F c = 2.0 × 12.288 MHz, d = 12. Now f s = 2.0×12288000256×12= 8000 Hz.F c = 2.5 × 14.745 MHz, d = 18. Now f s = 2.5×14745000256×18= 8000 Hz.F c = 2.5 × 13 MHz, d = 16. Now f s = 2.5×13000000256×16= 7935 Hz.Also, before activating ADPCM mode, the user has to set linear recording gain control to registerSCI AICTRL1. 1024 is equal to digital gain 1, 512 is equal to digital gain 0.5 and so on. If the userwants to use automatic gain control (AGC), SCI AICTRL1 should be set to 0. Typical speech applicationsusually are better off using AGC, as this takes care of relatively uniform speech loudness inrecordings.Since <strong>VS1033</strong>c SCI AICTRL2 controls the maximum AGC gain. If SCI AICTRL2 is zero, the maximumgain is 65535 (64×), i.e. whole range is used. This is compatible with previous operation.9.4.2 Reading IMA ADPCM DataAfter IMA ADPCM recording has been activated, registers SCI HDAT0 and SCI HDAT1 have newfunctions.The IMA ADPCM sample buffer is 1024 16-bit words. The fill status of the buffer can be read fromSCI HDAT1. If SCI HDAT1 is greater than 0, you can read as many 16-bit words from SCI HDAT0. Ifthe 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 readingsamples. That way you may avoid buffer aliasing.Version 1.00, 2008-02-01 46

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!