DPCM Virtual Laboratory

Differential Pulse Code Modulation

Learning Objectives

  • Understand the principles of predictive coding and differential quantization
  • Analyze the DPCM encoder and decoder architecture
  • Investigate the effect of predictor order on signal reconstruction
  • Evaluate quantization error and signal-to-noise ratio (SNR)
  • Compare DPCM performance against standard PCM
  • Study slope overload and granular noise phenomena

Theoretical Background

DPCM Principle

Differential Pulse Code Modulation (DPCM) exploits the correlation between adjacent samples in a signal. Instead of encoding the absolute amplitude of each sample, DPCM encodes the difference between the actual sample and a predicted value based on previous samples.

Prediction Error:

e(n) = x(n) - x̂(n)

where x(n) is input, x̂(n) is predicted value

First-Order Predictor

The simplest predictor uses the previous reconstructed sample:

x̂(n) = α · x̃(n-1)

α: prediction coefficient (typically 0.8-0.95)

System Architecture

Encoder: Input → Predictor → Difference → Quantizer → Output
Decoder: Input → Inverse Quantizer → Predictor → Output

Advantages over PCM

  • Reduced bit rate for same SNR
  • Smaller dynamic range of error signal
  • Better utilization of quantizer levels
  • Effective for correlated signals (audio, video)

Key Insight

Since adjacent samples are correlated, the variance of the prediction error is typically much smaller than the variance of the original signal, allowing fewer bits for quantization.

Interactive DPCM Simulation

2 bits 4 bits 8 bits
0.0 0.85 0.99
1x 3x 10x

SNR

-- dB

Quantization Error

--

Compression Ratio

--:1

Prediction Gain

-- dB

Original vs Reconstructed Signal

Quantization Error Signal

Real-time DPCM Encoder/Decoder Block Diagram

ENCODER x(n) + Q[•] e_q(n) Predictor DECODER e_q(n) + x̃(n) Predictor Transmission
Δ = 0.125 Quantization Step
x̂(n) = 0.85·x̃(n-1) Prediction
e(n) = x(n) - x̂(n) Error Signal

Experimental Procedure

Experiment 1: Basic DPCM Operation

  1. Set the input signal to Sine Wave and frequency to 3x
  2. Set quantization bits to 4 bits and prediction coefficient to 0.85
  3. Observe the original signal (blue) and reconstructed signal (red) in the top plot
  4. Note the quantization error in the bottom plot - it should be small and centered around zero
  5. Record the SNR value displayed in the metrics panel

Experiment 2: Effect of Prediction Coefficient

  1. Maintain 4-bit quantization and sine wave input
  2. Vary the prediction coefficient (α) from 0.0 to 0.99
  3. At α = 0.0, DPCM behaves like standard PCM (no prediction)
  4. Observe how SNR improves as α increases toward 0.9
  5. Plot SNR vs. Prediction Coefficient for your lab report

Experiment 3: Quantization Effects

  1. Set α = 0.85 and input signal to Sawtooth Wave
  2. Reduce quantization bits from 8 to 2 in steps of 1
  3. Observe the onset of slope overload (steep sections cannot be tracked)
  4. Observe granular noise in flat sections with high quantization
  5. Determine the minimum bits required for intelligible reconstruction

Experiment 4: Signal Correlation Analysis

  1. Compare performance between highly correlated (sine) and less correlated (sawtooth) signals
  2. Calculate prediction gain for each signal type
  3. Verify that DPCM performs better on correlated signals
  4. Test with "Simulated Speech" which has natural correlation properties

Lab Report Guidelines

Required Sections

  • 1 Objective: State the purpose of studying DPCM
  • 2 Theory: Explain predictive coding with equations
  • 3 Procedure: Document your experimental steps
  • 4 Results: Include screenshots of plots at key settings
  • 5 Analysis: Discuss SNR trends and error patterns
  • 6 Conclusion: Summarize findings on DPCM efficiency

Key Questions to Address

1. Why does DPCM provide better SNR than PCM for the same bit rate?

2. What happens when the prediction coefficient exceeds 1.0?

3. How does slope overload occur and how can it be mitigated?

4. Calculate the theoretical prediction gain for a first-order Markov process.

5. Compare DPCM with Delta Modulation (DM). When is DM preferred?

Submission Checklist

  • • SNR vs. Prediction Coefficient plot (Exp. 2)
  • • Bit rate vs. Reconstruction quality analysis (Exp. 3)
  • • Comparison table: PCM vs DPCM performance
  • • Answers to all 5 questions above