# Envelope detector
An **envelope detector**, sometimes called a peak detector, is an electronic circuit that takes a relatively high-frequency signal as its input and outputs the slowly varying envelope, the curve traced by the peaks, of that signal; in radio receivers it is most often built from a single diode and a resistor-capacitor (RC) network, and used to recover the audio carried by an amplitude-modulated [[Carrier_wave|carrier]]. A three.js companion sketch elsewhere on the site, built as a variant of the neighbouring crystal-radio sketch, renders that same RC time constant set against the speed of the modulation it must track.
The idea long predates the transistor: the simplest working [[Crystal_radio|crystal radio]] is little more than a tuned circuit feeding a single rectifying element and a small capacitor, and that rectifier-and-capacitor pair is already a complete envelope detector. The same circuit, refined with feedback to cancel a diode's own nonlinearity, also serves wherever a circuit needs the peak or the running amplitude of a fast signal rather than the signal itself, from broadcast radios to test instruments.
Because the same resistor-capacitor time constant that lets a detector smooth away the carrier can also blur a rapidly changing envelope if it is chosen too large, picking that constant correctly, covered in General considerations below, is most of what designing one amounts to.
## Diode detector
A diode detector is the classic implementation: the incoming signal drives a single [[Diode|diode]] in series with the source, and a [[Capacitor|capacitor]] from the diode's output to the circuit's return conducts to ground in parallel with a load [[Resistor|resistor]]. On each positive half-cycle of the carrier the diode conducts and charges the capacitor toward that cycle's instantaneous peak; between peaks the diode is reverse-biased and stops conducting, and the capacitor instead discharges through the resistor, its voltage decaying exponentially with time constant `RC`. A capacitor charging or discharging through a resistor obeys the same first-order differential equation as any other single-energy-storage circuit, `dy/dt + a*y = u(t)` with `a = 1/RC`,[^rc-ode] whose solution rises or falls as `1 - exp(-t/RC)` and reaches roughly 63 percent of its final change after exactly one time constant, `t = RC`, regardless of how large that change is.[^rc-charge] Provided `RC` is short next to the carrier's own period, the capacitor's voltage sags only a little between successive peaks, and the resulting output traces a staircase hugging the carrier's peaks closely enough to stand in for the smooth envelope those peaks describe.
### AM demodulation
For an [[Amplitude_modulation|amplitude-modulated]] carrier the envelope is, by construction, the original modulating waveform riding on a constant offset set by the unmodulated carrier's own amplitude, so a diode detector that faithfully tracks the envelope has, in the same step, demodulated the signal: no separate frequency-translation stage is needed beyond the RC network itself and whatever [[Low-pass_filter|low-pass filtering]] removes the residual carrier ripple afterward. This is what makes the circuit the cheapest possible AM demodulator, and why it remains the detector used in a basic crystal radio, and at the back end of most [[Superheterodyne_receiver|superheterodyne]] AM broadcast receivers, largely unchanged since.
## General considerations
Choosing the time constant `RC` is a compromise stated most simply in the frequency domain: filtering a periodic waveform with a single-pole RC low-pass leaves every harmonic above the cutoff `f_c = 1/(2*pi*R*C)` attenuated while passing the mean essentially untouched, since the filter's response at zero frequency is exactly 1 regardless of where the cutoff sits.[^rc-mean] A worked example with a 20 percent duty-cycle pulse train and a 1 millisecond period shows the waveform's edges rounding progressively as the cutoff is swept from 10 kHz down through 1 kHz to 100 Hz, with the output's average value unchanged at every one of the three settings.[^rc-lowpass] For an envelope detector the equivalent requirement is that `RC` sit comfortably above the carrier's own period yet comfortably below the period of the fastest change the modulation makes, `1/f_carrier << RC << 1/f_modulation`, so the detector smooths the fast ripple away without also smoothing away the slower information that ripple rides on.
A second consideration is the diode's own nonlinearity. At large signal levels, well above the diode's forward turn-on voltage, it behaves close to an ideal switch and the detector operates in its linear region, where the output follows the input's peak amplitude directly; at small signal levels, comparable to or below that turn-on voltage, the diode's current instead follows roughly the square of the applied voltage, a square-law region in which the output follows signal power rather than amplitude and in which two nearby signals can intermodulate inside the diode itself. A [[Germanium|germanium]] diode's lower forward voltage than a silicon diode's extends the linear region down to weaker signals, one reason germanium point-contact diodes remained the standard choice for simple radio-frequency detectors long after silicon displaced germanium almost everywhere else in electronics.
## Definition of the envelope
The description above treats the envelope informally, as the curve joining the peaks of a rapidly oscillating waveform, which is exact only when the carrier's amplitude changes slowly compared with the carrier itself. A general definition instead comes from the [[Analytic_signal|analytic signal]]: given a real signal `s(t)`, its [[Hilbert_transform|Hilbert transform]] `s_hat(t)` is the same signal with every frequency component shifted 90 degrees in phase, and the complex analytic signal `s(t) + j*s_hat(t)` has magnitude `A(t) = sqrt(s(t)^2 + s_hat(t)^2)`, the envelope in the fully general sense, which reduces to the ordinary peak-following description above whenever the signal is a slowly modulated carrier. Computing a Hilbert transform is impractical for a simple analogue circuit to do directly, which is exactly why a practical detector instead approximates the envelope with the much simpler diode-and-RC construction above, accepting the small distortion that approximation introduces in exchange for a circuit built from one nonlinear element and two passive parts.
## Precision detector
A passive diode-and-RC detector cannot follow a signal much smaller than the diode's own forward voltage, since the diode barely conducts at all below that threshold; a precision detector removes this limitation by placing the diode inside the feedback loop of an operational amplifier, so that the amplifier's open-loop gain drives the diode into conduction regardless of how small the input is, cancelling the diode's forward-voltage drop from the result almost entirely. The output then tracks the true peak of even a very small input, at the cost of the extra active circuitry and the amplifier's own bandwidth limit, which must stay well above the carrier frequency for the feedback to keep up with each peak. This active topology is the standard way of extending peak or envelope detection down to signal levels a passive diode detector would simply fail to register, and it appears throughout instrumentation and audio metering wherever a small signal's true peak, rather than a demodulated radio carrier, is what is wanted.
## Drawbacks
The same time constant that lets a diode detector reject carrier ripple can also fail to keep up with the envelope itself. If the modulation depth approaches 100 percent, the envelope can fall faster, during its deepest dips, than the capacitor can discharge through the load resistor, and the detector's output then traces the capacitor's own fixed RC decay instead of the true, faster-falling envelope, a failure called diagonal clipping that shows up as audible distortion on deeply modulated peaks. Choosing a shorter `RC` to avoid it reintroduces carrier ripple into the output, so a single fixed time constant can only ever compromise between the two, which is one reason a precision detector's feedback, or a receiver with automatic control over its own detector time constant, is preferred wherever modulation depth varies widely.
A diode detector is also a nonlinear load on whatever tuned circuit feeds it, drawing current only near the peak of each cycle rather than smoothly throughout it, so its own input impedance depends on signal level and can detune or damp a sensitive front-end circuit unless the two are deliberately isolated. Finally, because the circuit responds only to amplitude, it is blind by construction to information carried in a signal's phase or frequency: an envelope detector fed a constant-amplitude [[Frequency_modulation|frequency-modulated]] carrier produces essentially no output at all, which is why frequency modulation is demodulated with a discriminator or a phase-locked loop rather than with the circuit described here.
## Audio
After the diode-and-RC stage, the detector's output still carries three components mixed together: the wanted audio, a small residual ripple at the carrier frequency and its harmonics that the RC network did not fully remove, and a steady direct-current level set by the average, unmodulated strength of the carrier. A further, lighter low-pass filter stage after the detector removes most of the remaining carrier ripple before the signal reaches an audio amplifier, and a series coupling capacitor conventionally blocks the direct-current level so that only the wanted audio passes onward. That blocked level is rarely wasted: because it tracks the carrier's average strength regardless of the audio riding on top of it, and regardless of the RC network's own cutoff,[^rc-mean] it is routinely tapped off before the coupling capacitor and fed back to the receiver's earlier stages as the control voltage for [[Automatic_gain_control|automatic gain control]], letting the same diode that demodulates a station also measure how strong that station is; this is a different task from [[Dynamic_range_compression|dynamic range compression]], which reshapes an already-recovered audio signal's own loudness range rather than recovering that signal from a carrier in the first place.
## Microsims
This article carries no p5.js sketch of its own. A three.js companion, built as a variant of the neighbouring crystal-radio sketch, instead renders the same RC time constant set against the speed of the modulation described above: how short that constant must be to track a fast-changing envelope, and how long it may run before carrier ripple starts to show through the output.
*Try:* in the [[Sonar]] sketch, watch a target's echo glow brighten the instant it returns and fade over the following frames - the same rise-and-decay shape an envelope detector traces across the peak of a single pulse, stretched out here into something visible frame by frame instead of held on a capacitor.
*Try:* in the [[Doppler_effect]] sketch, note that both observer markers report a frequency, never an amplitude - the one quantity an envelope detector can never recover, which is why a frequency-modulated carrier needs an entirely different kind of detector.
## Wikipedia : Wikitube
**Strict pair:** [Wikipedia](https://en.wikipedia.org/wiki/Envelope_detector) : [Wikitube](https://en.wikitube.io/wiki/Envelope_detector)
Skeleton mirrored at revision 1346187697. Prose, emphasis and the microsims are Wikitube's own.
## See also
- [[Crystal_radio]]
- [[Amplitude_modulation]]
- [[Diode]]
- [[Analytic_signal]]
- [[Automatic_gain_control]]
- [[Superheterodyne_receiver]]
## References
The RC charge and discharge law and the low-pass filter's unchanged response at zero frequency are standard textbook results and are not separately footnoted beyond the citations below, per the Wikitube style guide §6.1. Page numbers are PDF pages of the open editions linked below.
[^rc-ode]: Johnson, D. *Fundamentals of Electrical Engineering I*. 2014, p. 30 (PDF page). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/fundamentals-of-electrical-engineering-1 . CC BY.
[^rc-charge]: Tiberius, C.; Mulder, M. *Engineering Signal Analysis: From Fourier to filtering: Theory*. 2026, p. 95 (PDF page). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory . CC BY.
[^rc-lowpass]: Johnson, D. *Fundamentals of Electrical Engineering I*. 2014, p. 119 (PDF page). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/fundamentals-of-electrical-engineering-1 . CC BY.
[^rc-mean]: Johnson, D. *Fundamentals of Electrical Engineering I*. 2014, p. 146 (PDF page). Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/fundamentals-of-electrical-engineering-1 . CC BY.
**Further reading** — the open textbooks this article draws on, since the pair carries no separate Further reading heading of its own:
- Don Johnson. *Fundamentals of Electrical Engineering I*. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/fundamentals-of-electrical-engineering-1
- Christian Tiberius; Max Mulder. *Engineering Signal Analysis: From Fourier to filtering: Theory*. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/engineering-signal-analysis-from-fourier-to-filtering-theory
- Steven Ellingson. *Radio Systems Engineering, Revised First Edition*. Open Textbook Library: https://open.umn.edu/opentextbooks/textbooks/radio-systems-engineering
## External links
This article carries no p5.js sketch of its own, and its three.js companion is embedded in the Microsims section above once the portal build places it, with its own link. The live sketches this article's *Try:* lines send the reader to are:
- Sonar, live: https://editor.p5js.org/sciencenibber/full/JUw9ofgG6 — editor: https://editor.p5js.org/sciencenibber/sketches/JUw9ofgG6
- Doppler effect, live: https://editor.p5js.org/sciencenibber/full/ZeLNTrMSo — editor: https://editor.p5js.org/sciencenibber/sketches/ZeLNTrMSo
<!-- Hubs: Signal_processing. Portals: PORTAL_Radio. Radio portal wave 1 · 2026-09-17 · drafted. -->