Pulse Amplitude Modulation (PAM), Pulse Width Modulation (PWM), Pulse Position Modulation(PPM), Pulse Coded Modulation & their Demodulation
Pulse Width Modulation (PWM)
Theory
Pulse-Width Modulation (PWM), also known as Pulse-Duration Modulation (PDM), is a technique used to control the average power delivered by an electrical signal. Instead of varying the amplitude of the signal, PWM modifies the duration (or width) of the pulses in a pulse train while keeping the pulse amplitude and frequency constant. By changing the pulse width, one can effectively control the average voltage or power supplied to a load.

An example of PWM controlling the current in an inductor. The varying-width voltage pulses (blue) create a smoother, sine-like current waveform (red).
The Concept of Duty Cycle
The fundamental concept in PWM is the duty cycle. The duty cycle describes the fraction of time a signal is in the 'on' or 'high' state during one complete period. It is usually expressed as a percentage.
- A 100% duty cycle means the signal is always on.
- A 0% duty cycle means the signal is always off.
- A 50% duty cycle means the signal is on for half the period and off for the other half, resulting in a square wave.
A low duty cycle corresponds to low average power, while a high duty cycle corresponds to high average power. This relationship allows for precise control over devices like motors, LEDs, and heaters.

Examples of PWM signals with 50% duty cycle.
Generation of a PWM Signal
The most common method for generating a PWM signal is the intersection method. This technique involves comparing a modulating signal (the information or reference signal) with a high-frequency carrier waveform (typically a sawtooth or triangle wave) using a comparator.
- A high-frequency sawtooth or triangle wave is generated by an oscillator. This signal is applied to one input of a comparator (e.g., the inverting terminal).
- The modulating signal, which contains the information to be encoded, is applied to the other input of the comparator (e.g., the non-inverting terminal).
- The comparator outputs a high signal whenever the modulating signal's voltage is greater than the carrier wave's voltage. Otherwise, it outputs a low signal.
The result is a pulse train whose pulse widths vary in proportion to the amplitude of the modulating signal.

Generation of a PWM signal by comparing a modulating signal with a sawtooth wave.
Mathematical Formulation
For a pulse waveform \(f(t)\) with a period \(T\), a low value \(y_{\text{min}}\), a high value \(y_{\text{max}}\), and a duty cycle \(D\), the average value of the waveform, \(\bar{y}\), is given by the integral:
$$ \bar{y} = \frac{1}{T} \int_0^T f(t) \, dt $$Since the function has two constant values over the period, we can split the integral:
$$ \bar{y} = \frac{1}{T} \left( \int_0^{DT} y_{\text{max}} \, dt + \int_{DT}^T y_{\text{min}} \, dt \right) $$ $$ \bar{y} = \frac{1}{T} \left( [y_{\text{max}} \cdot t]_0^{DT} + [y_{\text{min}} \cdot t]_{DT}^T \right) $$ $$ \bar{y} = \frac{1}{T} \left( D \cdot T \cdot y_{\text{max}} + (T - DT) \cdot y_{\text{min}} \right) $$ $$ \bar{y} = D \cdot y_{\text{max}} + (1 - D) \cdot y_{\text{min}} $$This equation shows that the average value of the signal, \(\bar{y}\), is directly proportional to the duty cycle \(D\). If the low value \(y_{\text{min}}\) is zero, the formula simplifies to \(\bar{y} = D \cdot y_{\text{max}}\).
Demodulation of a PWM Signal
To recover the original modulating signal, the PWM signal must be demodulated. This is typically done by passing the PWM signal through a low-pass filter. The filter averages out the high-frequency pulses, and its output voltage is proportional to the duty cycle of the PWM signal. Since the duty cycle was varied according to the original message signal, the output of the low-pass filter is a reconstruction of that original signal.
Effects of Noise and Distortion
Noise Immunity
Like Frequency Modulation (FM), PWM has good noise immunity. The information is encoded in the timing (width) of the pulses, not their amplitude. Since noise primarily affects the amplitude of a signal, it has to be significant enough to be mistaken for a high or low state to cause an error. This makes PWM a robust method for transmitting analog information in noisy environments.
Distortion
The primary source of distortion in PWM is the communication channel itself. A transmission channel has a limited bandwidth, which can cause distortion of the rectangular pulses, particularly affecting the sharp rising and falling edges. This can alter the perceived pulse width at the receiver, leading to errors in the demodulated signal. This effect becomes more pronounced as the transmission distance (e.g., cable length) increases.
Applications of PWM
Due to its efficiency and noise immunity, PWM is used in a wide variety of applications, including:
- Power Delivery: Controlling the power supplied to DC motors, heaters, and lighting systems (e.g., dimming LEDs).
- Motor Control: Precisely controlling the speed and torque of electric motors in robotics, electric vehicles, and industrial machinery.
- Telecommunications: Transmitting analog information over digital communication channels with high noise immunity.
- Audio Synthesis and Amplification: Class-D audio amplifiers use PWM to achieve high efficiency.
- Voltage Regulation: Used in switch-mode power supplies to efficiently convert and regulate DC voltages.