You are on page 1of 6

EE518 Digital Signal Processing University of Washington

Autumn 2001 Dept. of Electrical Engineering

Lecture 11: Anti-Alias Filters and Quantization


Nov 5, 2001

Prof: J. Bilmes <bilmes@ee.washington.edu> TA: Mingzhou Song <msong@u.washington.edu>

11.1 Anti-Alias Filters

Theoretically, we have studied the discrete-time system shown in Fig. 11.1

xc(t) x[n] Discrete y[n] yr(t)


C/D Time D/C
System

T T

Figure 11.1: Theoretical discrete-time system.

In real life, we are actually use the system in Fig. 11.2.

xc(t) xa(t) Sample xd(t) ^x[n]


LPF A/D
and
Anti-alias Converter
Hold

Haa(jΩ)

T T

Discrete ^y[n] ya(t) Compensated ^yr(t)


D/A
Time Reconstruction
Converter
System Filter

Hr(jΩ)

Figure 11.2: Discrete-time system in real life.

For the anti-alias filter shown in Fig. 11.2

• we use lowest sampling rate possible to reduce computation complexity, e.g., speech for up to 4kHz required for
intelligibility, in ISDN telephone line fs = 64kHz with bit rate of 8k Bytes per second.
• we remove wide-band noise which could lead to aliasing.

π
|Ω| < Ωc =

1, T
Haa ( jΩ) =
0, else

The overall response of system (if LTI wanted) is


H(e jΩT ), |Ω| < Ωc

He f f ( jΩ) = ≈ Haa ( jΩ)H(e jΩT )
0, else

11-1
11-2

since Haa ( jΩ) in real life will color the signal somewhat and Haa ( jΩ) rolls off before π/T in a real filter.
Oversampling samples at a higher than needed to ease analog filter design. The reason is that an analog filter can be

1. made of expensive analog parts and is heat sensitive.


2. non-linear phase typically

Therefore, we design the oversampling system in Fig. 11.3. The oversampling scheme only needs cheaper filters, and

Sharp
xc(t) Simple xa(t) ^x[n] xd[n]
Anti-alias
Anti-alias C/D M
DT Filter
Filter
Cuttoff π/M

T'=(1/M) (π/ΩΝ)

Figure 11.3: Oversampling.

the phase distortion is linear. That is, rather design the filter shown in Fig. 11.4, we do filters shown in Fig. ??(a) and
(b) instead.


π/T=ΩN

Figure 11.4: Difficult analogy filter.

1 1

Ω ω
π/T=ΩN π/T' π/Μ π

Figure 11.5: Using two easy analog and digital filters.

We can even alias any noise above ΩN , which is the highest frequency of interest. Ωc is overall bandwidth. We only
need to choose T 0 such that  

− Ωc > ΩN
T0
An example is shown in Fig. 11.6.

11.2 A/D Converter (ADC)

ADC converts a voltage value into a numerical representation of that values, every T seconds. It needs the sample-
and-hold and A to D conversion components.

Sample and Hold

Sample and hold takes snap shots of input signal and hold the value since APC must have steady and constant signal
to“read” the value. Fig. 11.7 shows a simple circuit for sample and hold.
11-3

Continuous time
anti-alias filter


−Ωc −ΩN Ωc ΩN

Discrete time
anti-alias filter

ω
−π −π/Μ π/Μ π

Figure 11.6: Continuous and discrete time anti-aliasing filters.

T
xa(t) xD(t)

Figure 11.7: A simple sample and hold circuit. The circuit switches on/off every T seconds. The capacitor holds value
measured until not needed.

There are some issues:

1. Finite aperture time: amount of time needed to capture the signal. Want this to be small so that signal won’t
vary very much during the time the aperture is open.
2. Signal feedthrough: even when switches is open, some signal can feed through.
3. Signal droop: capacitor voltage starts to decreases over time.

xo (t) = ∑ xa (nT )h0 (t − nT )


n
The zero-order hold system is 
1, 0<t <T
ho (t) =
0, else
which is shown in Fig. 11.8.

Τ 2Τ 3Τ 4Τ
−3Τ −2Τ −Τ 0

Figure 11.8: A zero-order hold system.


11-4

ADC

ADC takes output of S&H, and quantizes it into digital numeric representation. The diagram of ADC is shown in
Fig. 11.9. We use x̂[n] = Q(x[n]) to denote the quantization step. For a B-bit quantizer, there are 2B possible values.

xa(t) Sample x[n]=x(nT) ^x[n] ^xB[n]


and Quantize Coder
Hold

Figure 11.9: The A/D Converter. x̂[n] is still voltage values. −1 ≤ x̂B [n] < 1.

Ex: bi-polar ADC. ∆ is voltage quantization step. See Fig 11.10. Bi-polar quantization is good for

3∆

2∆


−8∆/2 −7∆/2 −5∆/2 −3∆/2 −∆/2
∆/2 3∆/2 5∆/2 7∆/2
−∆

−2∆

−3∆

−4∆

Figure 11.10: The bi-polar ADC.

1. Good for signal with positive and negative values.


2. There are even number of levels 2B , so either

(a) don’t represent 0 exactly


(b) have uneven number of positive and negative values.
3. Two’s complement with a linear encoding allows us to compute directly with the samples (addition, multiplica-
tion, etc.). MATLAB uses linear encoding, and 64-bit precision IEEE floating point numbers.

4. Other encoding possible, µ-law, non-linear. See demo.


5. A “bit” of two’s complement. (one of several possible bit representation.) With B + 1 bits, a fractional number

a0 .a1 a2 · · · aB ai ∈ {0, 1}

represents
−a0 · 20 + a1 · 2−1 + a2 · 2−2 + · · · + aB · 2−B
It is just like the decimal number system

d0 .d1 d2 · · · = d0 · 100 + d1 · 10−1 + d2 · 10−2 + · · ·


11-5

6. Full-scale level. Let Xm be width of voltage values that are represented without clipping. We have
2Xm Xm
∆= = B
2B+1 2
as the quantization step, and
x̂B · Xm = x̂[n],
recall −1 ≤ x̂B < 1. So x̂B [n] can be used directly in computer arithmetic, i.e.,

xB1 + xB2 ↔ x̂1 + x̂2

MATLAB provides us with x̂B [n], the normalized numbers.


7. Clipping. If a voltage value goes outside of the range of Xm , it is mapped to the highest and lowest values.
Serious digital distortions will occur.

Quantization Error

The quantization error is


e[n] = x̂[n] − x[n]
Note:
−∆/2 < e[n] ≤ ∆/2

1. ∆/2 is the max error if signal is in range, i.e.,

(−Xm − ∆/2) < x[n] ≤ (Xm − ∆/2)

2. if x[n] is not in this range, sample are clipped to the maximum or minimum value, so error grows linearly with
x[n] in that case.

Quantization can also be represented equivalently as shown in Fig. 11.11. So, we are just adding error signal to original

x[n] Q ^x[n]=Q(x[n])

x[n] + ^x[n]=x[n]+e[n]

e[n]

Figure 11.11: Equivalent representation of quantization.

signal to get x[n]. In general, it is hard to analyze e[n] deterministically.


The following are assumptions about randomness. They are roughly true under linear encoding.

1. The error sequence e[n] is stationary random process.


2. Errors are uncorrelated with
E[e[n]x[n + m]] = 0
11-6

3. Errors are themselves uncorrelated


E[e[n]e[n + m]] = 0
and e[n] is white noise.

4. e[n] ∼ uniform over [−∆/2, ∆/2).

Reasonable assumptions for natural signals. (music, speech). One possible probability density function is uniform
distribution probability density function shown in Fig. 11.12 In the uniform distribution case, we have

p(e)
1/∆

−∆/2 0 ∆/2
Figure 11.12: The probability density function of the uniform distribution. ∆ = Xm
2B
.

mean: E[e[n]] = 0

and Z ∆/2 Z ∆/2


1 ∆2
variance: Var(e[n]) = (e − µe )2 p(e)de = e2 de = = σ2e
−∆/2 −∆/2 ∆ 12
So, with ∆ = Xm /2B , the overall noise power of B + 1 bit quantization is

2−2B Xm2
σ2e =
12
Let σ2x be the signal power. Then the signal to noise ratio in dB of B + 1 bit quantization is

σx
 2  
Xm
SNR(B + 1) = 10 log10 = 6.02B + 10.8 − 20 log10
σ2e σx

Good fact to remember: for each bit used, SNR increase about 6 dB. Each extra bit doubles the number of quantization
levels.
Relation between full-scope amplitude Xm and average (rms) signal amplitude Σx (last term on the right of the above
equation):

1. (make the term small) If σx is too large relative to Xm , then we get lots of clipping, and error analysis is no longer
valid (since errors are not uniform, etc.) When this happens, we get clipping distortion (very bad noise.)
2. (make the term large) If σx is small, then the term is large making SNR much lower.

Suppose Xm ≈ 4σx . Under Gaussian distortion, 0.064% of samples would be clipped with this Xm . The SNR is about
6B−1.25 dB. Good SNR should be between 90 and 96 dB (CD quality audio). 16 bits are enough if Xm is appropriately
chosen.

You might also like