{
  "id": "enwiki-001360604569",
  "slug": "pulse-density-modulation",
  "title": "Pulse-density modulation",
  "qid": "",
  "lead": "Pulse-density modulation (PDM) is a form of modulation used to represent an analog signal with a binary signal. In a PDM signal, specific amplitude values are not encoded into codewords of pulses of different weights as they would be in pulse-code modulation (PCM); rather, the relative density of the pulses corresponds to the analog signal's amplitude. 1-bit DAC is an example of a PDM application.",
  "body": "Pulse-density modulation (PDM) is a form of modulation used to represent an analog signal with a binary signal. In a PDM signal, specific amplitude values are not encoded into codewords of pulses of different weights as they would be in pulse-code modulation (PCM); rather, the relative density of the pulses corresponds to the analog signal's amplitude. 1-bit DAC is an example of a PDM application. ==Description== In a pulse-density modulation bitstream, a 1 corresponds to a pulse of positive polarity ( +A ), and a 0 corresponds to a pulse of negative polarity ( -A ). Mathematically, this can be represented as x[n] = -A (-1)^{a[n]}, where x[n] is the bipolar bitstream (either -A or +A ), and a[n] is the corresponding binary bitstream (either 0 or 1 ). A run consisting of all 1 s would correspond to the maximum (positive) amplitude value, all 0 s would correspond to the minimum (negative) amplitude value, and alternating 1 s and 0 s would correspond to a zero amplitude value. The continuous amplitude waveform is recovered by low-pass filtering the bipolar PDM bitstream. ==Examples== A single period of the trigonometric sine function, sampled 100 times and represented as a PDM bitstream, is: 0101011011110111111111111111111111011111101101101010100100100000010000000000000000000001000010010101 Two periods of a higher frequency sine wave would appear as: 0101101111111111111101101010010000000000000100010011011101111111111111011010100100000000000000100101 In pulse-density modulation, a high density of 1s occurs at the peaks of the sine wave, while a low density of 1s occurs at the troughs of the sine wave. ==Analog-to-digital conversion== 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. A 1 or 0 corresponds to a signal that is all the way up or all the way down, respectively. 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. In this way, every error successively influences every other quantization measurement and its error. This has the effect of averaging out the quantization error, while noise shaping it to push most of the quantization error into higher frequencies, which for audio signals would be ultrasonic. ==Digital-to-analog conversion== The frequency components of interest, for example the audio frequency range, are much lower than the PDM's very high sampling rate. So, the process of converting a PDM signal into an analog one is simple: one only has to pass the PDM signal through a low-pass filter. Because the delta-sigma modulator had pushed most quantization noise into higher frequencies, low-pass filtering removes the high-frequency quantization noise while keeping the lower-frequency signal of interest. ==Relationship to biology== 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. In direct analogy, each neural event&nbsp;– called an action potential&nbsp;– represents one bit (pulse), with the rate of firing of the neuron representing the pulse density. ==Algorithm== using this algorithm The following digital model of pulse-density modulation can be obtained from a digital model of a 1st-order 1-bit delta-sigma modulator. Consider a signal x[n] in the discrete time domain as the input to a first-order delta-sigma modulator, with y[n] the output. In the discrete frequency domain, where the Z-transform has been applied to the amplitude time-series x[n] to yield X(z) , the output Y(z) of the delta-sigma modulator's operation is represented by Y(z) = X(z) + E(z) \\left(1 - z^{-1}\\right), where E(z) is the frequency-domain quantization error of the delta-sigma modulator. Rearranging terms, we obtain Y(z) = E(z) + \\left[X(z) - Y(z) z^{-1}\\right] \\left(\\frac{1}{1 - z^{-1}}\\right). The factor 1 - z^{-1} represents a high-pass filter, so it is clear that E(z) contributes less to the output Y(z) at low frequencies and more at high frequencies. This demonstrates the noise shaping effect of the delta-sigma modulator: the quantization noise is \"pushed\" out of the low frequencies up into the high-frequency range. 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, y[n] = x[n] + e[n] - e[n-1]. There are two additional constraints to consider: first, at each step the output sample y[n] is chosen so as to minimize the \"running\" quantization error e[n]. Second, y[n] is represented as a single bit, meaning it can take on only two values. We choose y[n] = \\pm 1 for convenience, allowing us to write \\begin{align} y[n] &= \\sgn\\big(x[n] - e[n-1]\\big) \\\\ &= \\begin{cases} +1 & x[n] > e[n-1] \\\\ -1 & x[n] Rearranging to solve for e[n] yields: e[n] = y[n] - \\big(x[n] - e[n-1]\\big) = \\sgn\\big(x[n] - e[n-1]\\big) - \\big(x[n] - e[n-1]\\big). This, finally, gives a formula for the output sample y[n] in terms of the input sample x[n] . The quantization error of each sample is fed back into the input for the following sample. The following pseudo-code implements this algorithm to convert a pulse-code modulation signal into a PDM signal: // Encode samples into pulse-density modulation // using a first-order sigma-delta modulator function pdm(real[0..s] x, real qe = 0) // initial running error is zero var int[0..s] y for n from 0 to s do qe := qe + x[n] if qe > 0 then y[n] := 1 else y[n] := −1 qe := qe - y[n] return y, qe // return output and running error ==Applications== PDM is the encoding used in Sony's Super Audio CD (SACD) format, under the name Direct Stream Digital. PDM is also the output of some MEMS microphones. 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. ==See also== Delta modulation Pulse-code modulation Delta-sigma modulation ==References== ==Further reading== 1-bit A/D and D/A Converters&nbsp;– Discusses delta modulation, PDM (also known as Sigma-delta modulation or SDM), and relationships to Pulse-code modulation (PCM) de:Pulsdichtemodulation",
  "categories": [
    "22913205",
    "23118434",
    "23603337",
    "24745122",
    "29572944"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1360604569",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1782132608.0,
  "claims": [],
  "contradictions": [],
  "confidence": 0.6,
  "csl": {
    "id": "enwiki-001360604569",
    "type": "webpage",
    "title": "Pulse-density modulation",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/pulse-density-modulation",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          16
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          16
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001360604569",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1360604569",
    "note": "Immutable snapshot enwiki-001360604569"
  }
}