Digital Envelope Detection: The Good,
the Bad, and the Ugly
Rick Lyons●April 3, 2016●11 comments
Audio DSP
Communication
Tutorials
Recently I've been thinking about the process of envelope detection. Tutorial
information on this topic is readily available but that information is spread out over a
number of DSP textbooks and many Internet web sites. The purpose of this blog is to
summarize various digital envelope detection methods in one place.
Here I focus on envelope detection as it is applied to an amplitude-fluctuating sinusoidal
signal where the positive-amplitude fluctuations (the sinusoid's envelope) contain some
sort of information. Let's begin by looking at the simplest envelope detection method.
ASYNCHRONOUS HALF-WAVE ENVELOPE
DETECTION
Figure 1 is a digital version of a popular envelope detector used in the analog world for
amplitude modulation (AM) demodulation in analog AM receivers. The job of this
envelope detector is to extract (detect) the low frequency amplitude envelope signal (the
dashed curve) from the incoming RF signal.
This article is available in PDF format for easy printing
Note: Although the signal waveforms in Figure 1 appear to be continuous, keep in mind
that they are indeed discrete-time numerical sequences (digital signals).
Figure 1: Asynchronous half-wave envelope detector.
Due to the harmonics (multiples of the incoming fc carrier frequency) generated by half-
wave rectification in Figure 1 and possible spectral aliasing depending on the
system's fs sample rate, careful spectrum analysis of the half-wave rectified sinusoid is
necessary to help you determine the appropriate cutoff frequency of the digital lowpass
filter. Here I used a simple third-order IIR lowpass filter to generate all of the output
envelope waveforms presented in this blog.
This simple detector is called "asynchronous" because it need not generate a constant
amplitude copy of the incoming RF sinusoid, as do some of the other detectors we'll be
discussing.
ASYNCHRONOUS FULL-WAVE ENVELOPE
DETECTION
We can reduce the high-frequency noise riding on the Figure 1 detector output by
performing full-wave rectification as shown in Figure 2 [1].
Figure 2: Asynchronous full-wave envelope detector.
Here the lowest-frequency spectral harmonic at the filter's input is 2 fc Hz. So that
harmonic is more thoroughly attenuated at the Figure 2 lowpass filter output compared
to the first fc Hz harmonic at the Figure 1 filter output.
ASYNCHRONOUS REAL SQUARE-LAW ENVELOPE
DETECTION
Figure 3 is a digital version of a popular square-law analog envelope detector
(sometimes called a "product detector").
Figure 3: Asynchronous real square-law envelope detector.
Here the spectral harmonics at the filter's input are the same as those in Figure 2.
References [2,3] give a mathematical description of the Figure 3 envelope detector.
ASYNCHRONOUS COMPLEX ENVELOPE DETECTION
Figure 4 shows a popular digital envelope detector that uses a Hilbert transformer to
compute a complex-valued version of the incoming signal. (This detector is described in
more detail in Reference [4].)
Figure 4: Asynchronous complex envelope detector.
The above Hilbert transformer need not be super high-performance, such as a
wideband one whose passband extends from nearly zero Hz to nearly half the sample
rate (fs/2 Hz). The transformer's passband need only be wide enough to include the
spectral energy of the incoming RF signal.
ASYNCHRONOUS COMPLEX SQUARE-LAW
ENVELOPE DETECTION
Another digital envelope detector that uses a Hilbert transformer is shown in Figure 5.
(This detector is described in more detail in References [2,3].)
Figure 5: Asynchronous complex square-law envelope detector.
This is a most interesting envelope detector. Reference [5] touts this detector's
advantage that no lowpass filtering is needed at the output of the square root operation.
However, I have learned this only to be true for noise-free signals! In practical real-world
applications the lowpass filter I've included in Figure 5 is necessary.
SYNCHRONOUS REAL ENVELOPE DETECTION
Figure 6 shows an envelope detector that's called "synchronous" because the RF input
signal is multiplied by a local oscillator signal whose frequency is fc Hz. (This detector is
sometimes called a "coherent envelope detector.")
Figure 6: Synchronous Real Envelope Detector.
The complicated part of this detector is that the fc Hz carrier frequency of the received
RF input signal must be regenerated (a process called "carrier recovery") within the
envelope detector to provide the local
oscillator's cos(2πfct+ϕ)cos(2πfct+ϕ) signal. Another complication is that the
local oscillator output must be in-phase with the input RF signal's sinusoid.
Reference [6] gives a detailed mathematical description of this synchronous envelope
detector.
ASYNCHRONOUS COMPLEX ENVELOPE DETECTION
Reference [7] proposes the Figure 7 envelope detector that compute a complex-valued
version of the incoming signal.
Figure 7: Asynchronous complex envelope detector.
This detector is asynchronous in operation because the local oscillators' fo frequency
need not be equal to the fc frequency of the incoming modulated RF signal. An fo within
25% of fc is acceptable so long as the lowpass filters sufficiently attenuate spectral
energy near |fc+fo| Hz.
Because the I(n) and Q(n) sequences are in quadrature, phase cancellation occurs in
the adder such that only spectral energy in the vicinity of zero Hz appears at the adder's
output. As such, this detector is very tolerant of local oscillator frequency/phase drift just
so long as the local cosine/sine oscillators remain in quadrature.
Although I haven't seen it in the literature it seemed to me that we can eliminate one of
the filters in Figure 7 and implement that envelope detector as shown in Figure 8.
Figure 8: An alternate synchronous complex envelope detector.
Upon analysis of this Figure 8 detector I was surprised to determine that
it's exactly equivalent to the Figure 2 asynchronous full-wave envelope detector! The
reader can verify this by solving the following homework problem:
HOMEWORK PROBLEM FOR THE READER:
Assume an input sample to the Figure 8 detector has a value of A and the cosine
oscillator's sample is cos(α)cos(α). What is the value of the output sample of the
square root operation? Assuming the next input sample to detector has a value of -A
and the cosine oscillator's next sample is cos(β)cos(β), what is the value of the
next output sample of the square root operation?
There's no reason to discuss the Figure 8 detector any further.
DETECTOR PERFORMANCE: THE GOOD, THE BAD,
AND THE UGLY
If you'll accept the definition of "performance" to indicate a detector's output signal-to-
noise ratio (SNR) for a given noisy RF input signal, you'll notice that I've presented no
statistical information on the performance of the various envelope detectors here. (That
was not my goal.) However, I do have a few comments regarding performance.
For applications where high accuracy is not needed, such as automatic gain control
(AGC) or amplitude-shift keying (ASK) demodulation, the Figure 1 detector is attractive
because it's so easy to implement. Equally easy to implement, the Figure 2 detector has
been used to process medical electromyogram (EMG) signals [8].
References [9,10] show the superiority of the Figure 4 envelope detector over the
Figure 2 detector in a medical ultrasound signal analysis application.
Based on my very limited modeling of the various envelope detectors, with:
• Sample rate: fs = 8000 Hz
• RF carrier frequency: 600 Hz
• Modulation: 60 Hz sine plus 30 Hz cosine wave
• Modulated RF signal SNR: +20 dB
• Lowpass filter: 3rd-order IIR (≈240 Hz cutoff frequency)
I rank the detectors' performances (from best to worst) as follows:
Highest output
Asynch Complex (Figure 4)
SNR:
↓ Asynch Complex Square-Law (Figure 5)
↓ Asynch Full-Wave (Figure 2)
↓ Asynch Complex (Figure 7)
↓ Synch Real (Figure 6)
↓ Asynch Real Square-Law (Figure 3)
Lowest output SNR: Asynch Half-Wave (Figure 1)
If you need an envelope detector in some real world application, I suggest you
implement several of the above detectors to see which one is optimum for your signals
and your fs data sample rate. To quote Forrest Gump, "And that's all I have to say about
that."