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. In PCM, the amplitude of an analog signal is sampled at regular intervals, and each sample is then approximated to the nearest value within a finite set of discrete levels (a process called quantization). Finally, each discrete level is assigned a unique binary code.


Block Diagram

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

                  ┌──────────────┐
                  │ 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: Before sampling, the analog signal is passed through a low-pass filter to remove high-frequency components that could cause aliasing.
  2. Sampling: The filtered signal is sampled at a uniform rate, \(f_s\), which must be at least twice the highest frequency of the signal (the Nyquist theorem). This converts the continuous-time signal into a discrete-time signal.
  3. Quantization: The amplitude of each sample is rounded to the nearest of a finite number of discrete levels. This is the key step that introduces an approximation error known as quantization noise.
  4. Encoding: Each quantized level is represented by a unique binary codeword of \(n\) bits. For \(L\) quantization levels, we need \(n = \log_2(L)\) bits.

Receiver (Digital-to-Analog Conversion)

  1. Regeneration: During transmission, the signal can be corrupted by noise. Regenerative repeaters are used to detect the incoming signal and re-transmit a clean new pulse, preventing noise from accumulating.
  2. Decoding: The receiver converts the incoming binary codewords back into their corresponding quantized amplitude levels. This creates a staircase-like signal.
  3. Reconstruction Filtering: The staircase signal is passed through a low-pass filter (the reconstruction filter) to smooth it out and recover an approximation of the original analog signal.

The Quantization Process

Quantization is the process of mapping continuous-amplitude samples to a finite set of discrete amplitude levels. This approximation is necessary for digital representation but is also the main source of error in a PCM system.

Quantization Error (Noise)

The difference between the actual amplitude of a sample and its assigned quantized level is called quantization error. This error is random in nature and manifests as noise in the reconstructed signal. The power of this quantization noise is a critical factor in determining the quality of the PCM system. For a uniform quantizer, the error \(e_q\) for any sample is in the range \(-\Delta/2 \le e_q \le \Delta/2\), where \(\Delta\) is the step size.

The step size \(\Delta\) is given by:

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

where \(L\) is the number of quantization levels and \(n\) is the number of bits per sample.

Types of Uniform Quantizers

Uniform quantizers have evenly spaced levels. There are two main types:

  • Mid-Tread Quantizer: Has a quantization level at zero. The origin lies in the middle of a "tread" of the staircase transfer function.
              Output
                ↑
           3Δ  |                        ┌───────
                |                        │
           2Δ  |                  ┌──────┘
                |                  │
           Δ   |            ┌──────┘
                |            │
           0   ─┼────────────┼──────────────→ Input
                |      ┌─────┘
          -Δ   |      │
                | ┌────┘
         -2Δ   | │
                └┘
         -3Δ   |

  • Mid-Rise Quantizer: Does not have a level at zero; the origin is in the middle of a "riser".


Noise in PCM Systems

Signal-to-Quantization Noise Ratio (SQNR)

The quality of a PCM system is often measured by the Signal-to-Quantization Noise Ratio (SQNR), which compares the power of the original signal to the power of the quantization noise.

The average power of the quantization noise, assuming the error is uniformly distributed, can be calculated as:

$$ \sigma_e^2 = \frac{\Delta^2}{12} $$

The SQNR is then:

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

where \(P_s\) is the average signal power.

By substituting the formula for \(\Delta\), we find that the SQNR is proportional to \(2^{2n}\). When expressed in decibels (dB), this gives a very important rule of thumb:

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

This means that for every additional bit used in the encoder, the SQNR improves by approximately 6 dB. This demonstrates the trade-off between signal quality and the number of bits required.


Bit Rate and Bandwidth Requirements

The final output of the PCM encoder is a stream of bits. The rate at which these bits are produced is called the bit rate.

The bit rate (\(R_b\)) is calculated as:

$$ R_b = n \times f_s $$

where \(n\) is the number of bits per sample, and \(f_s\) is the sampling rate.

The bandwidth required to transmit this digital signal is generally greater than the bandwidth of the original analog signal. This is the price paid for the robustness, noise immunity, and other advantages of digital transmission.

Demodulation

  • Signal Regeneration

    In any practical communication system, the digital signal becomes distorted by noise and weakened (attenuated) as it travels over the channel. Before the signal can be decoded, it must be cleaned up. This is the job of the regenerative circuit.

    Its purpose is to receive the weak, distorted pulses and recreate them as a clean, perfectly formed digital signal. It does this by sampling the incoming signal and deciding if each bit is a '1' or a '0', then generating a brand new pulse. This step is crucial for preventing the accumulation of noise in long-distance communication.

  • Decoding

    Once a clean digital stream is available, the Decoder takes over. Its function is to convert the digital codewords back into amplitude levels. The process is as follows:

    • The decoder groups the incoming bits into the original codeword size (e.g., 8 bits, 16 bits).
    • For each binary codeword, the decoder outputs a single voltage pulse with a specific, constant amplitude that corresponds to the quantized level represented by that code.

    The output of the decoder is a staircase signal. This signal is a discrete-time, discrete-amplitude approximation of the original analog signal.

  • Reconstruction

    The final stage is to convert the blocky staircase signal into a smooth, continuous waveform. This is accomplished by the Reconstruction Filter, which is a high-quality low-pass filter.

    The sharp edges of the staircase signal contain many high-frequency components that were not present in the original signal. The low-pass filter removes these unwanted high frequencies, effectively smoothing out the steps and recovering the original analog message signal.


Applications of PCM

Because it is the most fundamental and direct method of digital representation for analog signals, PCM is the bedrock of modern digital communication and media. Its applications are vast and ubiquitous.

  • Digital Telephony: This is the original and most well-known application. The international standard for digitizing a voice call for the Public Switched Telephone Network (PSTN) uses PCM. Modern Voice over IP (VoIP) systems also use PCM as the underlying encoding before compression.
  • Digital Audio: PCM is the standard for high-fidelity digital audio.
    • Audio CDs: The audio on a standard Compact Disc is stored as uncompressed 16-bit PCM data sampled at 44.1 kHz.
    • Computer Audio Files: The common .WAV (Windows) and .AIFF (Mac) file formats are essentially containers for raw, uncompressed PCM data.
    • Professional Audio: Recording studios and audio production workflows rely on high-resolution PCM (e.g., 24-bit/96 kHz) for the highest quality.
  • Digital Video: The audio track in many digital video formats is stored using PCM. For example, the high-quality audio tracks on Blu-ray discs and in professional video files are often uncompressed multi-channel PCM.
  • Satellite and Deep Space Communication: In environments where signals are extremely weak and noise is a major issue, the robustness of PCM makes it an ideal choice for transmitting scientific data and telemetry reliably.
  • Integrated Services Digital Network (ISDN): PCM is used to transmit both voice and data over digital telephone lines in ISDN systems.

'PCM' is the abbreviation for 'pulse code modulation.' To digitalize an analogue signal (i.e., voice signal) in a digital communication system, we usually employ the sampling technique. Before moving on to the main topic, we need to talk about sampling technique in more detail.

Before moving on to the main topic, we need to talk about sampling technique in more detail.

Sampling:


Sampling is a switching approach in which a switch is turned on in a specific time interval. Imagine a continuous voice signal passing through such a system; instead of a continuous signal, we get pulses at specific time intervals. Now the question arises as to how quickly that switching (sampling) operation must be completed for reliable transmission. Because we know that digital stuff requires less memory than analogue content. There is a restriction of sampling frequency which should be at least twice the message signal’s frequency.


Quantization:


Computers do not understand human language; they can only comprehend machine languages, which are essentially '0' and '1'. However, you are familiar with how real-world signals (such as voice signals) seem. If we only assign '0' and '1' to the sample values, we can clearly comprehend that they are all unique, but we are only representing them as '0' and '1'. That isn't right. That is why we use quantization to represent each sample value with a more meaningful notation, such as 0001, 0010, 0011, and so on. We can express 16 various levels of a signal with a 4 bit quantizer (as 2^4 =16), such as 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110.

For instance, in a simple system, there are two levels: the top level is +5 Volt, and the lower level is -5 Volt. As a result, the overall voltage range is +5 – (-5) = 10 Volts.

Now, (Vmax – Vmin) / 2 = 10/2 = 5 Volt is the step size.

We can now declare that if the voltage is between '0' and '5' Volts, we express it as '1'. When the signal value is between '0' and '-5' Volt, the value is set to '0'. Similarly, the number of levels in a 3 bit quantizer is 2^3= 8. Each step size is (10/3) Volts, or 3.33 Volts, if the overall voltage spread is 10 Volts. The step size is frequently expressed as delta (∆). We'll use it as a notation in the future.

Let us now discuss quantization error.


Error in Quantization:


The maximum quantization error will be ∆/2 in this case. If a signal falls between '0' and '5,' Volt there is a potential of getting a 2.5-volt error if it goes in the middle of those two levels. In the worst-case scenario, it can be quantized incorrectly as '0' or '1'. By increasing the levels and decreasing the step size, we may reduce the bit error.


Question:


Six signals are multiplexed using TDM, and the number of quantization levels employed is 256. What is the signal's transmission bandwidth? (The frequency of the message signal is 5 KHz.)
Answer:

Given,

In TDM, the number of signals for multiplexing is N = 6.

fm = 5 KHz is the frequency of the message signal.

n = 8 bits/sample in PCM

L = 256 is the number of quantization levels.

As a result, bandwidth equals (N*n*fs) / 2.


Alternatively, N*n*2fm /2

Or, 6*8*2*5 / 2 = 6*8*2*5

= 240 KHz


The PCM system's bit rate is now

N*n*2fm

=6*8*2*5

=480 kbps



MATLAB Code for Pulse Code Modulation: 

 
 
 

 


Get MATLAB Code from here

People are good at skipping over material they already know!

View Related Topics to







Contact Us

Name

Email *

Message *

Popular Posts

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...

Power Spectral Density Calculation Using FFT in MATLAB

📘 Overview 🧮 Steps to calculate the PSD of a signal 🧮 MATLAB Codes 📚 Further Reading Power spectral density (PSD) tells us how the power of a signal is distributed across different frequency components, whereas Fourier Magnitude gives you the amplitude (or strength) of each frequency component in the signal. Steps to calculate the PSD of a signal Firstly, calculate the fast Fourier transform (FFT) of a signal. Then, calculate the Fourier magnitude (absolute value) of the signal. Square the Fourier magnitude to get the power spectrum. To calculate the Power Spectral Density (PSD), divide the squared magnitude by the product of the sampling frequency (fs) and the total number of samples (N). Formula: PSD = |FFT|^2 / (fs * N) Sampling frequency (fs): The rate at which the continuous-time signal is sampled (in ...

Constellation Diagrams of ASK, PSK, and FSK (with MATLAB Code + Simulator)

Constellation Diagrams: ASK, FSK, and PSK Comprehensive guide to signal space representation, including interactive simulators and MATLAB implementations. 📘 Overview 🧮 Simulator ⚖️ Theory 📚 Resources Definitions Constellation Tool Key Points MATLAB Code 📂 Other Topics: M-ary PSK & QAM Diagrams ▼ 🧮 Simulator for M-ary PSK Constellation 🧮 Simulator for M-ary QAM Constellation BASK (Binary ASK) Modulation Transmits one of two signals: 0 or -√Eb, where Eb​ is the energy per bit. These signals represent binary 0 and 1. BFSK (Binary FSK) Modulation Transmits one ...

DFTs-OFDM vs OFDM: Why DFT-Spread OFDM Reduces PAPR Effectively (with MATLAB Code)

DFT-spread OFDM (DFTs-OFDM) has lower Peak-to-Average Power Ratio (PAPR) because it "spreads" the data in the frequency domain before applying IFFT, making the time-domain signal behave more like a single-carrier signal rather than a multi-carrier one like OFDM. Deeper Explanation: Aspect OFDM DFTs-OFDM Signal Type Multi-carrier Single-carrier-like Process IFFT of QAM directly QAM → DFT → IFFT PAPR Level High (due to many carriers adding up constructively) Low (less fluctuation in amplitude) Why PAPR is High Subcarriers can add in phase, causing spikes DFT "pre-spreads" data, smoothing it Used in Wi-Fi, LTE downlink LTE uplink (as SC-FDMA) In OFDM, all subcarriers can...

ASK, FSK, and PSK (with MATLAB + Online Simulator)

📘 ASK Theory 📘 FSK Theory 📘 PSK Theory 📊 Comparison 🧮 MATLAB Codes 🎮 Simulator ASK or OFF ON Keying ASK is a simple (less complex) Digital Modulation Scheme where we vary the modulation signal's amplitude or voltage by the message signal's amplitude or voltage. We select two levels (two different voltage levels) for transmitting modulated message signals. Example: "+5 Volt" (upper level) and "0 Volt" (lower level). To transmit binary bit "1", the transmitter sends "+5 Volts", and for bit "0", it sends no power. The receiver uses filters to detect whether a binary "1" or "0" was transmitted. Fig 1: Output of ASK, FSK, and PSK modulation using MATLAB for a data stream "1 1 0 0 1 0 1 0" ( Get MATLAB Code ) ...

UGC NET Electronic Science Previous Year Question Papers

Home / Engineering & Other Exams / UGC NET 2022 PYQ 📥 Download UGC NET Electronics PDFs Complete collection of previous year question papers, answer keys and explanations for Subject Code 88. Start Downloading UGC-NET (Electronics Science, Subject code: 88) Subject_Code : 88; Department : Electronic Science; 📂 View All Question Papers Q. UGC Net Electronic Science Question Paper [June 2025] A. UGC Net Electronic Science Question Paper With Answer Key Download Pdf [June 2025] with full explanation Q. UGC Net Electronic Science Question Paper [December 2024] A. UGC Net Electronic Science Question Paper With Answer Key Download Pdf [December 2024] UGC Net Paper 1 With Answer Key Download Pdf [Sep 2024] with full explanation ...

Filter Bank Multicarrier (FBMC)

Filter Bank Multicarrier (FBMC) Filter Bank Multicarrier (FBMC) is an advanced multicarrier modulation technique designed to overcome the spectral inefficiencies and interference issues of OFDM. Motivation: Limitations of OFDM In an OFDM system , the transmitter uses an Inverse Fast Fourier Transform (IFFT) and the receiver uses a Fast Fourier Transform (FFT) to process multiple subcarriers. Each OFDM symbol occupies a duration denoted by T sym . OFDM is a multicarrier modulation technique where a high data-rate stream is divided into multiple parallel low data-rate streams. To mitigate inter-symbol interference (ISI) caused by multipath fading, the total bandwidth B is divided into N narrow sub-bands. However, a major drawback of OFDM is that the subcarrier filters generated by the IFFT/FFT process have poor spectral cont...