It is analogous to pulse-width modulation (PWM), in which the magnitude of an analog signal is encoded in the duty cycle of a square wave. Unlike PWM, in which the width of square pulses is varied at a constant frequency, PFM fixes the width of square pulses while varying the frequency. In other words, the frequency of the pulse train is varied in accordance with the instantaneous amplitude of the modulating signal at sampling intervals.