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

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) Sampling Rate (...

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

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

Theoretical BER vs SNR for m-ary PSK and QAM

Relationship Between Bit Error Rate (BER) and Signal-to-Noise Ratio (SNR) The relationship between Bit Error Rate (BER) and Signal-to-Noise Ratio (SNR) is a fundamental concept in digital communication systems. Here’s a detailed explanation: BER (Bit Error Rate): The ratio of the number of bits incorrectly received to the total number of bits transmitted. It measures the quality of the communication link. SNR (Signal-to-Noise Ratio): The ratio of the signal power to the noise power, indicating how much the signal is corrupted by noise. Relationship The BER typically decreases as the SNR increases. This relationship helps evaluate the performance of various modulation schemes. BPSK (Binary Phase Shift Keying) Simple and robust. BER in AWGN channel: BER = 0.5 × erfc(√SNR) Performs well at low SNR. QPSK (Quadrature...

FIR vs IIR Digital Filters and Recursive vs Non Recursive Filters

Filters >> FIR vs. IIR Digital Filters and Recursive vs. Non-Recursive Filters Key Features The higher the order of a filter, the sharper the stopband transition The sharpness of FIR and IIR filters is very different for the same order A FIR filter has an equal time delay at all frequencies, while the IIR filter's time delay varies with frequency. Usually, the biggest time delay in the IIR filter is at the filter's cutoff frequency. The term 'IR' (impulse response) is in both FIR and IIR. The term 'impulse response' refers to the appearance of the filter in the time domain. 1. What Is the Difference Between an FIR and an IIR Filters? The two major classifications of digital filters used for signal filtration are FIR and IIR....

Sky Wave, Microwave Link Communication and Satellite Communication (SATCOM)

Overview Sky Wave, Microwave Link Communication, and Satellite Communication  (SATCOM) are the focus of this article. Sky Waves are essentially AM waves that the ionosphere reflects. For long-distance communication on Earth, we employ standard microwave link transmission. However, we all know that the earth is not flat, but rather oval in shape. As a result, the signal can only reach a few kilometers on a straight line of sight path (LOS). The signal is then reflected by the earth's surface. But we know that with that microwave link, we can communicate hundreds of kilometers distance. We'll look at how this happens in this article. Terrestrial satellite communication has now replaced microwave relay link communication. Figure: Ionosphere Reflection - suitable for AM band (Sky Wave) 1. Sky Wave You can see how the ionosphere bounces the radio signal and enables the ground station to communicate with the transmitter hundreds of kilometers away. This method is ideal for communica...

Comparisons among ASK, PSK, and FSK (with MATLAB + Simulator)

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