Sie sind auf Seite 1von 6

COMMUNICATIONS

Aliasing in Digital Clippers and Compressors*

PAUL KRAGHT, AES Associate Member

Beckman Coulter, Brea, CA 92821, USA

Digital signal limiters and dynamic-range compressors generate aliasing as an undesirable


side effect. This aliasing can be clearly audible. The origin of aliasing in digital limiters and
compressors is discussed. Soft limiting, increasing the compressor detector time constant,
and higher order detectors are discussed as methods to reduce aliasing.

0 INTRODUCTION is discontinuous at t0. The discontinuity of the first deriv-


ative gives rise to a spectrum that asymptotically de-
In the process of sound engineering, dynamics pro- creases by 12 dB per octave. (In general, if the disconti-
cessing is often essential. For instance, clipping is neces- nuity is in the nth derivative, the spectrum decreases by
sary to avoid overmodulating a broadcast signal, and 6(n + 1) dB per octave; see, for example, [2, p. 144].)
dynamics compression is valuable sothat the entire pro- For instance, Fig. 1, reproduced from [1], shows 10-kHz
gram can be heard easily, given a noisy transmission or sine-wave clipping harmonics for three clip threshold
listening environment. These techniques also apply to settings. Note that once a high enough frequency is
digital audio. However, such nonlinear signal processing reached, they all decrease 12 dB per octave, or 40 dB
generates aliasing. For instance, Mapes-Riordan [1] re- per decade. The magnitude of the higher frequencies
ports severe aliasing in digital limiting and less severe depends mainly on the size of the derivative discontinu-
but still audible aliasing in digital dynamic-range com- ities and how frequently they occur. Hence 0.1-dB elip-
pressors. This communication analyzes the origin of ping produces smaller first-derivative discontinuities
aliasing and suggests practical methods to reduce or ef- than 1-dB clipping, and the high-frequency amplitudes
fectively eliminate it. are correspondingly lower. Note that the harmonics of
Suppose we have a continuous band-limited input sig- the square wave decrease only 6 dB per octave. This
nal y(t), which is to be amplitude modulated by m(t), is because the function itself is discontinuous (in the
producing the sampled signal z(t) = y(t)m(t). Since m zeroth derivative).
is sampled rather than continuous, it can be represented The case of 20-dB clipping is interesting. The harmon-
by re(t) = f(t)s(t), wherefis a continuous function and its appear much like the square wave up to about 100
s is the sampling function. Thus z(t) = y(t)f(t)s(t), kHz (6 dB per octave), then diminish 12 dB per octave
Aliasing occurs to the extent that the continuous modu- at higher frequencies. The reason is this: the rise time
lated function c(t) = y(t)f(t) is not band-limited, from negative clipping to positive clipping is very short,
but finite, namely, 3.2 Ixs. At frequencies below roughly
1 DIGITAL CLIPPING 100 kHz, this appears nearly instantaneous, and the sig-
nal acts as if it were discontinuous. Frequencies above
In the case of the digital clipper, c is the clipped 100 kHz can accommodate the rise time fairly well, so
signal. Thus to the extent that c is not band-limited, z the signal then acts as if it were continuous, but with a
will present aliasing. Let to be a time at which y(t) equals discontinuous first derivative.
the clipping value L. For the sake of discussion, suppose
y is increasing at to. Then immediately before to, the 1.1 Reducing Clipping-Generated Allaslng
derivative of c(t) is greater than zero, and immediately As Fig. 1 shows, we have severe aliasing with a digital
after to the derivative is zero. In general, the derivative clipper. This is due to the large first-derivative disconti-
nuities combined with an attenuation of only 12 dB per
* Manuscript received 2000 January 10; revised 2000 June octave. Oversampling into the MHz range is necessary
16 and September 18. to avoid aliasing. However, it is possible to increase the

1060 J. AudioEng.Soc.,Vol.48,No.11,2000November
COMMUNICATIONS DIGITAL CLIPPERS AND COMPRESSORS

attenuation per octave. This can be done only if we ping because the transition takes less time, causing the
can make c(t) continuous in the first derivative. A hard 12-dB per octave slope to persist to correspondingly
clipper cannot do this, but a soft clipper can. There is, higher frequencies. But soft limiting helps significantly
of course, a tradeoff here: a hard clipper produces no with mild clipping such as in the preceding example.
distortion clear up to 0 dB, whereas a soft limiter starts
modifying the signal somewhat below 0 dB, thereby 2 DIGITAL DYNAMIC-RANGE COMPRESSION
reducing the unclipped dynamic range. For instance,
suppose we use the soft-clipping function Although less obvious, digital dynamic-range com-
pressors also generate aliasing. Happily it turns out that

out using oversampling, but we must first understand


c = - (y + 8 - L)2/48, L - 8< y < L + 8 the cause. For a worst-case example, suppose the com-
pressor uses a oo:1 compression ratio and an rms-detector
,, yy I>
_<LL +- 88 time constant
aliasing "r = 1 ms. can
in compressors Thebeinput is the sum
effectively of 16 with-
avoided 995-
and 17 005-Hz sine waves, similar to what Mapes-Rior-
where L is the limit and 8 is the clipping range. Then c dan tested [1]. The sampling rate is 48 kHz. As shown
will be continuous in the first-derivative, but discontinu- in Floru [3], the compressor creates odd-harmonic dis-
ous in the second, and so the high frequencies will atten- tortion. The smaller _"is and the lower the frequency of
uate at 18 dB per octave. For example, consider the 10- the input, the greater the distortion. In our example the
kHz 1-dB clipping case with L = 1 and 5 = 0.1. This input is not a pure sine wave, but the sum oftwo sine
value of 8 reduces the unclipped dynamic range by 0.9 waves of nearly identical frequencies. Horn's observa-
dB. Fig. 2 compares a portion of the unclipped, hard- tions about distortion apply fairly accurately to this sig-
clipped, and soft-clipped signals. Fig. 3 compares the nal as well. But does the action of the compressor's
high-frequency components of c with hard clipping and attack and release, responding to the signal's amplitude
soft clipping. Fig. 2 shows that the transition from origi- modulation, also contribute to higher frequencies? Fig.
hal signal to clipped takes about 7 _s, and so should 4 compares the spectrum of the compressor output with
appear instantaneous below roughly 50 kI-Iz. Fig. 3 the 16 995/17 005-Hz pair and pure 17 kHz. The pure
shows that the spectra are nearly identical below this sine wave gives pure odd harmonics at 51, 85, 119 kHz,
frequency. Higher frequencies accommodate the transi- and so on. With a sampling frequency of 48 kHz, these
tiontime, and so the spectra differ, with the soft-limited harmonics alias to 3, 11, and 23 kHz, respectively.
version decreasing 18 dB per octave. The hard-clipped These same harmonics appear with similar amplitudes
signal has components above - 100 dB up to 2330 kHz, with the 16 995/17 005-Hz pair, but the peaks are broad-
compared to 610 kI-Iz with the soft-clipped signal. In ened by the amplitude modulation. With -t = 1 ms, the
this example we reduce the required internal processing broadening is on the order of 1 kHz, not enough to
rate from about 5 MHz to around 1.3 MHz. cause notable aliasing. Fig. 5 shows the compressor gain
Soft limiting helps much less with more severe clip- versus time. Note that transitions take milliseconds, in

..... i ..................... i ......i............


10 4 10 s 10 s 10 z '

Frequency, Hz

Fig. 1. Level of harmonies for clipped 10-kHz sine wave at several clipping levels. (After Mapes-Riordan [1].)

J. Audio Eng. Soc., Vol. 48, No. 11, 2000 November 1061
KRAGHT COMMUNICATION

sharp contrast to the instantaneous or several-microsec- Hz signal. This is due to the lag between the input and
ond transitions of hard or soft clipping, the detector output. ThiJs during decay the signal is
Fig. 6 shows an enlargement of the compressor gain smaller than the detector's estimate, and so the peaks
for the 17-kHz and 16 995/17 005-Hz signals. The se- and troughs of the signal cause less fluctuation. On the
lection is at the peak of the gain, where the decay ends other hand, during attack there will be more than average
and the attack starts. A constant offset was added to the fluctuation. But the fluctuation and the resulting distor-
17-kHz gain to aid visual comparison. Note that the tion averages are about the same with the 16 995/
gain fluctuates by about 0.1 dB. This is caused by the 17 005-Hz signal as with 17 kHz.
compressor responding slightly to the peaks and troughs As mentioned, this is a worst-case example. The ear
in the 17-kHz input. These rapid gain fluctuations gener- is rather insensitive to the 17-kHz fundamental. The
ate the harmonics and aliasing. Note that the fluctuations third harmonic, which at - 50 dB relative to the funda-
are not of constant magnitude with the 16 995/17 005- mental is stronger than any other harmonic, aliases at 3

1.15 I I I i i

Hard clipped
_ Unclipped
Soft clipped

1.1 ",

1.05 .,"

,' '

0.95 /// \_

0.9

I
0.85
15 20 215 30 35

Time, microseconds

Fig. 2. Hard and soft clipping of a signal.

t E

I --- Hard clipped


Soft clipped ]

-140

104 10 s 106 107

Frequency, Hz

Fig. 3. Level of 10-kHz sine-wave clipping harmonics for hard and soft clipping.

1062 J. Audio Eng. Soc., Vol. 48, No. 11, 2000 November
COMMUNICATIONS DIGITAL CLIPPERS AND COMPRESSORS

kHz, where the ear is particularly sensitive. Finally, x several dB less with the sine-wave pair than with the
is only I ms, rather short for a compressor, and so causes pure sine wave, especially with higher harmonics.
more distortion than usual. However, there is a tradeoff involved with increasing
the time constant. If the time constant is too long, the
2.1 Reducing Compressor-Generated Ailasing detector may respond to a sudden amplitude increase
Distortion and its resulting aliasing may be reduced too slowly and then clip. Furthermore, a response that
by usinga longer detectortime constant.In the preceding is too slow causesan unnatural soundingattack. But if
example the third and fifth harmonics are above - 100 a slight time delay is tolerable, there could be a delay of
dB ( - 49 and - 95 dB, respectively). Increasing _"from a few millisecondsbetween the detectorandthe variable-
1 to 10 ms reduces the third and fifth harmonics down gain input. This gives the detector some time to adjust
to -69 and - 135 dB, so only the third harmonic is before the signal reaches the variable-gain processing.
above - 100 dB. Increasing x reduces the distortion by Then the gain does not have to respond to transients as

0 b i i i

-20 I--16995
I'17000Hz
+ 1700S Hz .....................................................................

40 ................................ :............................................

_-100 ...... , ....................... / .........................................


_o "''"J':
i,"'L .....................................
: '/"/_'' _ ..........................
[#3-120 i / .................................... / .....

, s
:/
-140 ......... _{..... i_..................... I l

///";" '', , " _i, ]


_,00 ....................................
/ .....................
! /'>.....
-18c
- I, /
/
', ! ........................
i/........................
<! '

il I I . _1 /
-2000 0.5 1.5 2
Frequency, Hz x lo'

Fig. 4. Frequency spectrum of compressed signals with 1-ms time constant.

20 .............................
25 ......................... ' I " i

r¢_15

1C

I I I
-50 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 018 0.2

Time, seconds

Fig. 5. Compressor gain with 16 995117 005-Hz signal.

J. Audio Eng. Soc., Vol. 48, No. 11, 2000 November 1063
KRAGHT COMMUNICATIONS

rapidly, and a larger time constant can be used. Note demonstrate the effectiveness of this approach, we re-
that this delay feature is available in some common digi- place the first-order low-pass filter having "r = 1 ms
tal compressors, with the concatenation of two first-order low-pass filters,
Another method is much more effective at reducing each with time constant as in "r/X/2. The factor of
distortion and aliasing. The detector responds slightly is needed so that the first- and second-order filters have
to the fluctuations in the 17-kHz signal, even though similar low-frequency responses. In addition we delay
these occur much more rapidly than the time constant the input to the variable-gain stage by (V'2 - 1)-t,
of 1 ms. This is because the detector is essentially a thereby matching the time lag between the variable-gain
first-order low-pass filter, and as such, the response to input and the detector output with the lag of the first-
high frequencies slopes only 6 dB per octave. If we use order system. Fig. 7 shows the spectrum of the compres-
a second-order low-pass filter, we double the slope and sor output with the 16 995/17 005-Hz pair and pure 17
eliminate high frequencies much more effectively. To kHz. Again, we see a spectral spreading virtually identi-

27.5 ! ! I I i i I i
: , i i •
"_ /'' /\\/_" /\/-\ _ .jr,\ /"_ j\ f_ /_\/-_ /\ /_'-, i.'_ I_/'\ /\.,f \ ,_ir-\ /'_ j_.f\\ I_\ i-_\ I\ .

26.5

26

L32s.s
27 ....

25

24.5

204 50.2
i 50.4
I 50.6
P 50.8
I 511 511.2 51.4
I 51.6
I 51.8
i 52

Time,milliseconds

Fig. 6_ Compressor gain at end of release and start of attack.

16995 + 17005 HZ I
-- 17000 Hz I

r_

= -100

/'

O 0.5 1 1.5 2

Frequency,
Hz _lo'

Fig. 7. Frequency spectrum of compressed signals with second-order detector..

1064 J. Audio Eng. Soc., Vol: 48, NO.11, 2000 November


COMMUNICATIONS DIGITAL
CLIPPERS
ANDCOMPRESSORS

cal to the first-order compressor, but the harmonics are like" quality to overrecorded signals.
greatly reduced. The third harmonic decreased by 30 dB By contrast, relatively little attention has been paid
from - 50 to - 80 riB, and the fifth harmonic decreased to aliasing generated by dynamic-range compression.
from -95 to - 155 dB. Also, increasing _"is more This is partly because the problem is not as severe, and
effective at reducing harmonics than in the first-order partly because the problem is not as well understood.
system. Increasing "rto 10/%/2 ms reduces the third har- The method of using a second- or higher order detector
monic by an additional 40 dB from - 80 to - 120 dB, eliminates aliasing very effectively. Furthermore, the
thereby completely eliminating the need for oversam- same method could greatly reduce harmonic distortion
pling to avoid aliasing, with analog compressors.

3 CONCLUSION 4 REFERENCES

Although reducing many of the distortions common [1] D. Mapes-Riordan, "A Worst-Case Analysis for
to analog audio, digital audio has problems unique to Analog-Quality (Alias-Free) Digital Dynamics Pro-
itself. Aliasing is a particular problem with digital dy- cessing," J. Audio Eng. Soc. (Engineering Reports),
namics processing. It is especially severe with digital vol. 47, pp. 948-952 (1999 Nov.).
clipping. Using soft limiting will reduce aliasing, but at [2] R. Bracewell, The Fourier Transform andIts Appli-
the cost of reducing the dynamic range slightly. This cations, 3rd ed. (McGraw-Hill, New York, 1986), p. 144.
may be acceptable for many applications. In fact, soft [3] F. Floru, "Attack and Release Time Constants
limiting has been used in digital audio for some time in RMS-Based Feedback Compressors," J. Audio Eng.
now and is said to give a "smoother" and more "analog- Soc., vol. 47, pp. 788-804 (1999 Oct.).

THE AUTHOR

Paul Kraght was born in 1955 and currentlylives in effects of signal quantization, and the effect of the anti-
Glendora, CA. He received a B.S. degree in applied aliasing and antiimaging filters that were being used.
mathematics from Harvey MuddCollege in 1981. Since More recently he designed a PC-based digital dynamic
then he has been employed by Beckman Coulter, a man- compressor, which he frequently uses to make classical
ufacturer of medical diagnostic instruments. His proj- CDs suitable for backgroundmusic in his home.
ects include real-time systems software, tools for gener- Mr. Kraghtis an associate member of the AES and a
ating computercode, mathematicalmodeling, and signal member of the MAA. He also enjoys playing the cello,
processing. In 1985 he became interested in the LP- collecting recordingsof classical music, Bible research,
versus-CD debate and, as a hobby, started studying the public speaking, astrophotography,and vigorous hiking.

J.Audio
Eng.
Soc.,
Vol.48,No.11,2000
November 1065

Das könnte Ihnen auch gefallen