SLAA361A July   2007  – August 2018 MSP430F169 , MSP430F169 , MSP430FG4618 , MSP430FG4618

 

  1.   Speech and Sound Compression and Decompression With MSP430™ MCUs
    1.     Trademarks
    2. 1 Introduction
    3. 2 Compression and Decompression Algorithms
      1. 2.1 Differential Pulse Code Modulation (DPCM)
      2. 2.2 Adaptive Differential Pulse Code Modulation (ADPCM)
    4. 3 Signal Chain on Chip in MSP430 MCUs
      1. 3.1 MSP430F169 Signal-Chain-on-Chip Solution
      2. 3.2 MSP430FG4618 Signal-Chain-on-Chip Solution
    5. 4 Performance on the MSP430 MCUs
      1. 4.1 Using the Associated Code
    6. 5 References
  2.   Revision History

Differential Pulse Code Modulation (DPCM)

DPCM encodes the analog audio input signal based on the difference between the current sample and the previous sample. Figure 1 shows a DPCM encoder and decoder block diagram. In this example, the signal difference, d(n), is determined using a signal estimate, Se(n), rather than the previous input. This method makes sure that the encoder uses the same information available to the decoder. If the true previous input sample were used by the encoder, an accumulation of quantization errors could occur. This accumulation would lead to a drift of the reconstructed signal from the original input signal. Use of the signal estimate in Figure 1 prevents drift from the original input signal in the reconstructed signal, Sr(n). The reconstructed signal, Sr(n), is the input to the predictor, which determines the next signal estimate, Se(n+1).

dpcm-encoder-and-decoder-block-diagram.gifFigure 1. DPCM Encoder and Decoder Block Diagram

Figure 2 shows a small part of a recorded audio stream. Analog audio input samples (PCM values) and the differences between successive samples (DPCM values) are compared in the two diagrams.

The range of the PCM values is between 26 and 203, with a delta of 177 steps. The encoded DPCM values are within a range of –44 to 46, with a delta of 90 steps. Despite a quantizer step size of one, this DPCM encoding already shows a compression of the input data. The range of the encoded DPCM values could be further decreased by selecting a higher quantizer step size.

comparison-of-8-bit-audio-data-and-difference-of-successive-samples.gif
Differential PCM Step Size = 1
Figure 2. Comparison of 8-Bit Audio Data and Difference of Successive Samples