Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Pulse-density modulation

From Wikipedia, the free encyclopedia
Form of modulation
Passbandmodulation
Analog modulation
Digital modulation
Hierarchical modulation
Spread spectrum
See also

Pulse-density modulation (PDM) is a form ofmodulation used to represent ananalog signal with abinary signal. In a PDM signal, specificamplitude values are not encoded into codewords of pulses of different weight as they would be inpulse-code modulation (PCM); rather, the relativedensity of the pulses corresponds to the analog signal's amplitude. The output of a1-bit DAC is the same as the PDM encoding of the signal.

Description

[edit]

In a pulse-density modulationbitstream, a1{\displaystyle 1} corresponds to a pulse of positive polarity (+A{\displaystyle +A}), and a0{\displaystyle 0} corresponds to a pulse of negative polarity (A{\displaystyle -A}). Mathematically, this can be represented as

x[n]=A(1)a[n],{\displaystyle x[n]=-A(-1)^{a[n]},}

wherex[n]{\displaystyle x[n]} is the bipolar bitstream (eitherA{\displaystyle -A} or+A{\displaystyle +A}), anda[n]{\displaystyle a[n]} is the corresponding binary bitstream (either0{\displaystyle 0} or1{\displaystyle 1}).

A run consisting of all1{\displaystyle 1}s would correspond to the maximum (positive) amplitude value, all0{\displaystyle 0}s would correspond to the minimum (negative) amplitude value, and alternating1{\displaystyle 1}s and0{\displaystyle 0}s would correspond to a zero amplitude value. The continuous amplitude waveform is recovered bylow-pass filtering the bipolar PDM bitstream.

Examples

[edit]

A singleperiod of thetrigonometric sine function,sampled 100 times and represented as a PDM bitstream, is:

0101011011110111111111111111111111011111101101101010100100100000010000000000000000000001000010010101

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.

Two periods of a higher frequency sine wave would appear as:

0101101111111111111101101010010000000000000100010011011101111111111111011010100100000000000000100101

A second example of PDM of 100 samples of two periods of a sine wave of twice the frequency

In pulse-density modulation, a highdensity of 1s occurs at the peaks of the sine wave, while a lowdensity of 1s occurs at the troughs of the sine wave.

Analog-to-digital conversion

[edit]
Main article:Delta-sigma modulation

A PDM bitstream isencoded from an analog signal through the process of a 1-bitdelta-sigma modulation. This process uses a one-bitquantizer 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 ofaveraging out the quantization error, whilenoise shaping it topush most of the quantization error into higher frequencies, which for audio signals would beultrasonic.

PDM-to-PCM conversion

[edit]

Decimation is needed to convert a PDM signal from its very high sampling rate (e.g. some PDM mics may sample between 1 MHz to 3.25 MHz) to the much lower PCM sampling rate (which for audio may range between 16 kHz to 48 kHz).[1]

Digital-to-analog conversion

[edit]

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 ofconverting a PDM signal into an analog one is simple: one only has to pass the PDM signal through alow-pass filter.[2] Because the delta-sigma modulator hadpushed 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 PWM

[edit]

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. With PDM and the same clock rate the signal would alternate between on and off every other cycle. The average obtained by a low-pass filter is 50% of the maximum signal level for both waveforms, but the PDM signal switches more often. For 100% or 0% level, they are the same, with the signal permanently on or off respectively.

Relationship to biology

[edit]

Notably, one of the ways animal nervous systems represent sensory and other information is throughrate 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.

Algorithm

[edit]
Pulse-density modulation of asine wave using this algorithm

The following digital model of pulse-density modulation can be obtained from a digital model of a 1st-order 1-bitdelta-sigma modulator. Consider a signalx[n]{\displaystyle x[n]} in thediscrete time domain as the input to a first-order delta-sigma modulator, withy[n]{\displaystyle y[n]} the output. In thediscrete frequency domain, where theZ-transform has been applied to the amplitude time-seriesx[n]{\displaystyle x[n]} to yieldX(z){\displaystyle X(z)}, the outputY(z){\displaystyle Y(z)} of the delta-sigma modulator's operation is represented by

Y(z)=X(z)+E(z)(1z1),{\displaystyle Y(z)=X(z)+E(z)\left(1-z^{-1}\right),}

whereE(z){\displaystyle E(z)} is the frequency-domainquantization error of the delta-sigma modulator. Rearranging terms, we obtain

Y(z)=E(z)+[X(z)Y(z)z1](11z1).{\displaystyle Y(z)=E(z)+\left[X(z)-Y(z)z^{-1}\right]\left({\frac {1}{1-z^{-1}}}\right).}

The factor1z1{\displaystyle 1-z^{-1}} represents ahigh-pass filter, so it is clear thatE(z){\displaystyle E(z)} contributes less to the outputY(z){\displaystyle Y(z)} at low frequencies and more at high frequencies. This demonstrates thenoise 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 inverseZ-transform, we may convert this into adifference equation relating the input of the delta-sigma modulator to its output in thediscrete time domain,

y[n]=x[n]+e[n]e[n1].{\displaystyle y[n]=x[n]+e[n]-e[n-1].}

There are two additional constraints to consider: first, at each step the output sampley[n]{\displaystyle y[n]} is chosen so as tominimize the "running" quantization errore[n].{\displaystyle e[n].} Second,y[n]{\displaystyle y[n]} is represented as a single bit, meaning it can take on only two values. We choosey[n]=±1{\displaystyle y[n]=\pm 1} for convenience, allowing us to write

y[n]=sgn(x[n]e[n1])={+1x[n]>e[n1]1x[n]<e[n1]=(x[n]e[n1])+e[n].{\displaystyle {\begin{aligned}y[n]&=\operatorname {sgn} {\big (}x[n]-e[n-1]{\big )}\\&={\begin{cases}+1&x[n]>e[n-1]\\-1&x[n]<e[n-1]\end{cases}}\\&=(x[n]-e[n-1])+e[n].\\\end{aligned}}}

Rearranging to solve fore[n]{\displaystyle e[n]} yields:

e[n]=y[n](x[n]e[n1])=sgn(x[n]e[n1])(x[n]e[n1]).{\displaystyle e[n]=y[n]-{\big (}x[n]-e[n-1]{\big )}=\operatorname {sgn} {\big (}x[n]-e[n-1]{\big )}-{\big (}x[n]-e[n-1]{\big )}.}

This, finally, gives a formula for the output sampley[n]{\displaystyle y[n]} in terms of the input samplex[n]{\displaystyle x[n]}. The quantization error of each sample isfed back into the input for the following sample.

The following pseudo-code implements this algorithm to convert apulse-code modulation signal into a PDM signal:

// Encode samples into pulse-density modulation// using a first-order sigma-delta modulatorfunction pdm(real[0..s] x,real qe = 0)// initial running error is zerovarint[0..s] yfor nfrom 0to sdo        qe := qe + x[n]if qe > 0then            y[n] := 1else            y[n] := −1        qe := qe - y[n]return y, qe// return output and running error

Applications

[edit]

PDM is the encoding used in Sony'sSuper Audio CD (SACD) format, under the nameDirect Stream Digital.

PDM is also the output of someMEMSmicrophones.[3]

Some systems transmit PDMstereo 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.[4][5][6]

See also

[edit]

References

[edit]
  1. ^Application Note AN5027 (Rev 2): "Interfacing PDM digital microphones using STM32 MCUs and MPUs"(PDF).STMicroelectronics. July 2019. p. 13. Retrieved30 July 2025.
  2. ^"More about PDM".Audio Precision.Archived from the original on 2025-05-23. Retrieved30 July 2025.
  3. ^Fried, Limor (2018-01-10)."Adafruit PDM Microphone Breakout".Adafruit Learning System.Archived from the original on 2022-12-08. Retrieved2023-06-30.
  4. ^Thomas Kite."Understanding PDM Digital Audio" (PDF). 2012. The "PDM Microphones" section on p. 6.
  5. ^Maxim Integrated."PDM Input Class D Audio Power Amplifier" (PDF). 2013. Figure 1 on p. 5; and the "Digital Audio Interface" section on p. 13.
  6. ^Knowles."SPK0641 Digital, CMOS MEMS Microphone" (PDF).

Further reading

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Pulse-density_modulation&oldid=1334623321"
Category:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp