Skip to main content

Pulse Code Modulation (PCM)


Pulse Code Modulation (PCM)

Pulse Code Modulation (PCM) is a digital representation of an analog signal. It is the standard method used for converting analog audio, video, and other signals into a digital format for transmission, processing, or storage.

Block Diagram

The PCM process can be broken down into two main parts: the transmitter (analog-to-digital) and the receiver (digital-to-analog).

┌──────────────┐ │ Analog │ │ Message Signal│ └───────┬──────┘ │ ┌─────▼─────┐ │ LPF │ └─────┬─────┘ │ ┌─────▼─────┐ │ Sampler │ └─────┬─────┘ │ ┌─────▼─────┐ │ Quantizer │ └─────┬─────┘ │ ┌─────▼─────┐ │ Encoder │ └─────┬─────┘ │ PCM Output to Channel │ ┌─────────────────▼───────────────────┐ │ CHANNEL │ │ ┌─────────────────────────────┐ │ │ │ Regenerative Repeater │ │ │ └──────────────┬──────────────┘ │ │ ... │ │ ┌──────────────▼──────────────┐ │ │ │ Regenerative Repeater │ │ │ └─────────────────────────────┘ │ └─────────────────┬───────────────────┘ │ Channel Output │ ┌──────▼──────┐ │ Regeneration │ │ Circuit │ └──────┬──────┘ │ ┌──────▼──────┐ │ Decoder │ └──────┬──────┘ │ ┌──────▼──────┐ │Reconstruction│ │ Filter │ └──────┬──────┘ │ ┌──────▼──────┐ │ Destination │ └──────────────┘

Fig: Block Diagram of a PCM System

Transmitter (Analog-to-Digital Conversion)

  1. Low-Pass Filtering: Removes high-frequency components that could cause aliasing.
  2. Sampling: Converts continuous-time signal into discrete-time signal at rate \(f_s\).
  3. Quantization: Approximates sample amplitude to discrete levels.
  4. Encoding: Assigns unique binary codewords to levels.

Receiver (Digital-to-Analog Conversion)

  1. Regeneration: Prevents noise accumulation using repeaters.
  2. Decoding: Converts binary back to amplitude levels (staircase signal).
  3. Reconstruction Filtering: Smooths the signal back to analog form.

Interactive PCM Simulator

Test various sampling frequencies, quantization levels, and bit rates to visualize how signal quality changes in real-time.

Launch Simulator Tool

The Quantization Process

Quantization maps continuous-amplitude samples to a finite set of discrete levels. This is the main source of error in PCM systems.

Quantization Error (Noise)

The error \(e_q\) ranges from \(-\Delta/2 \le e_q \le \Delta/2\), where \(\Delta\) is the step size.

$$ \Delta = \frac{x_{\text{max}} - x_{\text{min}}}{L} = \frac{x_{\text{max}} - x_{\text{min}}}{2^n} $$

Types of Uniform Quantizers

  • Mid-Tread Quantizer: Origin lies on a tread (zero level exists).
  • Output ↑ 3Δ | ┌─────── | │ 2Δ | ┌──────┘ | │ Δ | ┌──────┘ | │ 0 ─┼─┼───────────→ Input | ┌─────┘ -Δ | │ | ┌────┘ -2Δ | │ └┘ -3Δ |
  • Mid-Rise Quantizer: Origin lies on a riser (no zero level).

Noise and Signal Quality (SQNR)

The quality is measured by the Signal-to-Quantization Noise Ratio (SQNR).

$$ \sigma_e^2 = \frac{\Delta^2}{12} \quad \text{and} \quad \text{SQNR} = \frac{P_s}{\sigma_e^2} $$

The 6dB Rule: For every additional bit, SQNR improves by ~6 dB.

$$ (\text{SQNR})_{\text{dB}} \approx 1.76 + 6.02n $$

Bit Rate (Rb)

$$ R_b = n \times f_s $$

Solved Example: TDM & Bandwidth

Question: Six signals are multiplexed using TDM, and the number of quantization levels is 256. Message frequency \(f_m = 5 \text{ KHz}\). Find Transmission Bandwidth.

Given: - N = 6 (Signals) - fm = 5 KHz - L = 256 levels → n = log₂(256) = 8 bits - fs = 2 × fm = 10 KHz Calculation: Bit Rate (Rb) = N × n × fs Rb = 6 × 8 × 10 = 480 kbps Bandwidth (B) = Rb / 2 B = 480 / 2 = 240 KHz

Deep Dive: Sampling Technique

Sampling is the bridge between analog and digital. It is essentially a switching approach. To prevent aliasing, we follow the Nyquist Criterion:

Sampling Illustration
The sampling frequency should be at least twice the message signal’s frequency.

Computers only comprehend binary ('0' and '1'). Quantization gives these samples meaning. For a 4-bit quantizer, we map signal values to 16 distinct levels (0000 to 1111).

Applications of PCM

  • Digital Telephony: Standard for PSTN and VoIP calls.
  • Digital Audio: Audio CDs (16-bit PCM @ 44.1 kHz), WAV, and AIFF files.
  • Space Communication: Robust against noise in deep space telemetry.
  • ISDN: Integrated services over digital telephone lines.

People are good at skipping over material they already know!

View Related Topics to







Contact Us

Name

Email *

Message *

Popular Posts

Theoretical BER vs SNR for binary ASK, FSK, and PSK with MATLAB Code + Simulator

📘 Overview & Theory 🧮 MATLAB Codes 📚 Further Reading Bit Error Rate (BER) Equations In ASK, noise directly affects the signal amplitude, making it the most vulnerable since the data is carried in amplitude changes. In FSK, data is represented by frequency variations, and because noise typically impacts amplitude more than frequency, FSK is more robust than ASK. In PSK, data is encoded in the signal phase, and BPSK specifically uses 180-degree phase shifts, creating the greatest separation between signal points and therefore achieving the lowest bit error rate (BER) for the same power level. BER formulas for ASK, FSK, and PSK modulation schemes. ASK BER = 0.5 × erfc(0.5 × √SNR) FSK BER = 0.5 × erfc(√(SNR / 2)) PSK BER = 0.5 × erfc(√SNR) Theoretical BER ...

BER vs SNR for M-ary QAM, M-ary PSK, QPSK, BPSK, ...(MATLAB Code + Simulator)

Bit Error Rate (BER) & SNR Guide Analyze communication system performance with our interactive simulators and MATLAB tools. 📘 Theory 🧮 Simulators 💻 MATLAB Code 📚 Resources BER Definition SNR Formula BER Calculator MATLAB Comparison 📂 Explore M-ary QAM, PSK, and QPSK Topics ▼ 🧮 Constellation Simulator: M-ary QAM 🧮 Constellation Simulator: M-ary PSK 🧮 BER calculation for ASK, FSK, and PSK 🧮 Approaches to BER vs SNR What is Bit Error Rate (BER)? The BER indicates how many corrupted bits are received compared to the total number of bits sent. It is the primary figure of merit for a...

How to use MATLAB Simulink

Introduction to MATLAB Simulink MATLAB Simulink is a popular add-on of MATLAB. Here, you can use different blocks like modulator, demodulator, AWGN channel, etc. And you can do experiments on your own. Steps to Get Started 1. Go to the 'Simulink' tab at the top navbar of MATLAB. If not found, click on the add-on tab, search 'Simulink,' and then click on it to add. 2. Once you installed the simulation, click the 'new' tap at the top left corner. 3. Then, search the required blocks in the 'Simulink library.' Then, drag it to the editor space. 4. You can double-click on the blocks to see the input parameters. 5. Then, connect the blocks by dragging a line from one block's output terminal to another block's input. 6. If the connection is complete, click the 'run' tab in the middle of the top navbar. 7. After clicking on the run ...

OFDM Waveform with MATLAB Code (with Simulator)

  In OFDM (Orthogonal Frequency Division Multiplexing) , we transmit multiple orthogonal subcarriers simultaneously. Since the subcarriers are orthogonal , they do not interfere with each other, which is one of the main advantages of OFDM. Practically, OFDM converts a wideband signal into multiple narrowband orthogonal subcarriers. For typical wireless communication, if the signal bandwidth (or symbol duration) exceeds the coherence bandwidth of the channel, the signal experiences frequency-selective fading . Fading distorts the signal, making it difficult to recover the original information. By using OFDM, we transmit the same wideband signal across multiple orthogonal narrowband subcarriers, reducing the effect of fading. For example, if we want to transmit a signal of bandwidth 1024 kHz , we can divide it into N = 8 subcarriers . Each subcarrier is then spaced by: Δf = Total Bandwidth N = 1024 8 kHz...

MATLAB Code for Constellation Diagram of QAM configurations such as 4, 8, 16, 32, 64, 128, and 256-QAM

📘 Overview of QAM 🧮 4-QAM MATLAB 🧮 16-QAM MATLAB 🚀 Online Simulator 📂 Other Topics on Constellation Diagrams... ▼ 🧮 MATLAB Code for 4-QAM 🧮 MATLAB Code for 16-QAM 🧮 MATLAB Code for m-ary QAM 🧮 Simulator for m-ary PSK 🧮 Simulator for m-ary QAM 🧮 Overview of Energy per Bit (Eb / N0) 🧮 Simulator for ASK, FSK, and PSK Overview of QAM One of the best-performing modulation techniques is QAM [↗] . Here, we modulate the symbols by varying the carrier signal's amplitude and phase in response to the variation in the message signal (or voltage variation). So, we may say that QAM is a combination of phase and amplitude modulation. Additionally, it performs better than ASK or PSK [↗] . In fact, any constellation for any type of modulatio...

Online Simulator for ASK, FSK, and PSK

Try our new Digital Signal Processing Simulator!   •   Interactive ASK, FSK, and BPSK tools updated for 2025. Start Now Interactive Modulation Simulators Visualize binary modulation techniques (ASK, FSK, BPSK) in real-time with adjustable carrier and sampling parameters. 📡 ASK Simulator 📶 FSK Simulator 🎚️ BPSK Simulator 📚 More Topics ASK Modulator FSK Modulator BPSK Modulator More Topics Simulator for Binary ASK Modulation Digital Message Bits Carrier Freq (Hz) Sampl...

Simulation of ASK, FSK, and PSK using MATLAB Simulink (with Online Simulator)

📘 Overview 🧮 How to use MATLAB Simulink 🧮 Simulation of ASK using MATLAB Simulink 🧮 Simulation of FSK using MATLAB Simulink 🧮 Simulation of PSK using MATLAB Simulink 🧮 Simulator for ASK, FSK, and PSK 🧮 Digital Signal Processing Simulator 📚 Further Reading ASK, FSK & PSK HomePage MATLAB Simulation Simulation of Amplitude Shift Keying (ASK) using MATLAB Simulink In Simulink, we pick different components/elements from MATLAB Simulink Library. Then we connect the components and perform a particular operation. Result A sine wave source, a pulse generator, a product block, a mux, and a scope are shown in the diagram above. The pulse generator generates the '1' and '0' bit sequences. Sine wave sources produce a specific amplitude and frequency. The scope displays the modulated signal as well as the original bit sequence created by the pulse generator. Mux i...

FastAPI Static Files – Overview

FastAPI Static Files Often, a web application needs to include resources that do not change, even when dynamic data is rendered. These resources are called static assets . Examples of static files include: Images ( .png , .jpg ) JavaScript files ( .js ) Stylesheets ( .css ) Installing Required Library To handle static files in FastAPI, you need the aiofiles library. pip install aiofiles Mounting Static Files FastAPI uses the StaticFiles class to serve static content. You mount a folder (usually named static ) so that all files inside it can be accessed via a URL. from fastapi import FastAPI from fastapi.staticfiles import StaticFiles app = FastAPI() app.mount("/static", StaticFiles(directory="static"), name="static") Example 1: Using an Image Place an image file (for example, fa-logo.png ) inside the static folder. main.py from fastapi import FastAPI, Request from fastapi.responses import HTMLRespon...