Pulse-density modulation

In a PDM signal, specific amplitude values are not encoded into codewords of pulses of different weight as they would be in pulse-code modulation (PCM); rather, the relative density of the pulses corresponds to the analog signal's amplitude.

The continuous amplitude waveform is recovered by low-pass filtering the bipolar PDM bitstream.

A PDM bitstream is encoded from an analog signal through the process of a 1-bit delta-sigma modulation.

This process uses a one-bit quantizer that produces either a 1 or 0 depending on the amplitude of the analog signal.

Because in the real world, analog signals are rarely all the way in one direction, there is a quantization error, the difference between the 1 or 0 and the actual amplitude it represents.

This error is fed back negatively in the ΔΣ process loop.

This works because the function of a low-pass filter is essentially to average the signal.

Pulse-width modulation (PWM) is a special case of PDM where the switching frequency is fixed and all the pulses corresponding to one sample are contiguous in the digital signal.

The method for demodulation to an analogue signal remains the same, but the representation of a 50% signal with a resolution of 8-bits, a PWM waveform will turn on for 128 clock cycles and then off for the remaining 128 cycles.

Notably, one of the ways animal nervous systems represent sensory and other information is through rate coding whereby the magnitude of the signal is related to the rate of firing of the sensory neuron.

[citation needed] In direct analogy, each neural event – called an action potential – represents one bit (pulse), with the rate of firing of the neuron representing the pulse density.

in the discrete time domain as the input to a first-order delta-sigma modulator, with

In the discrete frequency domain, where the Z-transform has been applied to the amplitude time-series

Using the inverse Z-transform, we may convert this into a difference equation relating the input of the delta-sigma modulator to its output in the discrete time domain, There are two additional constraints to consider: first, at each step the output sample

The following pseudo-code implements this algorithm to convert a pulse-code modulation signal into a PDM signal: PDM is the encoding used in Sony's Super Audio CD (SACD) format, under the name Direct Stream Digital.

[1] Some systems transmit PDM stereo audio over a single data wire.

The rising edge of the master clock indicates a bit from the left channel, while the falling edge of the master clock indicates a bit from the right channel.

An example of PDM of 100 samples of one period of a sine wave. 1s represented by blue, 0s represented by white, overlaid with the sine wave.
A second example of PDM of 100 samples of two periods of a sine wave of twice the frequency
Pulse-density modulation of a sine wave using this algorithm