Electronics notes/Signal modulation

From Helpful
(Redirected from PCM)
Jump to: navigation, search
This is for beginners and very much by a beginner / hobbyist.

It's intended to get an intuitive overview for hobbyist needs. It may get you started, but to be able to do anything remotely clever, follow a proper course or read a good book.

Some basics and reference: Volts, amps, energy, power · batteries · resistors · transistors · fuses · diodes · capacitors · inductors · ground

Slightly less basic: amplifier notes · varistors · changing voltage · transformers · baluns · frequency generation · Transmission lines · skin effect

And some more applied stuff:

IO: Input and output pins · wired local IO · wired local-ish IO · ·  Various wireless · 802.11 (WiFi) · cell phone

Sensors: General sensor notes, voltage and current sensing · Knobs and dials · Pressure sensing · Temperature sensing · humidity sensing · Light sensing · Movement sensing · Capacitive sensing · Touch screen notes

Actuators: General actuator notes, circuit protection · Motors and servos · Solenoids

Noise stuff: Stray signals and noise · sound-related noise names · electronic non-coupled noise names · electronic coupled noise · ground loop · strategies to avoid coupled noise · Sampling, reproduction, and transmission distortions

Audio notes: See avnotes

Platform specific

Arduino and AVR notes · (Ethernet)
Microcontroller and computer platforms ··· ESP series notes · STM32 series notes

Less sorted: Ground · device voltage and impedance, audio and otherwise · electricity and humans · power supply considerations · Common terms, useful basics, soldering · PLL · pulse modulation · signal reflection · resource metering · SDR · Project boxes · vacuum tubes · Unsorted stuff

Some stuff I've messed with: Avrusb500v2 · GPS · Hilo GPRS · JY-MCU · DMX · Thermal printer ·

See also Category:Electronics.

Most broadly, pulse modulation refers to modulating or communicating or approximating a signal in a way involving pulse trains.

Note also that PAM resembles AM, PPM resembles PM, and PWM (moderately) resembles FM.

(Also, some of these parts run into analog and digital (passband) modulation, and for decent handling of said topics you're much better off on serious sites for those.)

Purposes and best uses are varied.

Side note: Pulse Code Modulation

Pulse-code modulation refers to using samples at at regular (uniform) intervals, and storing them as distinct values.

It's only really about quantized signal storage - about how to store it, and what it represents, and uses like transmission (e.g. multiplexing signals on a telephone line).

...and is not a reproduction technique, like most of this page. (reproduction was a separate thing even in the earliest development of these concepts)

Variants include:

Unqualified PCM usually means LCPM (Linear PCM)

quantization levels are linearly uniform, i.e. ratiometric with the represented signal
this is the easiest raw format to deal with, particularly when you have enough storage/bandwidth
used for sound, it means most of the bits are used on really quiet stuff (because human perception is logarithmic). This is part of why 8-bit PCM is audibly not enough, and 16-bit is for most things.
Directly used in Audio CDs (Red Book), in WAV files, and quite a few others.
Also used in some way or other in a number sound- or music-related electronics, although note that mu-law and a-law are also common.

μ-law (mu-law) and A-law are two specific types of logarithmic PCM

since input and output is often linear, this is often used to effectively compand signal while in transmission/storage
Because of the nonlinear way we hear loudness, and given a fixed, limited bandwidth, we get better signal-to-quantization-noise ratio than linear PCM
mu-law and a-law often imply 8-bit implementations (see also ITU-T G.711), as e.g. used in early digital phone transmissions, which in quality are roughly comparable to the quality of 12-bit linear PCM

but if storage is not a hard constraint (and harder than CPU use), linear PCM is easier and log PCM is probably more work than it's worth

(even though technically 16-bit logarithmic still give better detail than linear 16-bit(verify), you generally don't need it)

Delta Modulation / Delta PCM

says that instead of storing the absolute values, we store the difference from the last.
This is generally a smaller number, so allows a slight reduction in storage, but not much.

ADPCM is Adaptive Delta PCM.

It takes the delta PCM output, and varies the amount of quantization of it. This is a lossy format that allows you to tweak bandwidth/SNR on noisy channels.

often 5-, 4-, or 3-bit

SB-ADPCM: ADPCM, but applied to distinct frequency Sub-Bands.

For example, G.722
splits into two bands (roughly 0Hz to 4kHz, and 4kHz to 8kHz), then applies ADPCM to each
This mainly so that you can spend bits differently, e.g. 48 of the 64 kbit/s on the lower sub-band that includes most voice energy, and 16 kbit/s on the rest. (G.722 actually has a few different target bitrates)

Even when storage/transmission is mu-law/A-law or ADPCM or some other codec, processing on endpoints is often LPCM, mostly because it's easier and faster to work with.

For context on companding: linear PCM is not clever about spreading quantization to where our (approximately logarithmic) perception hears it best. Companding basically rescales (in a reversible way) to reduce that issue.

The companding step is lossy, but since the signal to noise ratio is better than linear PCM in the same amount of bits, it provides quality improvements - and rather useful whenever you are bandwidth-limited.

Both μ-law and A-law are used in analog and digital telecommunication (in analog it was mostly for quality, in digital tranfer it was also handy for compression), in different countries.

The .au sound format uses μ-law.

See also:

See also:


Continuous wave modulation

Amplitude Modulation (AM)

Frequency Modulation (FM)

Phase Modulation (PM)

Related: Dimming practicalities

Pulse modulation

Pulse Amplitude Modulation (PAM)

Pulse Skip Modulation (PSM)

Pulse Position Modulation (PPM)

Pulse Density Modulation (PDM), Delta-Sigma modulation (ΔΣM)

Pulse Width Modulation (PWM)

Pulse width modulation refers to switching between on and off, changing the amount it's held on, relative to the time it's held off, to vary the energy delivered (or average voltage level) over a somewhat longer term.

When implemented digitally (as it usually is), this is typically a counter plus a threshold above which to switch on.

This means there is a clock rate at which it could switch between the two.

...and a much lower speed at which the entire thing goes on and off and repeats.

For example, if it can count and switch at 1MHz, and have a 8-bit counter, then the waveform it creates repeats at (1000000/256 ~=) 3.9kHz.

This will sometimes be called the 'PWM speed', or just output speed. This isn't the best name, so check what is meant.

See also

Practical notes

PWM Types

PWM for average energy

Hardware PWM, software PWM, and inbetween

PWM or PDM as a simple DAC

Sound PWM

On PWM resolution

On PWM distortion

On PWM oversampling


On PWM filtering

PWM IC notes



Comparing PDM and PWM

Combining PWM or PDM outputs for bit depth