EE264
Digital Signal Processing
Lecture 11
Quantization in Digital Filter
Implementations  II
October 22, 2008
Ronald W. Schafer
Department of Electrical
Engineering
Stanford University
STANFORD UNIVERSITY, EE264
Administrative
• HW 5 due on Tuesday,
Nov. 4
by 5pm in EE264 drawer
on 2
nd
floor Packard.
• Midterm exam: Weds., Oct. 29 in class.
– Building 200  Room 203
– Covers material through Lecture 9 and HW 4.
– Open textbook and one 8.5x11 sheet of notes (both
sides
• READ: Chapter 6 of DTSP and start Chapter 7.
• Review Session: Thursdays 4:15  5pm Gates B03
(recording available online)
• Office Hours:
– RWS: Mon./Weds 1011, and 12:1512:45
– Raunaq: Mon. 57pm, Tues. 911am
– Rahim: Friday 46pm
• Grader:
Pegah Afshar, Ramin Miri
STANFORD UNIVERSITY, EE264
Overview of Lecture
• Quantization in FIR implementations
– Coefficient quantization
– Roundoff before and after accumulation
• Linear noise model
– Scaling to avoid overflow
• Quantization in FIR implementations
– Coefficient quantization
– Roundoff before and after accumulation
• Linear noise model
– Scaling to avoid overflow
– Limit cycles
STANFORD UNIVERSITY, EE264
FixedPoint Implementation Issues
• We need to represent coefficient and signal values
by integers in
a fixed range.
• Quantization errors in coefficients imply shifts of
poles and zeros (even instability).
• For a given wordlength, the quantization error is
fixed in size.
Therefore, signal values should be
maintained as large as possible to maximize SNR.
• If signal values get too large, additions can
overflow (or clip), thereby creating large errors.
• Thus, fixedpoint implementations require careful
attention to scaling the signal values.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentSTANFORD UNIVERSITY, EE264
FIR Digital Filter
y
[
n
]
=
h
[
k
]
x
[
n
−
k
]
k
=
0
M
∑
=
(((
h
[0]
x
[
n
]
+
h
[1]
x
[
n
−
1])
+
…
)
+
h
[
M
]
x
[
n
−
M
])
To implement this filter, we must do multiply followed by
accumulation (MAC).
accumulation
±
²
³ ³ ³ ³ ³
³
´
³ ³ ³ ³ ³ ³
STANFORD UNIVERSITY, EE264
Roundoff Noise in FIR Filters
• Using the MAC instruction with quantized coefficients
and quantized input, we can compute
• This sum of products can be computed with 32bit
precision; i.e., with no quantization of partial sums.
• The result is usually quantized to 15 bits + sign for
storage or DtoA conversion.
• The resulting noise power in the output is therefore
y
[
n
]
=
h
[
k
]
x
[
n
−
k
]
k
=
0
M
∑
ˆ
y
[
n
]
=
Q
15
y
[
n
]
{}
=
y
[
n
]
+
e
[
n
]
σ
e
2
=Δ
2
/12
=
2
−
30
STANFORD UNIVERSITY, EE264
Remember the Linear Noise Model
• Error is uncorrelated with the input.
• Error is uniformly distributed over the interval
• Error is stationary white noise, (i.e. flat spectrum)
π
ω
≤
Δ
=
=
Φ


,
12
)
(
2
2
e
j
ee
e
−
(
Δ
/2)
<
e
[
n
]
≤
(
Δ
/2).
STANFORD UNIVERSITY, EE264
x
[
n
]
h
[
M
]
h
[
M
−
1]
h
[2]
h
[0]
h
ˆ
y
[
n
]
e
[
n
]
y
[
n
]
FIR Digital Filter with Quantized Output
ˆ
y
[
n
]
=
Q
15
y
[
n
]
=
Q
15
h
[
k
]
x
[
n
−
k
]
k
=
0
M
∑
⎧
⎨
⎩
⎫
⎬
⎭
=
y
[
n
]
+
e
[
n
]
Q
15
x
[
n
]
h
[
M
]
h
[
M
−
h
[2]
h
[0]
h
y
[
n
]
ˆ
y
[
n
]
In this case, noise is added directly to the output.
This is the end of the preview.
Sign up
to
access the rest of the document.
 '09
 Digital Signal Processing, Signal Processing, Stanford University, Finite impulse response

Click to edit the document details