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

📘 Overview of BER and SNR 🧮 Online Simulator for BER calculation of m-ary QAM and m-ary PSK 🧮 MATLAB Code for BER calculation of M-ary QAM, M-ary PSK, QPSK, BPSK, ... 📚 Further Reading 📂 View Other Topics on M-ary QAM, M-ary PSK, QPSK ... 🧮 Online Simulator for Constellation Diagram of m-ary QAM 🧮 Online Simulator for Constellation Diagram of m-ary PSK 🧮 MATLAB Code for BER calculation of ASK, FSK, and PSK 🧮 MATLAB Code for BER calculation of Alamouti Scheme 🧮 Different approaches to calculate BER vs SNR What is Bit Error Rate (BER)? The abbreviation BER stands for Bit Error Rate, which indicates how many corrupted bits are received (after the demodulation process) compared to the total number of bits sent in a communication process. BER = (number of bits received in error) / (total number of tran...

Theoretical vs. simulated BER vs. SNR for ASK, FSK, and PSK

📘 Overview 🧮 Simulator for calculating BER 🧮 MATLAB Codes for calculating theoretical BER 🧮 MATLAB Codes for calculating simulated BER 📚 Further Reading BER vs. SNR denotes how many bits in error are received for a given signal-to-noise ratio, typically measured in dB. Common noise types in wireless systems: 1. Additive White Gaussian Noise (AWGN) 2. Rayleigh Fading AWGN adds random noise; Rayleigh fading attenuates the signal variably. A good SNR helps reduce these effects. Simulator for calculating BER vs SNR for binary ASK, FSK, and PSK Calculate BER for Binary ASK Modulation Enter SNR (dB): Calculate BER Calculate BER for Binary FSK Modulation Enter SNR (dB): Calculate BER Calculate BER for Binary PSK Modulation Enter SNR (dB): Calculate BER BER vs. SNR Curves MATLAB Code for Theoretical BER % The code is written by SalimWireless.Com clc; clear; close all; % SNR va...

Constellation Diagrams of ASK, PSK, and FSK

📘 Overview of Energy per Bit (Eb / N0) 🧮 Online Simulator for constellation diagrams of ASK, FSK, and PSK 🧮 Theory behind Constellation Diagrams of ASK, FSK, and PSK 🧮 MATLAB Codes for Constellation Diagrams of ASK, FSK, and PSK 📚 Further Reading 📂 Other Topics on Constellation Diagrams of ASK, PSK, and FSK ... 🧮 Simulator for constellation diagrams of m-ary PSK 🧮 Simulator for constellation diagrams of m-ary QAM 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 of two signals: +√Eb​ ( On the y-axis, the phase shift of 90 degrees with respect to the x-axis, which is also termed phase offset ) or √Eb (on x-axis), where Eb​ is the energy per bit. These signals represent binary 0 and 1.  BPSK (Binary PSK) Modulation: Transmits one of two signals...

MATLAB Code for ASK, FSK, and PSK

📘 Overview & Theory 🧮 MATLAB Code for ASK 🧮 MATLAB Code for FSK 🧮 MATLAB Code for PSK 🧮 Simulator for binary ASK, FSK, and PSK Modulations 📚 Further Reading ASK, FSK & PSK HomePage MATLAB Code MATLAB Code for ASK Modulation and Demodulation % The code is written by SalimWireless.Com % Clear previous data and plots clc; clear all; close all; % Parameters Tb = 1; % Bit duration (s) fc = 10; % Carrier frequency (Hz) N_bits = 10; % Number of bits Fs = 100 * fc; % Sampling frequency (ensure at least 2*fc, more for better representation) Ts = 1/Fs; % Sampling interval samples_per_bit = Fs * Tb; % Number of samples per bit duration % Generate random binary data rng(10); % Set random seed for reproducibility binary_data = randi([0, 1], 1, N_bits); % Generate random binary data (0 or 1) % Initialize arrays for continuous signals t_overall = 0:Ts:(N_bits...

MATLAB code for BER vs SNR for M-QAM, M-PSK, QPSk, BPSK, ...

🧮 MATLAB Code for BPSK, M-ary PSK, and M-ary QAM Together 🧮 MATLAB Code for M-ary QAM 🧮 MATLAB Code for M-ary PSK 📚 Further Reading MATLAB Script for BER vs. SNR for M-QAM, M-PSK, QPSK, BPSK % Written by Salim Wireless clc; clear; close all; num_symbols = 1e5; snr_db = -20:2:20; psk_orders = [2, 4, 8, 16, 32]; qam_orders = [4, 16, 64, 256]; ber_psk_results = zeros(length(psk_orders), length(snr_db)); ber_qam_results = zeros(length(qam_orders), length(snr_db)); for i = 1:length(psk_orders) psk_order = psk_orders(i); for j = 1:length(snr_db) data_symbols = randi([0, psk_order-1], 1, num_symbols); modulated_signal = pskmod(data_symbols, psk_order, pi/psk_order); received_signal = awgn(modulated_signal, snr_db(j), 'measured'); demodulated_symbols = pskdemod(received_signal, psk_order, pi/psk_order); ber_psk_results(i, j) = sum(data_symbols ~= demodulated_symbols) / num_symbols; end end for i...

Comparisons among ASK, PSK, and FSK | And the definitions of each

📘 Comparisons among ASK, FSK, and PSK 🧮 Online Simulator for calculating Bandwidth of ASK, FSK, and PSK 🧮 MATLAB Code for BER vs. SNR Analysis of ASK, FSK, and PSK 📚 Further Reading 📂 View Other Topics on Comparisons among ASK, PSK, and FSK ... 🧮 Comparisons of Noise Sensitivity, Bandwidth, Complexity, etc. 🧮 MATLAB Code for Constellation Diagrams of ASK, FSK, and PSK 🧮 Online Simulator for ASK, FSK, and PSK Generation 🧮 Online Simulator for ASK, FSK, and PSK Constellation 🧮 Some Questions and Answers Modulation ASK, FSK & PSK Constellation MATLAB Simulink MATLAB Code Comparisons among ASK, PSK, and FSK    Comparisons among ASK, PSK, and FSK Comparison among ASK, FSK, and PSK Parameters ASK FSK PSK Variable Characteristics Amplitude Frequency ...

Online Simulator for ASK, FSK, and PSK

Try our new Digital Signal Processing Simulator!   Start Simulator for binary ASK Modulation Message Bits (e.g. 1,0,1,0) Carrier Frequency (Hz) Sampling Frequency (Hz) Run Simulation Simulator for binary FSK Modulation Input Bits (e.g. 1,0,1,0) Freq for '1' (Hz) Freq for '0' (Hz) Sampling Rate (Hz) Visualize FSK Signal Simulator for BPSK Modulation ...

What are Precoding and Combining Weights / Matrices in a MIMO Beamforming System

MIMO / Massive MIMO Beamforming Techniques Precoding and Combining Weights... Configuration of single-user digital precoder for millimeter-wave massive MIMO system Precoding and combining are two excellent ways to send and receive signals over a multi-antenna communication process, respectively (i.e., MIMO antenna communication ). The channel matrix is the basis of both the precoding and combining matrices. Precoding matrices are typically used on the transmitter side and combining matrices on the receiving side. The two matrices allow us to generate multiple simultaneous data streams between the transmitter and receiver. The nature of the data streams is also orthogonal, which helps decrease or cancel (theoretically) interference between any two data streams. For a MIMO system, the channel matrix can be effectively **diago...