13.23. DC REMOVAL
When we digitize analog signals using an
analogtodigital (A/D) converter, the converter's output typically
contains some small DC bias: that is, the average of the digitized
time samples is not zero. That DC bias may have come from the
original analog signal or from imperfections within the A/D
converter. Another source of DC bias contamination in DSP is when
we truncate a discrete sequence from a Bbit representation to word widths less
than B bits. Whatever the source,
unwanted DC bias on a signal can cause problems. When we're
performing spectrum analysis, any DC bias on the signal shows up in
the frequency domain as energy at zero Hz, the X(0) spectral sample. For an Npoint FFT the X(0) spectral value is proportional to
N and becomes inconveniently large
for largesized FFTs. When we plot our spectral magnitudes, the
plotting software will accommodate any large X(0) value and squash down the remainder
of the spectrum in which we are more interested.
A nonzero DC bias level in audio signals is
particularly troublesome because concatenating two audio signals,
or switching between two audio signals, results in unpleasant
audible clicks. In modern digital communications systems, a DC bias
on quadrature signals degrades system performance and increases bit
error rates. With that said, it's clear that methods for DC removal
are of interest to many DSP practitioners.
13.23.1 BlockData DC Removal
If you're processing in nonrealtime, and the
signal data is acquired in blocks (fixedlength sequences) of block
length N, DC removal is
straightforward. We merely compute the average of our N time samples, and subtract that
average value from each original sample to yield a new time
sequence whose DC bias will be extremely small.
This scheme, although very effective, is not
compatible with continuousthroughput (realtime) systems. For
realtime systems we're forced to use filters for DC removal.
13.23.2 RealTime DC Removal
The author has encountered three proposed
filters for DC removal[55–57];
their structures are shown in Figure 1362(a), (b), and (c).
Figure 1362. Filters used for DC bias
removal.
Ignoring the constant gains of those DCremoval
filters, all three filters have identical performance with the
general DCremoval filter
structure in Figure
1362(d) having a zdomain
transfer function of
(It's not immediately obvious that the filters
in Figure 1362(c) and (d) are equivalent. You can
verify that equivalency by writing the timedomain difference
equations relating the various nodes in the feedback path of Figure 1362(c)'s filter.
Next, convert those equations to ztransform expressions and solve for
Y(z)/X(z)
to yield Eq.
(13118)).
Because the DCremoval filters can be modeled
with the general DCremoval filter in Figure 1362(d), we provide the general
filter's frequency magnitude and phase responses in Figure 1363(a) and (b) for a = 0.95. The filter's pole/zero locations are
given in Figure 1363(c),
where a zero resides at z = 1
providing infinite attenuation at DC (zero Hz) and a pole at z = a making
the magnitude notch at DC very sharp. The closer a is to unity, the narrower the
frequency magnitude notch centered at zero Hz. Figure 1363(d) shows the general filter's
unitsample impulse response.
Figure 1363. DCremoval filter, a = 0.95: (a) magnitude response; (b) phase
response; (c) pole/zero locations; (d) impulse response.
Figure
1364 shows the timedomain input/output performance of the
general DCremoval filter (with a =
0.95) when its input is a sinusoid suddenly contaminated with a DC
bias of 2 beginning at the 100th time sample and disappearing at
the 200th sample. The DCremoval filter works well.
Figure 1364. DCremoval filter
performance: (a) filter input with sudden DC bias; (b) filter
output.
13.23.3 RealTime DC Removal with
Quantization
Because the general DCremoval filter has
feedback the y(n) output samples may require wider
binary word widths than those used for the x(n)
input samples. This could result in overflows in fixedpoint binary
implementations. The scaling factors of (1+a)/2 and K,
in Figure 1362(a) and (b), are less than one to
minimize the chance of y(n) binary overflow.
In fixedpoint hardware the y(n)
samples are often truncated to the same word width as the input
x(n). This quantization (by means of
truncation) will induce a negative DC bias onto the quantized
output samples, degrading our desired DC removal. When we truncate
a binary sample value, by discarding some of its least significant
bits, we induce a negative error in the truncated sample.
Fortunately, that error value is available for us to add to the
next unquantized signal sample, increasing its positive DC bias.
When that next sample is truncated, the positive error we've added
minimizes the negative error induced by truncation of the next
sample.
Figure
1365(a) shows the addition of a quantizing sigmadelta
modulator to the feedback path of the DCremoval filter given in Figure 1362(c). The positive
error induced by truncation quantization (the Q block) is delayed
by one sample time and fed back to the quantizer input. Because the
modulator has a noise shaping
property where quantization error noise is shifted up in frequency,
away from zero Hz (DC), the overall DC bias at the output of the
filter is minimized[56].
Figure 1365. Two DCremoval filters
using fixedpoint quantization to avoid data overflow.
An equivalent quantization noise shaping process
can be applied to a Direct Form I version of the Figure 1362(d) general DCremoval filter as
shown in Figure 1365(b).
Again, the positive quantization error is delayed by one sample
time and added to the quantizer input[58–60].
To reiterate, the DCremoval filters in Figure 1365 are used to avoid binary data
overflow, by means of quantization, without the use of scaling
multipliers.
