Pulse-density modulation

Last updated

Pulse-density modulation, or 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 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 output of a 1-bit DAC is the same as the PDM encoding of the signal.

Contents

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

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 1s would correspond to the maximum (positive) amplitude value, all 0s would correspond to the minimum (negative) amplitude value, and alternating 1s and 0s 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

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. Pulse-density modulation 1 period.gif
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 Pulse-density modulation 2 periods.gif
A second example of PDM of 100 samples of two periods of a sine wave of twice the frequency

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.

Digital-to-analog conversion

The process of decoding a PDM signal into an analog one is simple: one only has to pass the PDM signal through a low-pass filter. This works because the function of a low-pass filter is essentially to average the signal. The average amplitude of pulses is measured by the density of those pulses over time, thus a low-pass filter is the only step required in the decoding process.

Relationship to PWM

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

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.

Algorithm

Pulse-density modulation of a sine wave using this algorithm Pulse density modulation.svg
Pulse-density modulation of a sine wave 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 in the discrete time domain as the input to a first-order delta-sigma modulator, with the output. In the discrete frequency domain, where the Z-transform has been applied to the amplitude time-series to yield , the output of the delta-sigma modulator's operation is represented by

where is the frequency-domain quantization error of the delta-sigma modulator. Rearranging terms, we obtain

The factor represents a high-pass filter, so it is clear that contributes less to the output 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,

There are two additional constraints to consider: first, at each step the output sample is chosen so as to minimize the "running" quantization error Second, is represented as a single bit, meaning it can take on only two values. We choose for convenience, allowing us to write

Rearranging to solve for yields:

This, finally, gives a formula for the output sample in terms of the input sample . 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 modulatorfunction pdm(real[0..s] x, real qe = 0) // initial running error is zerovarint[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. [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. [2] [3] [4]

See also

Related Research Articles

<span class="mw-page-title-main">Frequency modulation</span> Encoding of information in a carrier wave by varying the instantaneous frequency of the wave

Frequency modulation (FM) is the encoding of information in a carrier wave by varying the instantaneous frequency of the wave. The technology is used in telecommunications, radio broadcasting, signal processing, and computing.

In electronics and telecommunications, modulation is the process of varying one or more properties of a periodic waveform, called the carrier signal, with a separate signal called the modulation signal that typically contains information to be transmitted. For example, the modulation signal might be an audio signal representing sound from a microphone, a video signal representing moving images from a video camera, or a digital signal representing a sequence of binary digits, a bitstream from a computer.

<span class="mw-page-title-main">Orthogonal frequency-division multiplexing</span> Method of encoding digital data on multiple carrier frequencies

In telecommunications, orthogonal frequency-division multiplexing (OFDM) is a type of digital transmission used in digital modulation for encoding digital (binary) data on multiple carrier frequencies. OFDM has developed into a popular scheme for wideband digital communication, used in applications such as digital television and audio broadcasting, DSL internet access, wireless networks, power line networks, and 4G/5G mobile communications.

<span class="mw-page-title-main">Analog-to-digital converter</span> System that converts an analog signal into a digital signal

In electronics, an analog-to-digital converter is a system that converts an analog signal, such as a sound picked up by a microphone or light entering a digital camera, into a digital signal. An ADC may also provide an isolated measurement such as an electronic device that converts an analog input voltage or current to a digital number representing the magnitude of the voltage or current. Typically the digital output is a two's complement binary number that is proportional to the input, but there are other possibilities.

<span class="mw-page-title-main">Delta modulation</span> Signal conversion technique

Delta modulation is an analog-to-digital and digital-to-analog signal conversion technique used for transmission of voice information where quality is not of primary importance. DM is the simplest form of differential pulse-code modulation (DPCM) where the difference between successive samples is encoded into n-bit data streams. In delta modulation, the transmitted data are reduced to a 1-bit data stream representing either up (↗) or down (↘). Its main features are:

Phase-shift keying (PSK) is a digital modulation process which conveys data by changing (modulating) the phase of a constant frequency carrier wave. The modulation is accomplished by varying the sine and cosine inputs at a precise time. It is widely used for wireless LANs, RFID and Bluetooth communication.

Signal-to-noise ratio is a measure used in science and engineering that compares the level of a desired signal to the level of background noise. SNR is defined as the ratio of signal power to noise power, often expressed in decibels. A ratio higher than 1:1 indicates more signal than noise.

<span class="mw-page-title-main">Pulse-width modulation</span> Electric signal modulation technique used to reduce power load

Pulse-width modulation (PWM), also known as pulse-duration modulation (PDM) or pulse-length modulation (PLM), is a method of controlling the average power or amplitude delivered by an electrical signal. The average value of voltage fed to the load is controlled by switching the supply between 0 and 100% at a rate faster than it takes the load to change significantly. The longer the switch is on, the higher the total power supplied to the load. Along with maximum power point tracking (MPPT), it is one of the primary methods of controlling the output of solar panels to that which can be utilized by a battery. PWM is particularly suited for running inertial loads such as motors, which are not as easily affected by this discrete switching. The goal of PWM is to control a load; however, the PWM switching frequency must be selected carefully in order to smoothly do so.

<span class="mw-page-title-main">Sampling (signal processing)</span> Measurement of a signal at discrete time intervals

In signal processing, sampling is the reduction of a continuous-time signal to a discrete-time signal. A common example is the conversion of a sound wave to a sequence of "samples". A sample is a value of the signal at a point in time and/or space; this definition differs from the term's usage in statistics, which refers to a set of such values.

A numerically controlled oscillator (NCO) is a digital signal generator which creates a synchronous, discrete-time, discrete-valued representation of a waveform, usually sinusoidal. NCOs are often used in conjunction with a digital-to-analog converter (DAC) at the output to create a direct digital synthesizer (DDS).

<span class="mw-page-title-main">Quantization (signal processing)</span> Process of mapping a continuous set to a countable set

Quantization, in mathematics and digital signal processing, is the process of mapping input values from a large set to output values in a (countable) smaller set, often with a finite number of elements. Rounding and truncation are typical examples of quantization processes. Quantization is involved to some degree in nearly all digital signal processing, as the process of representing a signal in digital form ordinarily involves rounding. Quantization also forms the core of essentially all lossy compression algorithms.

In control systems, sliding mode control (SMC) is a nonlinear control method that alters the dynamics of a nonlinear system by applying a discontinuous control signal that forces the system to "slide" along a cross-section of the system's normal behavior. The state-feedback control law is not a continuous function of time. Instead, it can switch from one continuous structure to another based on the current position in the state space. Hence, sliding mode control is a variable structure control method. The multiple control structures are designed so that trajectories always move toward an adjacent region with a different control structure, and so the ultimate trajectory will not exist entirely within one control structure. Instead, it will slide along the boundaries of the control structures. The motion of the system as it slides along these boundaries is called a sliding mode and the geometrical locus consisting of the boundaries is called the sliding (hyper)surface. In the context of modern control theory, any variable structure system, like a system under SMC, may be viewed as a special case of a hybrid dynamical system as the system both flows through a continuous state space but also moves through different discrete control modes.

Continuously variable slope delta modulation is a voice coding method. It is a delta modulation with variable step size, first proposed by Greefkes and Riemens in 1970.

Amplitude-shift keying (ASK) is a form of amplitude modulation that represents digital data as variations in the amplitude of a carrier wave. In an ASK system, a symbol, representing one or more bits, is sent by transmitting a fixed-amplitude carrier wave at a fixed frequency for a specific time duration. For example, if each symbol represents a single bit, then the carrier signal could be transmitted at nominal amplitude when the input value is 1, but transmitted at reduced amplitude or not at all when the input value is 0.

Noise shaping is a technique typically used in digital audio, image, and video processing, usually in combination with dithering, as part of the process of quantization or bit-depth reduction of a signal. Its purpose is to increase the apparent signal-to-noise ratio of the resultant signal. It does this by altering the spectral shape of the error that is introduced by dithering and quantization; such that the noise power is at a lower level in frequency bands at which noise is considered to be less desirable and at a correspondingly higher level in bands where it is considered to be more desirable. A popular noise shaping algorithm used in image processing is known as ‘Floyd Steinberg dithering’; and many noise shaping algorithms used in audio processing are based on an ‘Absolute threshold of hearing’ model.

<span class="mw-page-title-main">Delta-sigma modulation</span> Method for converting signals between digital and analog

Delta-sigma modulation is an oversampling method for encoding signals into low bit depth digital signals at a very high sample-frequency as part of the process of delta-sigma analog-to-digital converters (ADCs) and digital-to-analog converters (DACs). Delta-sigma modulation achieves high quality by utilizing a negative feedback loop during quantization to the lower bit depth that continuously corrects quantization errors and moves quantization noise to higher frequencies well above the original signal's bandwidth. Subsequent low-pass filtering for demodulation easily removes this high frequency noise and time averages to achieve high accuracy in amplitude which can be ultimately encoded as pulse-code modulation (PCM).

<span class="mw-page-title-main">Audio bit depth</span> Number of bits of information recorded for each digital audio sample

In digital audio using pulse-code modulation (PCM), bit depth is the number of bits of information in each sample, and it directly corresponds to the resolution of each sample. Examples of bit depth include Compact Disc Digital Audio, which uses 16 bits per sample, and DVD-Audio and Blu-ray Disc, which can support up to 24 bits per sample.

Pulse-code modulation (PCM) is a method used to digitally represent sampled analog signals. It is the standard form of digital audio in computers, compact discs, digital telephony and other digital audio applications. In a PCM stream, the amplitude of the analog signal is sampled at uniform intervals, and each sample is quantized to the nearest value within a range of digital steps.

<span class="mw-page-title-main">Digital signal</span> Signal used to represent data as a sequence of discrete values

A digital signal is a signal that represents data as a sequence of discrete values; at any given time it can only take on, at most, one of a finite number of values. This contrasts with an analog signal, which represents continuous values; at any given time it represents a real number within a continuous range of values.

Stochastic Signal Density Modulation (SSDM) is a novel power modulation technique primarily used for LED power control. The information is encoded - or the power level is set - using pulses that have pseudo-random widths. The pulses are produced so that, on average, the produced signal will have the desired ratio between high and low states. The main benefit of using SSDM over, for example, Pulse-width modulation (PWM), which is usually the preferred method for controlling LED power, is reduced electromagnetic interference. Figure 1 illustrates a SSDM signal and demonstrates how the average signal density approaches desired value. The pseudo-random pulses in the signal are visible.

References

  1. Fried, Limor (2018-01-10). "Adafruit PDM Microphone Breakout". Adafruit Learning System. Archived from the original on 2022-12-08. Retrieved 2023-06-30.
  2. Thomas Kite. "Understanding PDM Digital Audio" (PDF). 2012. The "PDM Microphones" section on p. 6.
  3. 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.
  4. Knowles. "SPK0641 Digital, CMOS MEMS Microphone" (PDF).

Further reading