adaptive differential pulse code modulation
DESCRIPTION
Adaptive Differential Pulse Code Modulation. Instructor: Chia-Tsun Wu. 11/18/2004. Outline. File format for voice data files ADPCM encoding algorithm ADPCM decoding algorithm Step size determination Initial and reset conditions ADPCM CODEC C example code LAB. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/1.jpg)
ACCESS IC LAB
Graduate Institute of Electronics Engineering, NTU
Adaptive Differential Pulse Code Adaptive Differential Pulse Code ModulationModulation
Instructor: Chia-Tsun Wu.
11/18/2004
![Page 2: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/2.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P2
OutlineOutline
File format for voice data filesADPCM encoding algorithmADPCM decoding algorithmStep size determinationInitial and reset conditionsADPCM CODEC C example code LAB
![Page 3: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/3.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P3
File format for voice data filesFile format for voice data files
![Page 4: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/4.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P4
ADPCM encoding algorithmADPCM encoding algorithm
![Page 5: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/5.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P5
ADPCM encoding algorithmADPCM encoding algorithm
let B3 = B2 = B1 = B0 = 0if (d(n) < 0)
then B3 = 1d(n) = ABS(d(n))if (d(n) >= ss(n))
then B2 = 1 and d(n) = d(n) - ss(n)if (d(n) >= ss(n) / 2)
then B1 = 1 and d(n) = d(n) - ss(n) / 2if (d(n) >= ss(n) / 4)
then B0 = 1L(n) = (10002 * B3) + (1002 * B2) + (102 * B1) + B0
![Page 6: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/6.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P6
ADPCM decoding algorithmADPCM decoding algorithm
![Page 7: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/7.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P7
ADPCM decoding algorithmADPCM decoding algorithm
d(n) = (ss(n)*B2) + (ss(n)/2*B1) + (ss(n)/4*BO) + (ss(n)/8)
if (B3 = 1)
then d(n) = d(n) * (-1)
X(n) = X(n-1) + d(n)
![Page 8: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/8.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P8
Step size determinationStep size determination
![Page 9: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/9.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P9
Initial and reset conditionsInitial and reset conditions
Step size ss(n) = 16Estimated waveform value X = 0 (half scale)No DC offset input
![Page 10: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/10.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P10
ADPCM CODEC C example codeADPCM CODEC C example code
Please refer to reference [2]
![Page 11: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/11.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P11
Two examplesTwo examples
Example 1:Speech: 8 bits resolutions, 22.5K sample rateADPCM encode to 2 bits per sample
Example 2:Music: 8 bits resolutions, 22.5K sample rateADPCM encode to 2 bits per sample
![Page 12: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/12.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P12
DistortionsDistortions
Source
ADPCM encode
![Page 13: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/13.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P13
Distortions cont’Distortions cont’
![Page 14: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/14.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P14
LABLAB Lab 1: Write a 16 to 4 or 12 to 4 ADPCM CODEC
Sample rate: 8KHz for speech Resolutions: 16 or 12 bits Encode to 4 bits
Lab 2: Write a 16 to 4 or 12 to 4 ADPCM CODEC Sample rate: 44.1K for music Resolutions: 16 bits Encode to 4 bits
Lab 3: Write a 8 to 2 ADPCM CODEC Sample rate: 8KHz for speech Resolutions: 8 bits Encode to 2 bits
Bonus: try to explain and optimal your algorithm to reduce distortions or noise. (need more analysis)
![Page 15: Adaptive Differential Pulse Code Modulation](https://reader033.vdocuments.us/reader033/viewer/2022051114/56813dc9550346895da790af/html5/thumbnails/15.jpg)
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU
P15
ReferenceReference
http://resource.intel.com/telecom/support/appnotes/adpcm.pdf
http://strawberry.resnet.mtu.edu/pub/Microchip/Dsk1/10/appnote/category/pic16/