Professional Documents
Culture Documents
net/publication/333224643
CITATIONS READS
0 7,780
1 author:
Muhammad El-Saba
Ain Shams University
64 PUBLICATIONS 56 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Muhammad El-Saba on 22 June 2021.
Signal Processing
_
-iii-
Prof. Dr. Muhammad EL-SABA
Copyright © 2007-2019, by the author. All rights reserved.
-iv-
Prof. Dr. Muhammad EL-SABA
PREFACE
This course is intended for use of students and post graduates of electronic
engineering and communication engineering. The first chapter introduce
analog continuous-time signals and thier transform into different domains
and how they interact with analog system. The following chapters deals with
active filters as the most famous analog processing systems. The synthesis of
active filters is dealt with in this chapter,
-v-
Prof. Dr. Muhammad EL-SABA
A solutions manual, which also contains the results of the computer
experiments, is available from the publisher (mhs1308@gmail.com). The C
and MATLAB functions may be obtained via anonymous FTP from the
Internet site ece.asu.edu in the directory /mhs/dsp
-vi-
Prof. Dr. Muhammad EL-SABA
Course Contents
Subject Page
PREFACE xiii
CHAPTER 1: Analog Signal Processing 243
5-1. Introduction 243
5-1.1. Time Domain & Frequency Domain of Analog Signals 245
5-1.2. Transfer Function of a Linear Network 246
5-1.3. Pole-Zero Locations 248
5-1.4. Frequency Response 248
5-1.5. Transient Response 249
5-1.6. Convolution 249
5-1.7. Impulse Response 249
5-1.8. Stability 250
5-1.9 Hwriuitz Criterion 250
CHAPTER 2: Active Filters & their Applications 243
2-1. Introduction 243
2-2. Filter Design (Approximation and Synthesis) 251
2-3. Filter Approximation 253
5-3.1. Butterworth (Maximally Flat) Filter Approximation 254
5-3.2. Chebeshev (Equi-ripple) Filter Approximation 261
5-3.3. Inverse Chebechev Filter Approximation 262
5-3.4. Cauer (Elleptic) Filter Approximation 263
5-3.5. Bessel or Thomas (Linear Phase) Filter Approximation 264
5-3.6. Gaussian Filter Approximation 265
5-3.7. Legendre (Optimum L) Filter Approximation 266
5-3.8. Comparison between Different Filter Approximations 266
2-4. Active Filter Synthesis 267
5-4.1. Filter Sensitivity 267
5-4.2. Filter Devices 267
5-4.3. Filter Synthesis Methods 268
2-5. Filter Synthesis Using Op-Amps 270
5-5.1. Op-Amp Filter Synthesis by Cascade Method 270
i. First-order Op-Amp Filter 270
ii. General Second-Order Filter Function 271
iii. Single-Op-Amp Biquads 272
-vii-
Prof. Dr. Muhammad EL-SABA
Subject Page
-viii-
Prof. Dr. Muhammad EL-SABA
Subject Page
327
CHAPTER 3: Digital Signals and Systems
3-1. Discrete-time Signals 331
3-2. Digital Signal Processors 380
3-3. Summary 381
3-4. Problems 382
3-5. Bibliography 384
CHAPTER 7: Applications
APPENDICES
-ix-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
Fundamentals of Analog
Signal Processing
Contents
1-1. Introduction
1-2. Time Domain & Frequency Domain of Analog Signals
1-3. Transfer Function of a Linear Network
1-4 Pole-Zero Locations
1-4 Frequency Response
1-6 Transient Response
1-7 Convolution
5-8. Impulse Response
1-9. Stability
1-10 Hwriuitz Criterion
1-11. Summary
1-12. Problems
1-13. Bibliography
-1-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
Fundamentals of Analog
Signal Processing
1-1. Introduction
Analog signal processing (ASP) is any signal processing conducted on
analog signals by analog means. Analog indicates something that is
mathematically represented as a set of continuous values. This differs
from digital which uses a series of discrete quantities to represent signal.
-2-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
1-2.1- Additivity
A system satisfies the property of additivity, if a sum of inputs results in
a sum of outputs. By definition: an input of x3(t) = x1(t) + x2(t) results in
an output of y3(t) = y1(t) + y2(t).
1-2,2- Homogeniety
A system satisfies the condition of homogeniety if an output scaled by a
certain factor produces an output scaled by that same factor. By
definition: an input of ax1 results in an output of ay1
1-2.3- Linearity
A system is considered linear if it satisfies the conditions of Additivity
and Homogeniety.
1-2.4- Causality
A simple definition of a causal system is a system in which the output
does not change before the input. A more formal definition of a causal
system is the system whose output is only dependant on past or current
inputs. A system is called non-causal if the output of the system is
dependant on future inputs. This book will only consider causal systems,
because they are easier to work with and understand, and since most
practical systems are causal in nature.
1-2.5- Memory
A system is said to have memory if the output from the system is
dependant on past inputs (or future inputs!) to the system. A system is
called memoryless if the output is only dependant on the current input.
Memoryless systems are easier to work with, but systems with memory
are more common in digital signal processing applications.
1-2.6- Time-Invariance
A system is called time-invariant if the system relationship between the
input and output signals is not dependant on the passage of time. If the
input signal x(t) produces an output y(t) then any time shifted input, x(t +
-3-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
δ), results in a time-shifted output y(t + δ). This property can be satisfied
if the transfer function of the system is not a function of time except
expressed by the input and output.
N ( s ) an s n an 1s n 1 ....a1s a0
H (s) m (5-2a)
D( s ) s bm 1s m 1 ....b1s b0
where N(s) and D(s) are the numerator and denominator polynomials,
respectively, with m ≥ n, ai, bi real and bi positive.
In most analog filter design cases, H(s) represents the ratio of the Laplace
transform of the output voltage Vo(s) to the Laplace transform of the input
voltage Vi(s), being thus a dimensionless voltage gain.
Fig. 5-1. Block diagram of a filter, with its signals in the time and frequency domains
( s zn ).( s zn 1 )....( s z1 ) (s z ) i
H ( s ) an an i 1
( s pn ).( s pn 1 )....( s p1 ) m
(5-2c)
(s p )
j 1
j
-5-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
This gives the filter gain in dB. However, in most cases, we talk about the
filter attenuation or loss, –A(ω), also in decibels. In some cases, the
attenuation is given in Nepers obtained as follows:
In case of a multiple zero, all of them are located at the same point in the
s-plane. On the other hand, the roots of D(s), which are the poles pi of
H(s) can be real or complex conjugate, since D(s) also has real
coefficients. However, their real part can only be negative for reasons of
stability. Also, for a network to be stable and useful as a filter, its transfer
function H(s) should not have poles with real part equal to zero. Thus, the
poles of function H(s) should all lie in the left half of the s-plane (LHP)
excluding the j-axis, while its zeros can lie anywhere in the s-plane, i.e.,
in the left-half and in the right-half s-plane (RHP).
d
g
d (5-4)
1-7. Convolution
The convolution is a basic concept in signal processing that states an
input signal can be combined with the system's transfer function to find
the output signal, in the time domain.
vo (t ) vi (t )* h(t ) v ( ).h(t )d
i (5-5)
-7-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
1-9. Stability
Active filters may be unstable under certain conditions. Filter stability has
already been mentioned with reference to the pole positions of the filter
function. In practical terms, the output voltage or current of a filter must
always follow the input at steady-state, i.e., it should not become
uncontrollable. Such an uncontrollable behavior usually leads either to
DC saturation of the output voltage or to the generation of oscillating
waveforms independent of the input signal. In mathematical terms,
stability of a linear network in the time domain, requires that its impulse
response h(t) be absolutely integralable, i.e.,
h(t ) dt I
0
(5-7)
A tn exp(-t).cos(t) or A tn exp(-t).sin(t)
i.e., the poles should lie in the LHS of the s-plane excluding the j
If the network function has poles on the j-axis also, then its impulse
response will include terms of the form Acos(t), Asin(t). The network
is considered marginally stable in this case, but then it cannot be useful as
a filter. A network is unstable if it is not strictly or marginally stable.
-8-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
1-9. Summary
In this chapter we refer to a number of signal properties and transforms
and the reader is assumed to have at least a small prior knowledge of
them. We start with the introduction of the properties of continuous-time
signals and systems and the transforms that apply on them and then we
continue with discrete-time signals and their transforms.
-9-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
Such that, the output of the continuous (LTI) system having an impulse
response h(t) to an input x(t) and Laplace transform H(s) and X(s),
respectively is given by:
X(s) = H(s) • X(s)
Y(s) = L{y(t)} = y(t) e-st dt
The relation between the Laplace transform X(s) and Y(s) of an LTI
network is given by a network function NF(s) = Y(s) / X(s). For instance,
the network function may be the voltage gain Av of an amplifiers or
across any two port network, as shown in figure:
Av(s) = VO(s) / Vi(s)
-10-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
The function Av(s) is some time called the voltage transfer function of the
2-port network. It may be put as ratio
The zeros of the numerators (szi) and denominator (spi) are said to be the
zeros and poles of the network.
-11-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
1-10. Problems
1-1) Explain why the impulse response function can completely describe
the characteristics of a linear time-invariant filter.
1-2) Choose the most suitable answer for the following statements
1. What is the rule h*x = x*h called?
a) Commutativity rule
b) Associativity rule
c) Distributive rule
d) Transitive rule
2. For an LTI discrete system to be stable, the square sum of the impulse
response should be
a) Integral multiple of 2pi
b) Infinity
c) Finite
d) Zero
5. What is the following expression equal to: h*(d+bd), d(t) is the delta
function
a) h + d
b) b + d
c) d
d) h + b
-12-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
9. The system transfer function and the input if exchanged will still give
the same response.
a) True
b) False
1-3) The Figure below shows the discrete-time input signal and the
impulse response of a linear time invariant filter. Using the principles of
linearity and superposition, obtain the output of the filter in response to
the input discrete-time input signal
1-5) Determine and sketch the impulse response h(n) of the low pass filter
described by the following equation
-13-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter1
1-11. Bibligraphy
[8] Simon Haykin, , and Barry Van Veen. Signals and Systems. 2nd ed.
Hoboken, NJ: John Wiley and Sons, Inc., 2003.
[9] James McClellan, H., Ronald W. Schafer, and Mark A. Yoder. Signal
Processing First. Upper Saddle River, NJ: Pearson Education, Inc., 2003.
-14-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Active Filters
Contents
2-1. Introduction
2-2. Filter Design (Approximation and Synthesis)
2-3. Filter Approximation
2-3.1. Butterworth (Maximally Flat) Filter Approximation
2-3.2. Chebeshev (Equi-ripple) Filter Approximation
2-3.3. Inverse Chebechev Filter Approximation
2-3.4. Cauer (Elleptic) Filter Approximation
2-3.5. Bessel or Thomas (Linear Phase) Filter Approximation
2-3.6. Gaussian Filter Approximation
2-3.7. Legendre (Optimum L) Filter Approximation
2-3.8. Comparison between Different Filter Approximations
2-4. Active Filter Synthesis
2-4.1. Filter Sensitivity
2-4.2. Filter Devices
2-4.3. Filter Synthesis Methods
2-5. Filter Synthesis Using Op-Amps
2-5.1. Op-Amp Filter Synthesis by Cascade Method
i. First-order Op-Amp Filter
ii. General Second-Order Filter Function
iii. Single-Op-Amp Biquads
A. Sallen-Key 2nd order (Biquad) LPF
B. Sallen-Key 2nd order (Biquad) HPF
C. Sallen-Key 2nd order (Biquad) BPF
iv. Two-Op-Amp Biquads
v. Three-OpAmp Biquads
A. KHN Biquad Filter
B. Tow-Thomas Biquad Filter
C. Akerberg-Mossberg Biquad Filter
2-5.2. Op-Amp Filter Synthesis by Direct Simulation Methods
i. LC Ladder Filters
ii. Ladder Simulation Methods
-15-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
-16-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Active Filters
2-1. Introduction
The filter is an electronic device which could make useful signals passes
while suppress or attenuate useless signals. With the development of
electronic and integrated circuit technology, the filter technique is widely
used in communication, measuring, signal processing, data acquisition
and real-time control.
Finally the band-stop (notch) filter passes all frequencies except for a
certain frequency band.
Fig. 2-1. Filter types, according to the pass bands and stop bands.
-18-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
The filter design problem can be divided into the following two steps:
1- Filter Approximation
2- Filter Synthesis
Figure 2-2 depicts the sequence of these steps in the filter design cycle.
-19-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
1
H ( j ) M ( ) (2-1)
1 2W ( 2 )
where is a constant between zero and one (0 < ≤ 1), according to the
accepted passband error, and W(ω2) is a function of ω2 such that 0 ≤
W(ω2) ≤ 1 for 0 ≤ ω ≤ 1 and which increases very fast with increasing ω ,
for ω > 1, remaining much greater than one outside the passband.
In the following, we review the most popular functions W(ω2) and the
corresponding H(s), the magnitude of which approximate the amplitude
response of the ideal lowpass filter.
-20-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
where the filter order n is a positive real integer. We will get the
following amplitude function:
1
M ( ) (2-2b)
1 2n
At = p we have:
-21-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
At = s we have:
with
ln 10 0.1 As
10
1 /
0.1 Ap
1 (2-5)
ln(e)
n
ln( w) /
s p
where
-22-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
So, starting from filter characteristics (Ap, As, s and p) we can calculate
n and o from which we can construct the Butterworth transfer function
using the So-called spectral factorization method. Note that the roll-off
of the Butterworth filters is 20n dB/decade where n is the filter order.
where
DO(s) = (1 + s/ωo) (2-8b)
Such that
DI(s) = 1-2(s/ωo) cos θi + (s2 / ωo2) (2-11)
Finally we get:
with
AO = 1 if n = 2k (even)
= 1/(1+ s/ωo) if n = 2k+1 (odd) (2-12b)
and
AI(s) =1 / [1-2(s/ωo) cosi+(s2/ωo2)] for i =1,2,…, k (2-13)
where
These are the phase angles of the poles si for (π/2) < θi < 3/2 π .
Table 2-1 Butterworth polynomials for a normalized (prototype) LPF. Here s is
normalized with response to use (i.e putting ωo=1)
-24-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Im(s) = j
/n
S1
S-Plane
S2
Si o
Re(s)=
Sn
Fig. 2-5. Butterworth circle, with roots (poles) of the transfer function.
B. Frequency Translation:
The high pass Butterworth filter is analogous to the LPF and has the
general from characteristic:
Note that this is the same LPF characteristics with (ω/ωo) replaced with
(ωo/ω). So you can use the former design rules (to obtain n and ωo) and
construct the network function H(s) of high pass filters using the same
Butterwort polynomial of the LPF with replacing (s/ωo) with (ωo/s) or
-25-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Similarly you can translate a prototype LPF to BPF using the relations:
where p1 and p2 are the 3-dB frequencies of the bandpass filter
(that’s the filter bandwidth B =o1-o2). On the other hand, you can
translate a prototype LPF to BSF using the relation:
where s1 and s2 are the 3-dB frequencies of the bandstop filter such
that the filter bandwidth B=(s1 -s2) and ωo = √(s1 -s2) is its center
frequency.
Example 2-1:
Consider a Butterworth filter that is to give an attenuation of at most 0.1
dB at 10 KHZ and at least 60 dB at 1 KHZ ?
i) Determine the filter order
ii) What is the cutoff (3-dB) frequency of this filter ?
iii) What are the actual attenuation at 1 KHZ and 10 KHZ ?
iv) Determine the network function Av(s) that best meets the above
specifications.
v) Draw the Bode plots of this filter.
Solution:
i) Let’s use the Butterworth filter, whose order is given by (2-11):
Here: As = 60 dB , ωs = 1 KHZ .
Ap = 0.1 dB , ωp = 10 KHZ .
Substituting we get n = -3.82 That is a HPF with |n| ≥ 3.82 = 4
-26-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
-27-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
1 Cn2 ( )
2 (2-19a)
-28-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
For instance: C1() = , C2() = 22 -1, C3()= 43 -3, ..etc.
Similarly
AS = 10 log (1 + εs2) (2-22b)
1
2Cn2
H ( j ) M ( )
2 2
(2-23)
1
1 2Cn2
-29-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
The order of the Chebyshev filter (n) that meets a given p (for type-I) or
a given s (for type -II) is given by:
n
cosh 1 e ln e e 1
2
cosh 1 w ln w w2 1
(2-24a)
with
e = s / p and w = ωs / ωp (2-24b)
where p and s can be determined from Ap and AS. The above relation
may be expressed in terms of As and Ap as follows:
(2-25)
1
H ( j ) M 2 ( )
2
1 Rn ( )
2 (2-27a)
where
(2-27b)
-30-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
or
(2-27c)
As the ripple in the stopband of the elliptic filter approaches zero, the
filter becomes a type-I Chebyshev filter. As the ripple in the passband
approaches zero, the filter becomes a type-II Chebyshev filter and, as
both ripple values approach zero, the filter becomes a Butterworth filter.
-31-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
where n is the filter order and the coefficients ak are given by:
(2n k )!
ak nk
2 (n k )! k ! (2-28b)
Note that the highest order coefficient (an) is unity. The Bessel filter
denominator polynomials may be also expressed as follows:
b1(s) = s +1
b2(s) = s2 + 3s +1
bn(s) = (2n-1).bn-1(s) + s2 bn-2(s) (2-29)
These polynomials give a linear phase with slope of -1. In fact, the phase
of the network function of Bessel filters may be approximated as follows:
a1 a1 a12 3 (2-30a)
H ( ) ( 2 3 ) ... .. to
ao ao 3ao
where to=a1/ao. Therefore, the group delay of the Bessel filter is given by:
d
= constant g ( ) H ( ) to
d (2-30b)
1
H ( ) e , H ( ) 12 n
2 2
1 ..
2 1
2
4 1
3!
6 (2-31)
1
H ( )
2
,
1 12 4
2 (2-32a)
-32-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Such that
2
H ( s) (2-32b)
2 2.1473s s 2
-33-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
P z ln( P)
S zP . (2-33a)
z P ln( z )
For example, consider the a LPF which has a transfer function H(s)
=1/[1+(s/o)], with o=1/RC. The sensitivity of o against R is given by:
o R
S Ro . 1
R o (2-33b)
-34-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
The Op-Amp and OTA are special cases of two ideal active elements, and
their implementations in IC form make them indispensable today, both in
discrete and fully integrated analog network design.
It should be noted that automatic electronic tuning is crucial for fully
integrated filters to compensate the drifts of element values and filter
performances due to component tolerance, device non-ideality, parasitic
effects, temperature, and aging. Integration of analog circuits in MOS
technology is also driven towards a single chip implementation of mixed
circuits because digital circuits are integrated in MOS technology.
In conventional active RC filters, the resistor is the problem; it has a
physically limited range (normally R ≤ 40k) and is not electronically
tunable. A MOSFET can be used as a voltage-controlled resistor in the
ohmic region, with its resistance being adjustable by the gate voltage.
MOSFET’s can be also used to simulate resistors in the so-called
switched capacitor (SC) filters. Therefore, using the MOSFET to replace
the resistor in active RC filters can meet the two requirements and the
resulting filters are sometimes called the MOSFET-C filters.
Component substitution,
Signal flow simulation, and
Coupled biquad realization.
Component
Single Amplifier Multiple Amplifier Substitution
Biquads (SAB) Biquads (MAB)
Gyrators
Sallen-Key FDNR
Op-Amp Filters
Tow-Thomas
Biquad
OTA Filters Akerberg-
Mosberg Biquad Signal Flow
Simulation
KHN Biquad
Current Conveyor (State Variables)
Filters Leapfrog (LF)
Matrix Methods
Switched Capacitor
Filters Coupled Biquads
Biquad Leapfrog
FLF
-36-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
(A) (B)
Fig. 2-10. First-order LPF structures, using Op-Amps. (a) Inverting configuration ,
(b) Non-inverting configuration.
Vo o
H (s) k (2-34a)
Vi s o
-37-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
K = 1 + R2/R1 (2-34B)
In the inverting configuration shown in figure 2-10(a), the gain is given
by K = -R2/R1.
The following figure depicts 2 possible configurations for a first-order
HPF using Op-Amps. The transfer function of the HPF is given by:
Vo s
H (s) k
Vi s o (2-35)
Fig. 2-11. First-order HPF structures, using Op-Amps. (a) Inverting configuration ,
(b) Non-inverting configuration.
a2 s 2 a1s ao
H ( s) 2 (2-36a)
s s
os
s2 s os2
Qs
H (s) k
op (2-36b)
s2 s op2
Qp
where, ωos and ωop are the undamped natural frequencies of the zeros and
poles, respectively, while Qs and Qp are the corresponding quality factors,
or Q factors. The zero and pole frequency correspond to the magnitude of
the filter zero or pole, while their quality is a measure of how near the jω-
-38-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Note that the inverse of the quality factor is sometimes called damping
factor (DF = 1/Q = √). The following table resumes the transfer
functions of the 2nd order filters.
High Pass
Band Pass
-39-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
k
H (s)
Vo
C1C2 R1 R2
(2-37)
Vi 1 1 1 k 1
s2 s
R1C1 R2C1 R2C2 C1C2 R1 R2
where k = 1+ RB / RA
-40-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
K
H (s)
s s
2 (2-38)
V ks 2
H (s) o (2-40)
Vi 1 1 1 k 1
s2 s
R1C1 R2C1 R2C2 C1C2 R1 R2
Vo ks
H ( s)
Vi C C2 k 1 (2-41)
s2 1
s
R2C1C2 R2C2 C1C2 R1R2
-41-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Example 2-2:
Design a filter that has an attenuation of 1dB at 1kHz and an attenuation
of 50dB at 5kHz, with maximal flat response in passband.
Solution
This is a LPF which has: Ap = 1 dB at p = 2 x 1k rad/s,
As = 50 dB at s = 2 x 5k rad/s,
1- We start by filter approximation (Butterwort, for maximal flat
response) and we try to find out the filter order N, and corner frequency
o, from the above characteristics, as follows:
-42-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
For a Butterworth response of this 3rd order LPF, the normalized network
function (transfer function) should have the following form (refer to
Table 2-1):
No need to mention that the roll-off of the 3rd order Butterworth LPF is
60dB/decade, which is better than the required 50dB/decade.
-43-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
(2-43)
C. Akerberg-Mossberg Filters
The Åkerberg-Mossberg biquad is a modified version of the Tow-
Thomas Op-Amp biquad. The modification is made by replacing the non-
inverting integrator (A2 and A3 in Fig 2-18) with 2-back-to-back Op-
-45-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Amps. For simplicity, we set the following values in the circuit of Fig. 2-
18:
C1 = 0, R2 = R3 = (2-45)
(2-46a)
(2-46b)
Fig. 2-19. Tow-Thomas biquad actively compensated for excess phase, giving the
Åkerberg-Mossberg biquad in (b).
-46-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
-47-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
-48-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
-49-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
The transformation between LPF and other types of filters are given in
the following table (Table 2-6).
The normalized components values1 gk (Ck and Lk), shown in the above
tables (for Rs=RL=1 and o=1), can be also calculated analytically. For
instance, the normalized elements of a Butterworth odd-order LC ladder
LPF (with Rs=RL=1 and o=1), are given by:
where
1
Note that for odd ordered ladder L1=g1, C2=g2, L3 = g3, C4 = g4, .. and so on. For even-ordered
ladder, C1=g1, L2=g2, C3 = g3, L4 = g4, .. and so on. The last term gn+1 is the load resistor value.
-50-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Example 2-3:
Design a HPF with cutoff frequency o =10k rad/s, which is double
terminated with source and load resistors Rs=RL =1k. The required HPF
should have maximal flat response in the passband.
Solution:
1-We start with a 5th order prototype LPF, which is double terminated, as
shown in Fig. 2-23(a).
-51-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
N.B. Usually, the filter order, n, and the cutoff frequency, O, are not
explicitly given. Instead, the filter attenuation in the passband Ap(p), and
in the stopband As(s) are given. From this information we can determine
n, and O using the appropriate relations. For instance, the Butterworth
low pass filter order is given by equations (2-11), which states:
-52-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Such that
I2 Z1Z3
(2-50)
I1 V2 0
Z2 Z4
V1 Z1Z 3
Z in ( s ) .Z 5 (2-51)
I1 Z 2 Z 4
-53-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
The GIC and GIN have many useful applications. One of the useful
applications has been the inductance simulator (Gyrator). For instance,
assume that Z1 = Z2 = Z3 = Z5 = R and Z4 = 1/sC, then the input
impedance at port 1 will be
Zin = V1 /I1 = s C R2 (2-52a)
Leq = C R2 (2-52b)
-54-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Leq = C R2 (2-53b)
Example 2-4
The following figure depicts how to substitute an inductance in a ladder
filter with a gyrator circuit. The gyrator may be implemented with
Antoniou’s simulated inductance, with R = 1k and C=30nF, such that the
simulated inductance Leq = CR2 = 30x10-9x 1k x 1k = 30 x10-3 H (30mH).
Fig. 2-27. Example showing the substitution of inductance in a filter with a gyrator
Example 2-5:
Design an active HPF with cutoff frequency o =10k rad/s, which
simulates a double terminated 5th order ladder filter, with source and load
resistors Rs=RL =1k. The required HPF should have maximal flat
response in the passband.
-55-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Fig. 2-29. Simulation of inductances in a 5th order LC ladder HP, final circuit.
-56-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
-57-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Example 2-6
The following figure depicts how to substitute the RLC components in a
ladder filter with the CRD components, using Bruton transform.
Fig. 2-31. Example showing the substitution of RLC components in a ladder filter
with CRD components, using Bruton transform.
-58-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
(2-56)
Note that the output of each block is fed back to the input of the
preceding block and therefore the structure is called the Leapfrog (LF)
structure. In contrast with the cascaded topology, these blocks are not
isolated from each other, and any change in one block affects the voltages
and currents in all the other blocks. This type of coupling between the
blocks makes the tuning of the whole network more difficult, but gives
rise to the much lower sensitivity.
-59-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
In active filter design the mixed current and voltage signal equations are
normally converted by scaling into their counterparts with voltage signals
only. Scaled by a certain conductance, equations (2-56) can be written as
follows (shown in the send column):
2- Draw the Signal flow diagram which simulates the ladder network
-60-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
3- Design the inner elements of a leapfrog filter using inverting and non-
inverting integrators (or any suitable active building blocks), with
normalized values.
4- Design the input/output elements of the leapfrog filter using lossy
integrators (if they have source or load resistances) or any suitable active
building blocks.
2- Denormalize all impedances to meet the frequency specifications of
the desired filter.
Example 2-7
Design a 3rd order active LPF with cutoff frequency o =1k rad/s, which
is double terminated with source and load resistors Rs=RL =1k. The
required LPF should have maximal flat response in the passband. Use
Leapfrog simulation to implement the filter.
Solution:
The required Leapfrog filter simulates a LPF. The normalized values of
Li, Ci of such LPF and its signal flow diagram are plotted in the following
figure.
Fig. 2-35. Example showing the leapfrog simulation of a 3rd order ladder LPF.
-61-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
C = C /O RL,
Note that the active bandwidth B = (p1 - p ) = 1/√2, for a unity center
frequency (o =1). In order to simulate this ladder BPF, with Leapfrog
method, we proceed as follows:
-62-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
R = 10K
-63-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
(2-58a)
(2-58b)
-64-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
(2-59)
The circuit is shown in Fig. 2-41(a). Then consider the circuit in Fig. 2-
41(b), which is obtained by setting Y1 = g1, Y2 = sC2 and Y3 = g3. It is
found that a highpass filter is derived whose transfer function is given by
(2-60)
with the gain at the infinite frequency being gm/(g1 + g3 + gm) and the
cutoff frequency equal to g1g3/[(g1 + g3 + gm)C2]. This circuit also offers a
general first-order characteristic, as can be seen from its transfer function
(2-61)
-65-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Finally, if Y1 and Y2 are resistors and Y3 a capacitor, then both H1(s) and
H2(s) are of lowpass characteristic. The circuit is presented in figure 2-
41(c) and the transfer functions are given below.
(2-62a)
(2-62b)
(2-63)
(2-64)
(2-65a)
(2-65b)
Based on these expressions we can design and analyze the LPF. The same
design method can be used and the same design formulas and sensitivity
performance of ωo and Q can be achieved, with different configurations.
To show this, we select C2 = C4 = C and g1 = g3 = g. Using equation (2-
65) we can obtain the design formulas as
(2-66)
-67-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
(2-67)
Design can be carried out by comparing equation (2-67) with the standard
highpass characteristic
(2-68)
(2-69)
(2-70)
It can be shown that for this design, the highpass circuit has very low ωo
sensitivities, but Q sensitivities will increase with Q. The filter thus may
not suit very high Q applications. The design also requires interchanging
the OTA input terminals.
-68-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
(2-71)
(2-72b)
(2-73)
-69-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Fig. 2-47. One possible Configuration of a LPF, using OTA with 2-admittancs.
(2-
76)
Fig. 2-48. Highpass filter derived from the OTA 2-admittance model.
-70-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
(2-74)
(2-75)
(2-77)
Fig. 2-49. One possible configuration of a BPF, using OTA with 2-admittances.
(2-78b)
-71-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Finally, for the ideal voltage input, the first OTA in the input terminated
floating resistor simulation is redundant and can thus be eliminated
shown in figure 2-50(c). This simulation not only saves one OTA but also
has high input impedance, a feature useful for cascade design.
The transfer functions of the OTA-C (or gm-C) filters are the same as
those of the single OTA counterparts. The difference is only that in gm-C
filters, the gm’s are all OTA transconductances.
-72-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
-73-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Component substitution,
Signal flow simulation (Leapfrog simulation and Matrix methods),
Coupled biquad realization.
The Bruton method transforms the passive LC ladder into some new
equivalent ladder which contains no inductors, but some new
components, which are then replaced by OTA-C counterparts. The
admittance block substitution method deals with each ladder arm as a
whole and replaces it by the OTA-C circuit which has the same
impedance or admittance function. For illustration we consider the fifth-
order lowpass finite zero LC ladder in figure 2-53(a). We replace the
input and output termination resistors by the OTA counterparts in figures
2-53(a) and (b), respectively, and the two floating inductors by the OTA-
C equivalent in figure 2-53(b). The resulting OTA-C filter is displayed in
figure 2-53(b). The component values can be determined using the
formulas in equations (2-32).
-74-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Fig. 2-53. Illustration of the component substitution method, for a 5th order LPF
-75-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Two techniques for active signal simulation of a passive ladder exist. One
is to simulate relations of series-arm currents and parallel-arm voltages,
treating the respective arm as a single-port network.
The second method has a case-by-case feature, for the different passive
LC structures the signal flow equations may be very different. Also, note
that if each arm in the passive ladder structure is simply a single
component, such cases including all-pole LP and zero-at-origin HP LC
ladders, the block method will reduce to the component method. In the
following we will therefore concentrate on the block signal simulation
method for OTA-C filter design based on passive LC ladders. A
systematic treatment will be given
(2-79b)
Fig. 2-54. General admittance and impedance ladder with signals indicated.
(2-80a)
(2-80b)
(2-80c)
Where V j = Ij /gm. The Yj /gm and gmZi are voltage transfer functions. It is
clear that these equations will lead to the same transfer function Vout/Vin as
that from equation (2-75). The corresponding block diagram is shown in
Fig. 2-56. As traditionally done for Op-Amp filter design, to realize this
new block diagram we can similarly synthesize the voltage summers and
voltage transfer functions of Yj /gm and gmZi using OTA’s and capacitors.
Of course, different ladders will have different Yj and Zi values and the
scaled Leapfrog block diagram of general ladder.
(2-81)
(2-83a)
(2-83b)
From equation (2-83) we can see that besides the general scaling by gm,
each new grounded impedance has a separate transconductance which
can be used to adjust the impedance level. We can also note that Zj are
not the original impedances Zj in the ladder.
-78-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
The salient feature of the structure is that the OTA-C realization problem
becomes the OTA-C realization of the grounded impedances only and the
simple inductor substitution method can be conveniently used to simulate
the impedance constituents.
(2-85)
(2-86a)
(2-86b)
-79-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
(2-87a)
(2-87b)
Then using the formulas in equation (2-49) with the choice of equal
transconductances
(2-88)
We Obtain:
(2-89a)
(2-89b)
-80-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
The bandpass LC structure from the all pole lowpass prototype will
typically have series resonators in series arms and parallel resonators in
parallel arms. We start design from the bandpass LC ladder only and take
the LF simulation of the circuit in figure 2-60(a) as an example.
Recognizing that Y1 is an RLC series resonator, Z4 is a parallel RLC
resonator and Z2 and Y3 are the ideal parallel and series LC resonators and
following the same design procedure we can obtain the LF OTA-C filter
structure as shown in figure 2-60(b).
(2-90a)
(2-90b)
(2-90c)
-81-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Fig. 2-61. Ladder simulation using Leapfrog method, with switched capacitors
Fig. 2-62. Ladder simulation using Leapfrog method, with current conveyors
-82-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Fig. 2-64. A 1MHz third order Elliptic filter, with switched capacitors.
-83-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
As shown is composed of two stages, a 1st order LPF and a 2nd (biquad)
LPF, all implemented with switched capacitors and Op-Amps.
-84-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
Fig. 2-66. Ladder simulation using Leapfrog method, with switched capacitors
2-9. Summary
Filter Order: The order of a filter is an integer number, that defines how
complex the filter is. In common filters, the order of the filter is the
number of "stages" of the filter. Higher order filters perform better, but
they have a higher delay, and they cost more.
Transition Band The transition band is the area of the filter between the
passband and the stopband. Higher-order filters have a thinner transition
band
Stop Band The stop band of a filter is the frequency range where the
signal is attenuated. Stop band performance is often defined in the
specification for the filter. For instance, we might say that we want to
attenuate all frequencies above 5000Hz, and we want to attenuate them
all by -40db or more
-86-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
A bandstop filter will allow high frequencies and low frequencies to pass
through the filter, but will attenuate all frequencies that lay within a
certain band.
Some filters allow all frequency components to pass through these filters
are called allpass filters. The question must be raised "why would we
need a filter that doesnt remove anything from our signal?" And the
answer is that even though an allpass filter might not remove any
frequency components on the magnitude graph, it might have a very
beneficial effect on the phase graph.
Filter Design
It is possible to design a new type of filter, from scratch, but the filters
listed in this chapter have been studied extensively, and designs for these
filters (including circuit implementation) are all readily available.
Filter Approximation
The approximate response of a filter may be obtained using one of the
following famous approximation functions:
-87-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
The Filter approximation results in the transfer function of the filter. The
following table resumes the transfer functions of the 2nd order filters.
High Pass
Band Pass
Notch (Band
Reject)
In this chapter we dealt with high-orde filter design. The most popular
method for high-order filter design is the cascade method due to its
modularity of structure and simplicity of design and tuning. For a given
transfer function we first factorize it into low-order functions and then
realize these functions using the well-known low-order filter structures.
component substitution,
signal flow simulation, and
coupled biquad realization.
2-10. Problems
2-4) Design an active HPF with cutoff frequency o =10k rad/s, which
simulates a double terminated 3th order ladder filter, with source and load
resistors Rs=RL =1k. The required HPF should have maximal flat
response in the passband.
2-5) Design a 3rd order active LPF with cutoff frequency o =10k rad/s,
which is double terminated with source and load resistors Rs=RL =1k.
The required LPF should have maximal flat response in the passband.
Use Leapfrog simulation to implement the filter.
2-6) Choose the most suitable answer for the following statements:
1. The problem of passive filters is overcome by using
a) Analog filter
b) Active filter
c) LC filter
d) A combination of analog and digital filters
7. Refer to Figure (b). This is a ___ filter, and The roll-off of this filter is
about___
a) low-pass filter, 20 dB/decade.
b) high-pass filter, 40 dB/decade
c) low-pass filter, 60 dB/decade
d) band-pass filter 80 dB/decade
8. Refer to Figure (c). This circuit is known as a _____ filter, and the fc is
_____
a) high-pass, 1.59 kHz
b) band-pass, 15.9 kHz
c) low-pass, 15.9 kHz
d) high-pass, 15.9 kHz
-91-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
2-11. References
-92-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
-93-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 2
-94-
Dr. Eng. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
Fundamentals of Digital
Signal Processing
Contents
-95-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
Digital Signal
Processing &
Digital Filters
3-1. Introduction to Digital Signal Processing
Digital signal processing ('DSP') is the study of signals in a digital
representation and the processing methods of these signals. Digital and
analog signal processing are subfields of signal processing. Since the goal
of DSP is usually to measure or filter continuous real-world analog
signals, the first step is usually to convert the signal from an analog to a
digital form, by using an analog to digital converter (ADC). Often, the
required output signal is another analog output signal, which requires a
digital to analog converter (DAC).
-96-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
y[n] = a
i 0
i x[n i] b j y[n j ]
j 1
(3-1)
DSP
Spectral
Analysis Filtering
-98-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
N 1
j 2 nk N 1
x[n] X [k ].exp X [k ].WN
nk
(3-3)
k 0 N k 0
There are two basic varieties of FFT, one based on decimation in time
(DIT), and the other on decimation in frequency (DIF). Here we will
derive decimation in time. When is even, the DFT summation can be
split into sums over the odd and even indexes of the input signal:
1 N 1 1 N 1
X [k ] 1N
nk
WNk nk
1N (3-4)
2 2
n 0 n 0
where x[2n] and x[2n+1] denote the even- and odd-indexed samples
from x[n]. Thus, the length N is computable using two length ½ N of
corresponding DFTs. The complex factors WNk are called twiddle factors.
The splitting into sums over even and odd time indexes is called
decimation in time.
-100-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
The remainder of this chapter illustrates areas where DSP has produced
revolutionary changes. As you go through each application, notice that
DSP is very interdisciplinary, relying on the technical work in many
adjacent fields. As Fugue 5-4 suggests, the borders between DSP and
other technical disciplines are not sharp and well defined, but rather fuzzy
and overlapping. If you want to specialize in DSP, these are the allied
areas you will also need to study.
-101-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
-102-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
While the SHARC DSPs are optimized in dozens of ways, two areas are
important enough to be included in figure 3-6(d): an instruction cache,
and an I/O controller.
-103-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
-104-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
In both cases the programmer has to keep a track of by how much the
binary point has been shifted, in order to restore all numbers to the same
scale at some later stage. Floating point format has the remarkable
property of automatically scaling all numbers by moving, and keeping
track of, the binary point so that all numbers use the full word length
available but never overflow:
-107-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
Floating point numbers have two parts: the mantissa, which is similar to
the fixed point part of the number, and an exponent which is used to keep
track of how the binary point is shifted. Every number is scaled by the
floating point hardware:
If a number becomes too large for the available word length, the
hardware automatically scales it down, by shifting it to the right
If a number is small, the hardware automatically scale it up, in
order to use the full available word length of the mantissa
In both cases the exponent is used to count how many times the number
has been shifted.
In floating point numbers the binary point comes after the second most
significant bit in the mantissa.
The block floating point format provides some of the benefits of floating
point, but by scaling blocks of numbers rather than each individual
number:
Block floating point numbers are actually represented by the full word
length of a fixed point format.
If any one of a block of numbers becomes too large, the
programmer scales down all numbers, by shifting them to the right
If the largest of a block of numbers is small, the programmer scales
up all numbers, to use the full available word length of the mantissa
In both cases the exponent is used to count how many times the numbers
in the block have been shifted.
The floating point format has one further advantage over fixed point: it is
faster. Because of quantization error, a basic direct form 1 IIR filter
second order section requires an extra multiplier, to scale numbers and
avoid overflow. But the floating point hardware automatically scales
every number to avoid overflow, so this extra multiplier is not required:
Figure 3-11 shows some of the major trends in DSPs. Figure 3-11(a)
illustrates the impact that Digital Signal Processors have had on the
embedded market. These are applications that use a microprocessor to
directly operate and control some larger system, such as a cellular
telephone, microwave oven, or automotive instrument display panel. The
name "microcontroller" is often used in referring to these devices, to
distinguish them from the microprocessors used in personal computers.
As shown in (a), about 38% of embedded designers have already started
using DSPs, and another 49% are considering the switch. The high
throughput and computational power of DSPs often makes them an ideal
choice for embedded designs.
the programs are usually much shorter. Second, the execution speed is
often a critical part of the application.
-112-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
3-6. Summary
Digital filters fall into two main categories: finite impulse response (FIR)
and infinite impulse response filter (IIR). An FIR filter uses only the
input signal, while an IIR uses both the input signal and previous samples
of the output signal. FIR filters are always stable, while IIR filters may be
unstable. Most filters can be described in Z-domain (a superset of the
frequency domain) by their transfer functions. A filter may also be
described as a difference equation, a collection of zeroes and poles or, if
it is an FIR filter, an impulse response or step response.
-113-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
ROM RAM
Code ROM
Input No Wo
N1 W1 Output
X N2 W2 Y
: :
Nm Wm
Bus
Wi
y
Ni Wi
y MAC
-114-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
3-6. Problems
3-3) What is the nature of the following function: y[n] = y[n-1] + x[n]?
a) Integrator
b) Differentiator
c) Subtractor
d) Accumulator
3-5) The difference equation relating the input and output of the infinite
duration impulse response (IIR) filter, shown in Figure below, is
y(n) =ay(n − 4) + g x(n) − gx(n − 4)]
(i) Taking the z-transform of the difference equation find, the transfer
function of the filter.
(ii) Describe the transfer function in polar form, and for a value of
a=0.6561 obtain the pole and zeros of the filter and sketch its pole-zero
diagram.
(iii) Sketch the frequency response of the filter, and suggest an
application for this filter. Discuss the effect of varying the value of a on
the frequency response of the filter.
-115-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 3
3-7. References
-116-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
Digital Filters
Contents
9-1. Introduction
9-3. Digital Filters
9-3.1. Types of Digital Filters
9-3.2. Finite Impulse Response (FIR) Filter
9-3.3. Infinite Impulse Response (IIR) Filter
9-4. Examples of Digital Filters
9-5. Stability of Digital Filters
9-6. Synthesis (Implementation) of Digital Filters
9-6.1. Direct Forms (DF-I & DF-II)
9-6.2. Canonic and Non-Canonic Forms
9-6.3. Software Method
9-7. Summary
9-8. Problems
9-9. Bibliography
-117-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
-118-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
Digital Filters
4-1. Introduction
In this chapter we develop several mathematically equivalent ways to
describe and characterize digital filters, namely, in terms of their:
• Transfer function H(z)
• Frequency response H(ω)
• Block diagram realization and sample processing algorithm
• I/O difference equation
• Pole/zero patterns
• Impulse response h(n)
• I/O convolutional equation
-119-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
A digital filter is just a filter that operates on discrete digital signals, such
as sound represented inside a computer. It is a computation which takes
one sequence of numbers (the input signal, x[n]) and produces a new
sequence of numbers (the filtered output signal, y[n]). The active filters
mentioned in chapter 5 are not digital because they operate on analog
signals. It is important to realize that a digital filter can do anything that a
real-world filter can do. Thus, a digital filter is only a formula for going
from one digital signal to another. It may exist as an equation on paper, as
a small loop in a computer subroutine, or as an integrated circuit chips.
Many digital filters are based on the Fast Fourier transform (FFT), a
mathematical algorithm that quickly extracts the frequency spectrum of a
signal, allowing the spectrum to be manipulated before converting the
modified spectrum back into a time-series signal. Here, we present the
two famous types of digital filters, and their basic architectures.
Y ( z ) a0 a1 z 1 a2 z 2 ... aM z M
H ( z) (4-1)
X ( z ) 1 b1 z 1 b2 z 2 .... bN z N
where M is the order of the filter and X(z) = {x[n]} and Y(z) = {y[n]}
are the z-transforms of input and output digital sequences, respectively.
This form is for a recursive filter, which typically leads to infinite
impulse response (IIR) behavior, but if the denominator is unity, then this
is the form for a finite impulse response (FIR) filter. In fact, M is
-120-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
More details about the Z-Transform and its characteristics can be found
in Appendix D of this book.
where ai are the filter coefficients. M is known as the filter order; an Mth-
order filter has (M + 1) terms on the right-hand side; these are commonly
referred to as taps. The previous equation can be expressed as follows:
-121-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
M
y[n] ai x[n i ] (4-3)
i 0
To find the impulse response we set the input data samples as follows:
where δ[n] is the Kronecker delta impulse. The impulse response for an
FIR filter is given by the following set of coefficients:
M
h[n] ai [n i ] an (4-5)
i 0
The Z-transform of the impulse response yields the transfer function H(z)
= Y(z)/X(z) of the FIR filter, as follows:
n M
H ( z ) {h[n]} h[n].z
n
n
an z n
n0
(4-6)
FIR filters are BIBO1 stable, since the output is a sum of a finite number
of finite multiples of the input values, so can be no greater than ai times
the largest value appearing in the input The following figure depicts the
typical block diagram of an FIR filter. The D (or z−1) blocks are unit
delay elements (flip-flops).
The following figure shows the block diagram of a moving average filter,
which is a very simple FIR filter. The filter coefficients are given by:
1
BIBO stands for “Bounded Input Bounded Output:” that’s for a bounded input, the output is
bounded.
-122-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
(4-7)
for i= 0,1,…,N
Here, we select the filter order: N=2 (2nd order moving average filter)
The following figure shows the pole-zero diagram of the filter. Note that
there are two poles at the origin and two zeroes at
The following figure shows the absolute value of the frequency response.
Clearly, the moving-average filter passes low frequencies with a gain
near 1, and attenuates high frequencies. This is a typical low-pass filter
characteristic.
-123-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
Fig. 4-4(b). Poles and zeroes of the moving average filter example (of order 2).
Fig. 4-4(c). Frequency response of the moving average filter example (of order 2).
-124-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
Fig. 4-5. Illustration of the Windowing method for digital filter design
In order to find the transfer function H(z) = Y(z)/X(z) of the filter, we first
take the Z-transform of each side of the above equation, and we use the
time-shift property to obtain:
M N
a z
i 0
i
i
. X ( z ) b j z jY ( z )
j 0
(4-8b)
The following figure depicts the typical block diagram of an IIR filter
looks like the following. The D (or z−1) blocks are unit delay elements
(flip-flops). The coefficients ak, bk and number of feedback/feed-forward
paths (M and N) are implementation-dependent.
In practice, design engineers find IIR filters to be fast and cheap, but with
poorer bandpass filtering and stability characteristics than FIR filters. The
-128-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
Example 4.1
Consider the design of a high-pass linear-phase digital FIR filter
operating at a sampling rate of Fs Hz and with a cutoff frequency of Fc
Hz. The frequency response of the filter is given by
-130-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
The impulse response hd(m) is non-causal (nonzero for m < 0) and infinite
in duration. To obtain an FIR filter of order M we multiply hd(m) by a
rectangular window sequence of length M+1 samples. To introduce
causality (h(m) =0 for m < 0) shift the truncated h(m) by M/2 samples
Example 4.2
Consider the design of a band-pass linear-phase digital FIR filter
operating at a sampling rate of Fs and a lower and higher cutoff FL and FH
Hz. The frequency response of the HPF is given by
-131-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
The impulse response hd(m) is non-causal (nonzero for m < 0) and infinite
in duration. To obtain an FIR filter of order M multiply hd(m) by a
rectangular window sequence of length M+1 samples. To introduce
causality (h(m) =0 for m < 0) shift the truncated h(m) by M/2 samples
-132-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
The impulse response hd(m) is non-causal (nonzero for m < 0) and infinite
in duration. To obtain an FIR filter of order M we multiply hd(m) by a
rectangular window sequence of length M+1 samples. To introduce
causality (h(m) =0 for m < 0) shift h(m) by M/2 samples
v- Allpass Filter
The all pass filter (APF) is a filter that has a unity magnitude response for
all frequencies. It does not affect the frequency response of a filter. The
APF does affect the phase response of the system. For example, if an IIR
filter is designed to meet a prescribed magnitude response often the phase
response of the system will become non-linear. To correct for this non-
linearity an allpass filter is cascaded with the IIR filter so that the overall
response (IIR + APF) has a constant group delay.
-133-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
(4-10)
-134-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
(4-12)
The decimation factor is the ratio of the input rate to the output rate. It is
usually symbolized by "M", so M = input rate / output rate. You can
only decimate by integer factors and cannot decimate by a fraction.
Implementation
Decimation consists of the processes of lowpass filtering, followed by
down-sampling. To implement the filtering part, you can use either FIR
or IIR filters. The CIC implementation of a decimation filter is the
cascade of an integrator stage, a decimation procedure, and a comb stage
as shown in figure 4-13.
before and after the decimation. The integrator section is the cascade of N
ideal digital integrator stages operating at the high sampling rate Fs, The
comb sections consist of N comb stages operating at the low sampling
rate of FS/R, where R is the rate change factor. The comb sections have a
delay of M samples per stage
The cascade of the integrator and comb sections of the CIC filter requires
a decimation process to be implemented between these two filters. The
order of the comb filter and the decimation procedure can be switched
without causing any change in the end results of the filtering operation.
The integrator and comb stages of the filter can be combined into a
single transfer function, thus simplifying analysis. The transfer function
of the cascaded integrator comb filter before decimation is then
(4-13)
(4-14)
-137-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
Only the feedback coefficients bj (in the transfer function of IIR filters)
can cause instability.
Filter stability may be discussed further in terms of poles and zeros of the
system. We can say that stability is guaranteed when all filter poles have
magnitude less than 1. So, a recursive (IIR) filter is stable if and only if
all its poles have magnitude less than 1.
-138-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
Fig. 4-15. System diagram for the digital filter described by equation (4-10).
-139-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
We can also implement digital filters using C or C++ code. The following
code listings for FIR.h and FIR.cpp, depict the header file and class file for
implementing arbitrary causal FIR filters
/********************************************/
/* General Finite-Impulse-Response (FIR) */
/* digital filter class */
/********************************************/
#if !defined(__FIR_h)
#define __FIR_h
#include "Object.h"
#include "FIR.h"
#include <string.h>
FIR :: FIR(int theLength) : Object()
{
length = theLength;
coeffs = (FLOAT *) malloc(length*sizeof(FLOAT));
pastInputs =(FLOAT *) calloc(2*length,sizeof(FLOAT)); piOffset = length;
strcpy(name,"FIR Filter");
}
FIR :: FIR(const char *filterFile) : Object()
{
FILE *fp;
-141-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
float d;
int rtn,i;
strncpy(name,filterFile,strlen(name));
fp = fopen(filterFile,"r");
if (!fp) {
char nfn[1000];
strcpy(nfn,FILTER_DIR);
strcat(nfn,filterFile);
printf("Couldn't find soundfile %s. Trying %s\n", filterFile, nfn);
fp = fopen(nfn,"r");
if (!fp) {
printf("Couldn't find filterfile %s or %s!\n",filterFile,nfn);
exit(-1);
}
}
rtn = fscanf(fp,"%f",&d);
if (rtn == EOF)
goto error;
delay = (FLOAT) d;
rtn = fscanf(fp,"%f",&d);
if (rtn == EOF)
goto error;
length = (int)d;
coeffs = (FLOAT *) malloc(length*sizeof(FLOAT));
pastInputs = (FLOAT *) calloc(2*length, sizeof(FLOAT));
for (i=0;i<length;i++) {
rtn = fscanf(fp,"%f",&d);
if (rtn == EOF)
goto error;
coeffs[i] = (FLOAT)d;
}
piOffset = length;
return;
error:
fprintf(stderr,"Premature EOF or bad numbers in filter file %s\n", filterFile);
exit(-1);
}/////////////////////////////////////////////////////
FIR :: ~FIR()
{
free(pastInputs);
free(coeffs);
}/////////////////////////////////////////////////////
void FIR :: clear()
{
int i;
for (i=0; i < 2*length; i++) {pastInputs[i] = 0;}
piOffset = length;
}/////////////////////////////////////////////////////
-142-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
-143-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
The step response of the two filters is shown in figure 4-17(e) and (f).
The digital filter's step response is symmetrical between the lower and
upper portions of the step, i.e., it has a linear phase. The analog filter's
step response is not symmetrical, i.e., it has a nonlinear phase. One more
point for the digital filter. Lastly, the analog filter overshoots about 20%
on one side of the step. The digital filter overshoots about 10%, but on
both sides of the step. Since both are bad, no points are awarded. In spite
of this beating, there are still many applications where analog filters
-144-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
-146-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
4-8. Summary
Digital signal processing (DSP) is the study of signals in a digital
representation and the processing methods of these signals. DSP includes
subfields like: audio and speech signal processing, sonar and radar signal
processing, sensor array processing, spectral estimation, statistical signal
processing, image processing, signal processing for communications,
biomedical signal processing, etc. Since the goal of DSP is usually to
measure or filter continuous real-world analog signals, the first step is
usually to convert the signal from an analog to a digital form, by using an
analog to digital converter. Often, the required output signal is another
analog output signal, which requires a digital to analog converter.
Digital filters fall into two main categories: finite impulse response (FIR)
and infinite impulse response filter (IIR). If you put in an impulse, that is,
a single "1" sample followed by many "0" samples, zeroes will come out
after the "1" sample has made its way through the delay line of the filter.
An FIR filter uses only the input signal, while an IIR uses both the input
signal and previous samples of the output signal. FIR filters are always
stable, while IIR filters may be unstable. Most filters can be described in
Z-domain (a superset of the frequency domain) by their transfer
functions. A filter may also be described as a difference equation, a
collection of zeroes and poles or, if it is an FIR filter, an impulse response
or step response.
-148-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
4-8. Problems
4-1) What does "FIR" mean? Why is the impulse response "finite"?
4-2) How do FIR filters compare to IIR filters? What are the advantages
and disadvantages of FIR Filters (compared to IIR filters)?
4-3) What is the main difference between the Windowed-Sinc filter and
the Chebyshev filter? Which is the best digital filter in the frequency
domain?
4-4) Design an IIR LPF, with a corner cutoff frequency 10 kHz and
maximal flat response in the passband
4-5) Choose the most suitable answer for the following sentences
1. IIR filters
a. use feedback
b. are sometimes called recursive filters
c. can oscillate if not properly designed
d. all of the above
2. The output of two digital filters can be added. The same effect can be
achieved by
a. adding their coefficients
b. subtracting their coefficients
c. convolving their coefficients
d. averaging their coefficients and then using a Blackman window
3. DSP convolves each discrete sample with four coefficients and they are
all equal to 0.25. This must be a
a. low-pass filter
b. high-pass filter
c. band-pass filter
d. band-stop filter
8. Two digital filters can be operated in cascade. The same effect can be
achieved by
a. adding their coefficients
b. subtracting their coefficients
c. convolving their coefficients
d. averaging their coefficients and then using a Blackman window
9. A DSP convolves each discrete sample with four coefficients and they
are all equal to 0.25. This must be an
a. IIR filter
b. FIR filter
c. RRR filter
d. All of the above
4-6) Briefly list the signal processing steps required in the window design
technique, to obtain the coefficients of a causal FIR discrete-time filter
given the desired frequency response of the filter H(f).
4-7) Using the inverse Fourier transform method design two digital
filters, a low-pass filter and a high-pass filter, to divide the input signal
into two equal bandwidth signals.
-150-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
4-9. References
-151-
Prof. Dr. Muhammad EL-SABA
Integrated Circuits Technology & Applications Chapter 4
-152-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
Applications of
Digital Signal Processing
Contents
-151-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
-152-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
Applications of
Digital Signal Processing
5-1. Introduction
Digital signal processing is one of the core technologies in rapidly
growing application areas such as wireless communications, audio and
video processing, and industrial control. Designing efficient digital signal
processing systems cover a complete spectrum of design issues from DSP
perspective. This chapter discusses several DSP applications. Digital
signal processing and digital filters have so many applications in so many
domains, among which one can cite:
-153-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
>> PI fi(pi, 1, 3+5, 5);% Specifying N bits and the fraction part
>> bin(PI)
01100101
>> double(PI)
3.1563
-155-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
S2 Design a top layer that in a loop runs the design for all possible sets
of inputs. Each iteration executes the serialized code with range
directives for one possible set of inputs. Make these directives keep a
track of maximum max vari and minimum min vari values of each
variable vari. After running the code for all iterations, the range
directives return the range that each variable vari takes in the
implementation.
S3 To convert each floating point variable vari to fixed point variable
fx vari in its equivalent Qni.mi fixed point format, extract the integer
length ni using the following mathematical relation:
-156-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
The algorithm designer should always write MATLAB_ code for easy
translation into C/C++ and its subsequent HW/SW partitioning; where
HW is implementation is in RTL Verilog and SW components are
mapped on DSP
Let's see what happens when we separate odd ns from even ns (from now
on, let's assume that N is even):
WNk(2r) = e-2πi*2kr/N = e-2πi*kr/(N/2) = WN/2kr (3-5)
Notice an interesting thing: the two sums are nothing else but N/2-point
Fourier transforms of, respectively, the even subset and the odd subset of
samples. Terms with k greater or equal N/2 can be reduced using another
identity:
WN/2m+N/2 = WN/2mWN/2N/2 = WN/2m (3-6)
We can represent the two equations for the components of the 2-point
transform graphically using the, so called, butterfly
-158-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
This diagram is the essence of the FFT algorithm. The main trick is that
you don't calculate each component of the Fourier transform separately.
That would involve unnecessary repetition of a substantial number of
calculations. Instead, you do your calculations in stages. At each stage
you start with N (in general complex) numbers and "butterfly" them to
obtain a new set of N complex numbers. Those numbers, in turn, become
the input for the next stage.
-160-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
The calculation of a 4-point FFT involves two stages. The input of the
first stage are the 4 original samples. The output of the second stage are
the 4 components of the Fourier transform. Notice that each stage
involves N/2 complex multiplications (or N real multiplications), N/2
sign inversions (multiplication by -1), and N complex additions. So each
stage can be done in O(N) time. The number of stages is log2N (which,
since N is a power of 2, is the exponent m in N = 2 m). Altogether, the
FFT requires on the order of O(N logN) calculations. Moreover, the
calculations can be done in-place, using a single buffer of N complex
numbers. The trick is to initialize this buffer with appropriately scrambled
samples. For N=4, the order of samples is v[0], v[2], v[1], v[3]. In
general, according to our basic identity, we first divide the samples into
two groups, even ones and odd ones. Applying this division recursively,
we split these groups of samples into two groups each by selecting every
other sample. For instance, the group (0, 2, 4, 6, 8, 10, ... 2N-2) will be
split into (0, 4, 8, ...) and (2, 6, 10, ...), and so on. If you write these
numbers in binary notation, you'll see that the first split (odd/even) is
done according to the lowest bit; the second split is done according to the
second lowest bit, and so on. So if we start with the sequence of, say, 8
consecutive binary numbers:
[even] (000, 010, 100, 110), [odd] (001, 011, 101, 111)
-161-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
#include <complex>
typedef std::complex<double> Complex;
// Use Standard complex Library
// FFT Constructor
FFT::FFT (int Points, long sampleRate)
: _Points (Points), _sampleRate (sampleRate)
{
_sqrtPoints = sqrt((double)_Points);
// calculate binary log
_logPoints = 0;
Points--;
while (Points != 0)
{
Points >>= 1;
_logPoints++;
}
// This is where the original samples will be stored
_aTape = new double [_Points];
int _2_l = 2;
for (int l = 1; l <= _logPoints; l++)
{
_W[l] = new Complex [_Points];
The bit reversal is done inside PutAt, which also converts real samples
into complex numbers (with the imaginary part set to zero):
void FFT::PutAt (int i, double val) {
_X [_aBitRev[i]] = Complex (val);}
-163-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
_X [i] += T;
}
}
step *= 2;
}
}////////////////////////////////////////////////////////////////////////////////////////////////
Fig. 5-7. Efficiency verses flexibility tradeoff while selecting a design option
-165-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
5-4.1. Algorithm
These algorithms fall into the following categories.
Code intensive algorithms. These do not have repeated code. This
category consists of code for phone book management, keyboard
interface, GSM protocol stack, and the code for configuring different
devices in the system.
Structured and computationally intensive algorithms. These mostly
take loops in software and are excellent candidates for hardware
mapping. These algorithms consist of digital up and down conversion,
demodulation and synchronization loops, and forward error correction
(FEC).
Code intensive and computationally intensive algorithms. These lack
any regular structure. Although their implementations do have loops,
they are code intensive. Speech compression is an example.
Fig. 5-8. Efficiency verses flexibility tradeoff while selecting a design option
-166-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
It is interesting to note that, in many high end systems, usually all the
design options are exercised. The code intensive part of the application
can be mapped on GPPs, non-structured signal processing algorithms
are mapped on DSPs, and structured algorithms are mapped on FPGAs,
whereas for standard algorithms ASICs are used. These apparently simple
decisions are very critical once the system proceeds along the design
cycle. The decisions are especially significant for the blocks that are
partitioned for hardware. The designer takes the high level design and
starts implementing the hardware. The digital design is implemented at
RTL level and then it is synthesized and tools translate the code to gate
level. The synthesized design is physically placed and routed.
As the design. goes along the design cycle, the details are very complex
to comprehend and change. The designer at every stage has to make
decisions, but as the design moves further along the cycle these decisions
have less impact on the overall function and performance of the design.
The relationship between the impact of the design decision and its
associated complexity is shown in figure 5-9.
-167-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
In a burst modem, the receiver starts in burst detection state. In this state
the system executes the start. The output of the corrected signal is passed
to the slicer. The slicer makes the soft and hard decisions. For forward
error correction (FEC), the system implements a Viterbi algorithm to
correct the bit errors in the slicer soft decision output, and generates the
final bits. The algorithm is partitioned to be mapped on different
components based on the basis of required computations in
implementation. The following figure depicts the system is effectively
portioned and implemented.
-168-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
The parameter initialization function sets all the parameters for the
modulator.
-171-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
elseif(PARAMS.BPS 3)
PARAMS.const Table PSK8 Table;
elseif(PARAMS.BPS 4)
PARAMS.const Table QAM Table
Similarly the state initialization function sets all the states for the
modulator for chunk by chunk processing of data. For this simple
example, the symbols are first zero padded and then they are passed
through a Nyquist filter. The delay line for the filter is initialized in this
function. For more complex applications this function may have many
more arrays.
-172-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
There are primarily two common methods to represent and specify DSP
algorithms: language driven executable description and graphics or flow
graph driven specification. The language driven methods are used for
software development, high level languages being used to code
algorithms. The languages are either interpretive or executable.
MATLAB is an example of an interpretive language. Signal processing
algorithms are usually coded in MATLAB. As the code is interpreted line
by line, execution of the code has considerable overheads. To reduce
these it is always best to write compact MATLAB code (.m file). For
computationally intensive algorithms, the designer usually prefers to
write the code in C/C++ (or generate it from MATLAB). As in these
languages the code is compiled for execution, the executable runs much
faster than its equivalent MATLAB simulation.
Fig. 5-13. Generation of HDL from MATLAB with DSP Builder, from Altera.
-174-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
-175-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
-176-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
Fig. 5-15. optical spectrum of the 100 Gbps DP-QPSK signal after the transmitter, as
well as the RF spectrum obtained after the Coherent DP-QPSK Receiver.
-177-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
-178-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
-179-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
5-7. Summary
The introduction of the microprocessor in the late 1970's and early 1980's
made it possible for DSP techniques to be used in a much wider range of
applications. However, the initial generations of general-purpose
microprocessors did fulfill the requirements of DSP. A Digital Signal
Processor (DSP) is a special-purpose CPU (Central Processing Unit) that
provides ultra-fast instruction sequences. DSP’s are microprocessors
specifically designed to handle DSP tasks which are carried out by
intensive mathematical operations.
-180-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
-181-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
5-8. Problems
-182-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
5-9. References
-183-
Prof. Dr. Muhammad EL-SABA
Analog & Digital Signal Processing Chapter 5
-184-
Prof. Dr. Muhammad EL-SABA
Analog and Digital Signal Processing Appendices
It is not the intention of this book to teach the topic of signals and
systems or the topic of transforms. However, we present here a brief
description to remind people with these topics. If you do not know what
the Laplace Transform or the Fourier Transform are, it is highly
recommended that you use this appendix as a quick guide
-185-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
-186-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Continuous-Time
Signals & Systems
A system is considered continuous if the signal exists for all time.
Frequently, the terms "analog" and "continuous" are usually employed
interchangably, although they are not strictly the same. Assume a
continuous-time system with impulse response h(t), as shown in the
following figure. The system processes the continuous-time input signal
x(t) in some way, and produces an output y(t). At any value of time, t, we
input a value of x(t) into the system and the system produces an output
value for y(t). For instance, if we have a multiplier system whose
input/output relation is given by y(t) = 7 x(t), and the input value x(t) =
sin(wt) then the output is y(t) = 7sin(wt).
1- Additivity
A system satisfies the property of additivity, if a sum of inputs results in
a sum of outputs. By definition: an input of x3(t) = x1(t) + x2(t) results in
an output of y3(t) = y1(t) + y2(t).
-187-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
2- Homogeniety
A system satisfies the condition of homogeniety if an output scaled by a
certain factor produces an output scaled by that same factor. By
definition: an input of ax1 results in an output of ay1
3- Linearity
A system is considered linear if it satisfies the conditions of Additivity
and Homogeniety.
4- Causality
A simple definition of a causal system is a system in which the output
does not change before the input. A more formal definition of a causal
system is the system whose output is only dependant on past or current
inputs. A system is called non-causal if the output of the system is
dependant on future inputs. This book will only consider causal systems,
because they are easier to work with and understand, and since most
practical systems are causal in nature.
5- Memory
A system is said to have memory if the output from the system is
dependant on past inputs (or future inputs!) to the system. A system is
called memoryless if the output is only dependant on the current input.
Memoryless systems are easier to work with, but systems with memory
are more common in digital signal processing applications.
6- Time-Invariance
A system is called time-invariant if the system relationship between the
input and output signals is not dependant on the passage of time. If the
input signal x(t) produces an output y(t) then any time shifted input, x(t +
δ), results in a time-shifted output y(t + δ). This property can be satisfied
if the transfer function of the system is not a function of time except
expressed by the input and output.
-188-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Laplace Transform
(B-1)
δ(t) 1
δ(t − a) e − as
u(t)
u(t − a)
t u(t)
tnu(t)
-189-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
eat u(t)
tn ea tu(t)
cos(ωt) . u(t)
sin(ωt) u(t)
cosh(ωt) u(t)
sinh(ωt) u(t)
eatcos(ωt) u(t)
eatsin(ωt) u(t)
Property Definition
Linearity
Differentiation
Frequency
Division
-190-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Property Definition
Frequency Integration
Time Integration
Scaling
Frequency Shifts
Time Shifts
Convolution Theorem
where: , and s = σ + jω
(B-2)
The inverse transform converts a function from the Laplace domain back
into the time domain.
Note that F(s) may not fall into any standard form, for which the inverse
Laplace transform is well-known. In this case we use the so-called
Partial Fraction Expansion (also called Heaviside expansion) Method
to expand F(s) into a series of simple terms, whose inverse Laplace
transform is known. Assume
-191-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
N ( s ) K ( s z1 )( s z2 )...( s zm )
F( s )
D( s ) ( s p1 )( s p2 )...( s pn ) (B-3)
where the coefficients ai (i=1, 2, ..n) are called the residues of F(s) and pi
are called the poles of F(s). The residues ai can be obtained from F(s) as
follows:
N( s )
ai Lims pi ( s pi ) (B-5)
D( s )
n a n
f ( t ) L1 F ( s ) L1 i a i exp( pit ) (B-6)
i 1 s pi i 1
Example:
Assume:
s5 (s5)
F( s )
s 2 3 s 2 ( s 1 )( s 2 )
So, we have two poles: p1= -1 and p2 = -2. Using the partial expansion
method, equation (B-5), we get a1 = 4 and a2= -3, so that
4 3
F( s )
( s 1) ( s 2 )
d k j N( s )
aij Lims pi k j ( s pi )k , for j = 1, 2,….k (B-7)
ds D( s )
-192-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Example:
Assume:
s 2 2s 3 s 2 2s 3
F( s )
s 3 3s 2 3s 1 ( s 1 )3
Here, we have 3 identical poles (k=3) at: p1=-1. So, we can write F(s) as
follows:
Using the partial expansion method, equation (B-7), we get a11 = 1 and
a12= 0, and a13 = 2, so that:
-193-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
FourierIntegral
Transform (FIT)
The Fourier Transform (or integral transform) is very similar to the
Laplace transform. The Fourier transform uses the assumption that any
finite time-domain can be broken into an infinite sum of sinusoidal (sine
and cosine waves) signals. Under this assumption, the Fourier Transform
converts a time-domain signal into it's frequency-domain representation,
as a function of the radial frequency, ω. The Fourier Transform is defined
as such:
(C-1)
We can now show that the Fourier Transform is equivalent to the Laplace
transform, when the following condition is true: s = jω Because the
Laplace and Fourier Transforms are so closely related, it does not make
much sense to use both transforms for all problems. This book, therefore,
will concentrate on the Laplace transform for nearly all subjects, except
those problems that deal directly with frequency values. For frequency
problems, it makes life much easier to use the Fourier Transform
representation. Like the Laplace Transform, the Fourier Transform has
been extensively tabulated. The following tables illustrates the Fourier
Transform of famous functions as well as the properties of the Fourier
transform.
1 2πδ(ω)
δ(t) 1
δ(t − c) e − jωc
u(t)
-194-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
e − btu(t)
cosω0t π[δ(ω + ω0) + δ(ω − ω0)]
cos(ω0t + θ) π[e − jθδ(ω + ω0) + ejθδ(ω − ω0)]
sinω0t jπ[δ(ω + ω0) − δ(ω − ω0)]
sin(ω0t + θ) jπ[e − jθδ(ω + ω0) − ejθδ(ω − ω0)]
2πpτ(ω)
(C-1)
s = σ + jω
-195-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Discrete-Time
Signals & Systems
Digital data is represented by discrete number values. Assume a discrete-
time system with impulse response h[n], as shown in the following
figure. The system processes the input x[n] in some way, and produces an
output y[n]. At each integer value for discrete time, n, we input a value
of x[n] into the system and the system produces an output value for y[n].
For instance, if we have a multiplier system whose input/output relation is
given by y[n] = 7 x[n], and the input sequence x[n] = [1 0 1 3] then the
out output sequence is y[n] = [7 0 7 21].
1- Additivity
A system satisfies the property of additivity, if a sum of inputs results in
a sum of outputs. By definition: an input of x3[n] = x1[n] + x2[n] results in
an output of y3[n] = y1[n] + y2[n].
-196-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
2- Homogeniety
A system satisfies the condition of homogeniety if an output scaled by a
certain factor produces an output scaled by that same factor. By
definition: an input of ax1 results in an output of ay1
3- Linearity
A system is considered linear if it satisfies the conditions of Additivity
and Homogeniety.
4- Causality
A simple definition of a causal system is a system in which the output
does not change before the input. A more formal definition of a causal
system is the system whose output is only dependant on past or current
inputs. A system is called non-causal if the output of the system is
dependant on future inputs. This book will only consider causal systems,
because they are easier to work with and understand, and since most
practical systems are causal in nature.
5- Memory
A system is said to have memory if the output from the system is
dependant on past inputs (or future inputs!) to the system. A system is
called memoryless if the output is only dependant on the current input.
Memoryless systems are easier to work with, but systems with memory
are more common in digital signal processing applications.
6- Shift-Invariance
A system is called shift-invariant if the system relationship between the
input and output signals is not dependant on the passage of time.
If the input signal x[n] produces an output y[n] then any time shifted
input, x[n +N], results in a time-shifted output y[n+N] This property can
be satisfied if the transfer function of the system is not a function of time.
-197-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Discrete Fourier
Transform (DFT)
The Discrete Fourier Transform (DFT) of a signal may be defined by:
where
When all N signal samples x(tn) are real, we say x Є RN. If they may be
complex, we writexe x Є CN. Finally, n Є N means n is any integer.
Inverse DFT
The inverse DFT (the IDFT) is given by :
-198-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
In the signal processing literature, it is common to write the DFT and its
inverse in the more pure form below, obtained by setting T=1 in the
previous definition:
where x(n) denotes the input signal at time (sample) n, and X(k) denotes
the kth spectral sample. This form is the simplest mathematically, while
the previous form is easier to interpret physically.
i.e.,
This is a special case of the power theorem. It, too, is often referred to as
Parseval's theorem (being a special case).
-199-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Fast Fourier
Transform (FFT)
The fast Fourier transform (FFT) is an efficient implementation of the
discrete Fourier transform (DFT) for highly composite transform lengths
N. When N is a power of 2, the computational complexity drops from
O(N2) for the DFT down to O(N.lnN) for the FFT, where lnN denotes the
logarithm-base-2 of N. The FFT was first described by Gauss in 1805 and
rediscovered in the 1960s by Cooley and Tukey. The first stage of a
radix-2 FFT algorithm is derived below; the remaining stages are
obtained by applying the same decomposition recursively. As we have
seen so far, the DFT is defined as follows:
.
Note also that WNN
=1. There are two basic varieties of FFT, one based
on decimation in time (DIT), and the other on decimation in frequency
(DIF). Here we will derive decimation in time. When is even, the DFT
summation can be split into sums over the odd and even indexes of the
input signal:
(F.1)
-200-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
(F.2)
where xe(n) ≡ x(2n) and xo(n) ≡ x(2n+1) denote the even- and odd-
indexed samples from x. Thus, the length N DFT is computable using two
length ½ N DFTs. The complex factors:
are called twiddle factors. The splitting into sums over even and odd time
indexes is called decimation in time. (For decimation in frequency, the
inverse DFT of the spectrum X(k) is split into sums over even and odd
bin numbers k.)
-201-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Z- Transform
(G-1)
The following table depicts the z-transform of main signals and their
region of convergence (ROC).
Z-Transform Tables:
-202-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
10
11
-203-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Modified Z- Transform
(H-1)
-204-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Star Transform
(I-1)
-205-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Bilinear Transform
roots inside the unit circle in the Z-domain will be mapped to roots
on the left-half of the W plane.
roots outside the unit circle in the Z-domain will be mapped to
roots on the right-half of the W plane
roots on the unit circle in the Z-domain will be mapped onto the
vertical axis in the W domain.
(J-1)
(J-2)
(J-3)
-206-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
(J-4)
-207-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
FFT Code in
BASIC
3000 'FFT FOR REAL SIGNALS
3010 'Upon entry, N% contains the number of points in the DFT, REX[ ]
contains
3020 'the real input signal, while values in IMX[ ] are ignored. Upon
return,
3030 'REX[ ] and IMX[ ] contain the DFT output. All signals run from 0
to N%-1.
3040 '
3050 NH% = N%/2-1 'Separate even and odd points
3060 FOR I% = 0 TO NH%
3070 REX(I%) = REX(2*I%)
3080 IMX(I%) = REX(2*I%+1)
3090 NEXT I%
3100 '
3110 N% = N%/2 'Calculate N%/2 point FFT
3120 GOSUB 1000 '(GOSUB 1000 is the FFT in Table 12-3)
3130 N% = N%*2
3140 '
3150 NM1% = N%-1 'Even/odd frequency domain decomposition
3160 ND2% = N%/2
3170 N4% = N%/4-1
3180 FOR I% = 1 TO N4%
3190 IM% = ND2%-I%
3200 IP2% = I%+ND2%
3210 IPM% = IM%+ND2%
3220 REX(IP2%) = (IMX(I%) + IMX(IM%))/2
3230 REX(IPM%) = REX(IP2%)
3240 IMX(IP2%) = -(REX(I%) - REX(IM%))/2
3250 IMX(IPM%) = -IMX(IP2%)
3260 REX(I%) = (REX(I%) + REX(IM%))/2
3270 REX(IM%) = REX(I%)
3280 IMX(I%) = (IMX(I%) - IMX(IM%))/2
3290 IMX(IM%) = -IMX(I%)
-208-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
3300 NEXT I%
3310 REX(N%*3/4) = IMX(N%/4)
3320 REX(ND2%) = IMX(0)
3330
-209-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
Intro to
MATLAB & Simulink
The MATLAB Student Version, available from MathWorks, is a full-
version of MATLAB and includes Simulink and the DSP toolbox. It is
available at: http://www.mathworks.com/products/studentversion/
1. Start up MATLAB. You’ll get the MATLAB Desktop
2. Start upS imulink by pressing the button SIMULINK LIBRARY in
the desktop. You get the Simulink Library Browser.
-210-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
3. If you’ve an old version of MATLAB, you may type at the MATLAB prompt
>> simulink .
You’ll also get a similar Simulink Library
4. From the New menu, select New Simulink Model. If you’ve an old version of
MATLAB, you select, New Model from the file menu. A Model window opens as
follows.
5. Now we can start building and testing our model. For instance, we can build a
QPSK modulator.
-211-
Prof. Dr. Muhammad El-SABA
Analog and Digital Signal Processing Appendices
-212-
Prof. Dr. Muhammad El-SABA