DSP Book
DSP Book
Lecture notes
1
•
Chapter 1 Introduction
2
•
independent variable. A CT signal is called a function x(t) .A
DT signal is called a sequence x[n].
3
•
1.1.3 Analog and Digital signals:
4
•
• An example of a periodic signal is show in Fig. (a).
• Aperiodic signal (nonperiodic): Aperiodic signal does not
repeat itself, as in Fig. (b).
5
•
Odd signal: signals that are symmetric around the horizontal
axis 𝑓(𝑡) = −𝑓(−𝑡).
• Casual signal: signals that are zero for all negative time, as
in Fig. (a).
6
•
• Anticasual signal: signals that are zero for all positive time,
as in Fig. (b).
• Noncasual signal: signals that have nonzero values in both
positive and negative time, as in Fig. (c).
• Finite signal: signal that are defined for only certain values
of time 𝑡1 < 𝑡 < 𝑡2 .
•
7
•
• Infinite signal: signal that are defined for all possible values
of time −∞ < 𝑡 < ∞
Example:
Determine energy and average power of the two signals in
the following figure
Solution:
a) 𝑝𝑎𝑣𝑔 = 0,
b) 𝐸 = ∞
Example:
Determine the power of the following periodic signal.
𝑔(𝑡) = 𝐶 cos(𝜔0 𝑡 + 𝜃)
Solution:
9
•
1 𝑇0 1 𝑇0
𝑃 = ∫ |𝑔(𝑡)|2 𝑑𝑡 = ∫ 𝐶 2 𝑐𝑜𝑠 2 (𝜔0 𝑡 + 𝜃) 𝑑𝑡
𝑇0 0 𝑇0 0
𝐶 2 𝑇0 1 1
𝑃= ∫ ( + cos(2𝜔0 𝑡 + 2𝜃)) 𝑑𝑡
𝑇0 0 2 2
𝐶 2 𝑇0 1 𝐶 2 𝑇0 1
𝑃= ∫ ( ) 𝑑𝑡 + ∫ ( cos(2𝜔0 𝑡 + 2𝜃)) 𝑑𝑡
𝑇0 0 2 𝑇0 0 2
𝐶 2 𝑇0 1 𝐶 2 𝑇0 1
𝑃= ∫ ( ) 𝑑𝑡 + ∫ ( cos(2𝜔0 𝑡 + 2𝜃)) 𝑑𝑡
𝑇0 0 2 𝑇0 0 2
𝐶 2 𝑇0 𝐶2
𝑃= +0=
𝑇0 2 2
10
•
• Multiplication of a function with dirac delta, and time
shifting version.
11
•
1, 𝑡 ≥ 0
𝑢(𝑡) = { .
0, 𝑡 < 0
𝑥(𝑡) = 𝐶𝑒 𝑎𝑡
12
•
1.2.4 Complex exponential
𝑥(𝑡) = 𝐶𝑒 𝑗𝜔0 𝑡
2𝜋
Complex exponential is a periodic signal with period 𝑇0 = 𝜔 ,
0
13
•
𝑥 (𝑡) = 𝐶𝑒 𝑗𝜔0 𝑡 = 𝐶 (cos 𝜔0 𝑡 + 𝑗 sin 𝜔0 𝑡)
1.2.5 Sinusoidal signal
𝑥(𝑡) = 𝐴 cos(𝜔0 𝑡 + ∅)
14
•
15
•
1.2.6 Sinc function
sin 𝑥
𝑠𝑖𝑛𝑐 (𝑥 ) =
𝑥
sin 𝑥
𝑠𝑖𝑛𝑐 (0) = lim =1
𝑥→0 𝑥
Zero crossing at: 𝑥 = 𝑛𝜋
16
•
𝑥(0): Zeroth sample amplitude at the sample number 𝑛 = 0.
𝑥(1): First sample amplitude at the sample number 𝑛 = 1.
𝑥(2):Second sample amplitude at the sample number 𝑛 = 2.
𝑥(3): Third sample amplitude at the sample number 𝑛 = 3.
In general we can represent the DT signal with the following
representation:
𝑥 (𝑛) = ⋯ + 𝑥 (−2)𝛿 (𝑛 + 2) + 𝑥 (−1)𝛿 (𝑛 + 1) + 𝑥 (0)𝛿 (𝑛)
+ 𝑥 (1)𝛿 (𝑛 − 1) + 𝑥 (2)𝛿 (𝑛 − 2) + ⋯
Generally,
∞
𝒙(𝒏) = ∑ 𝒙(𝒌)𝜹(𝒏 − 𝒌)
𝒌=−∞
17
•
1.3.1 Unit impulse and unit step
18
•
1.4 Some useful signal operations
1.4.1 Time shifting
19
•
1.4.2 Time reversal
20
•
1.4.4 Combined time scaling and time shifting
21
•
1.5 Analog to Digital converter (ADC):
• To transform the analog signal into digital signal, the analog
signal is passed through 3 stages as follows:
ADC
Sampling:
• The waveform is then sampled at or above the Nyquist rate
𝑓𝑠 to produce a series of analogue samples or pulses.
22
•
• The sampling is done by multiplying the analog signal by a
train of unit impulses or by a digital unit step function with
sampling period of 𝑇𝑠 .
23
•
• Encoding: This coding process generates a 𝑁 binary bits
for each sample. The minimum number of required bits for
𝑀 quantization levels is:
𝑁 = 𝑙𝑜𝑔2 𝑀
1.6 Systems
• A system is any physical device that performs an operation
on a signal. Such operation is referred to as signal processing.
• A system is characterized by its inputs, outputs (responses)
and mathematical model relying the outputs with inputs.
• Differential equations and s-plane are used to model the CT
system, while difference equations and z-plane are used for
DT systems.
24
•
1.6.1 Classification of DT systems
25
•
Example: which of the following systems is considered
as memoryless system?
𝑦(𝑛) = 𝑥(𝑛)
𝑦(𝑛) = 3𝑥(𝑛) + 𝑥 2 (𝑛)
𝑦(𝑛) = 3𝑥(𝑛) + 4𝑥(𝑛 − 1)
𝑦(𝑛) = 2𝑥(𝑛) + 6𝑥(𝑛 + 2)
Solution:
𝑦(𝑛) = 𝑥(𝑛) (Memoryless)
𝑦(𝑛) = 3𝑥(𝑛) + 𝑥 2 (𝑛) (Memoryless)
𝑦(𝑛) = 3𝑥(𝑛) + 4𝑥(𝑛 − 1) (Not memoryless)
𝑦(𝑛) = 2𝑥(𝑛) + 6𝑥(𝑛 + 2) (Not memoryless)
1.6.1.2 Linear and Non-linear Systems.
• Linear system is the system, where the output due to the
weighted sum inputs is equal to the same weighted sum of
the individual outputs obtained from their corresponding
inputs.
• For Example, if a system outputs:
𝑦1 (𝑛) is the system output corresponding to the input 𝑥1 (𝑛)
𝑦2 (𝑛) is the system output corresponding to the input 𝑥2 (𝑛).
Thus, the system is called linear system if 𝛼𝑦1 (𝑛) +
𝛽𝑦2 (𝑛) is the corresponding output of the input 𝛼𝑥1 (𝑛) +
𝛽𝑥2 (𝑛), otherwise the system is non-linear.
26
•
Example: which of the following systems is considered
as linear system?
𝑦(𝑛) = 𝑥(𝑛)
𝑦(𝑛) = 3𝑥(𝑛) + 𝑥 2 (𝑛)
𝑦(𝑛) = 3𝑥(𝑛) + 4𝑥(𝑛 − 1)
𝑦(𝑛) = 2𝑥(𝑛) + 6𝑥(𝑛 + 2)
𝑦(𝑛) = 𝑙𝑜𝑔10 𝑥(𝑛)
Solution:
𝑦(𝑛) = 𝑥(𝑛) (Linear)
𝑦(𝑛) = 3𝑥(𝑛) + 𝑥 2 (𝑛) (Non-linear)
𝑦(𝑛) = 3𝑥(𝑛) + 4𝑥(𝑛 − 1) (Linear)
𝑦(𝑛) = 2𝑥(𝑛) + 6𝑥(𝑛 + 2) (Linear)
𝑦(𝑛) = 𝑙𝑜𝑔10 𝑥(𝑛) (Non-linear)
(a)
(b)
• Example: which of the following systems is considered as
time invariant system?
A. 𝑦(𝑛) = 2𝑥(𝑛 − 5)
B. 𝑦(𝑛) = 2𝑥(3𝑛)
28
•
29
•
Example: which of the following systems is considered
as time invariant system?
𝑦(𝑛) = 𝑥(𝑛)
𝑦(𝑛) = 3𝑥(𝑛) + 𝑥(2𝑛 − 1)
𝑦(𝑛) = 3𝑥(3𝑛) + 4𝑥(𝑛 − 1)
𝑦(𝑛) = 2𝑥(𝑛) + 6𝑥(𝑛 + 2)
𝑦(𝑛) = 2𝑥(𝑛) + 6𝑥(5𝑛 + 2)
Solution:
𝑦(𝑛) = 𝑥(𝑛) (Time Invariant)
𝑦(𝑛) = 3𝑥(𝑛) + 𝑥(2𝑛 − 1) (Time Variant)
𝑦(𝑛) = 3𝑥(3𝑛) + 4𝑥(𝑛 − 1) (Time Variant)
𝑦(𝑛) = 2𝑥(𝑛) + 6𝑥(𝑛 + 2) (Time Invariant)
𝑦(𝑛) = 2𝑥(𝑛) + 6𝑥(5𝑛 + 2) (Time Variant)
30
•
Example: which of the following systems is considered as
casual system?
𝑦(𝑛) = 𝑥 (𝑛) + 2𝑥(𝑛 − 1) + 4𝑥(𝑛 − 2)
𝑦(𝑛) = 3𝑥(𝑛) + 𝑥 2 (𝑛 + 1) + 𝑥(𝑛 − 2)
𝑦(𝑛) = 3𝑥(𝑛) + 4𝑦(𝑛 − 1)
𝑦(𝑛) = 2𝑥(𝑛) + 6𝑥(𝑛 + 2)
𝑦(𝑛) = 𝑙𝑜𝑔10 𝑥(𝑛 − 2)
Solution:
𝑦(𝑛) = 𝑥(𝑛) + 2𝑥 (𝑛 − 1) + 4𝑥(𝑛 − 2) (Casual)
𝑦(𝑛) = 3𝑥(𝑛) + 𝑥 2 (𝑛 + 1) + 𝑥(𝑛 − 2) (Non-casual)
𝑦(𝑛) = 3𝑥(𝑛) + 4𝑦(𝑛 − 1) (Casual)
𝑦(𝑛) = 2𝑥(𝑛) + 6𝑥(𝑛 + 2) (Non-casual)
𝑦(𝑛) = 𝑙𝑜𝑔10 𝑥(𝑛 − 2) (Casual)
31
•
1.7 Digital signal processing
1.7.1 Basic elements of Digital signal processing system
32
•
purpose digital computer, a microprocessor, advanced
microcontroller, digital circuits such as ASICs, field-
programmable gate arrays, or specialized digital signal
processors (DSP chips).
• DAC: The DAC unit, converts the processed digital signal
to an analog output signal, which is continuous in time and
discrete in amplitude (usually a sample-and-hold signal).
• Reconstruction Filter: The reconstruction filter is designated
as a function to smooth the DAC output voltage levels back
to the analog signal for the real-world applications.
1.7.2 Advantages of digital signal over analog signal.
33
•
1.7.3 Basic Digital Signal Processing Examples
• DIGITAL FILTERING.
• SIGNAL FREQUENCY (SPECTRUM) ANALYSIS.
• Digital Audio and Speech: Digital audio coding such as CD
players, MP3 players, digital crossover, digital audio
equalizers, digital stereo and surround sound, noise
reduction systems, speech coding, data compression and
encryption, speech synthesis and speech recognition.
• Digital telephone: Speech recognition, high-speed modems,
echo cancellation, speech synthesizers, DTMF (dual-tone
multifrequency) generation and detection, answering
machines.
• Automobile Industry: Active noise control systems, active
suspension systems, digital audio and radio, digital controls,
vibration signal analysis.
• Electronic Communications: Cellular phones, digital
telecommunications, wireless LAN (local area networking),
satellite communications.
• Medical Imaging Equipment: ECG analyzers, cardiac
monitoring, medical imaging and image recognition, digital
X-rays and image processing.
• Multimedia: Internet phones, audio and video, hard disk
drive electronics, iPhone, iPad, digital pictures, digital
cameras, text-to-voice, and voice-to-text technologies.
34
•
1.7.4 Application Areas
35
•
Problem set #1
1- Consider the signal x(t) shown in Fig.1, illustrate the following :
a) Advance shift x(t +1) b) Delay x(t-1)
c) Time–reversal x(-t ) d) Time Reversal and shift x(-t +1)
e) Time–Scaling x(3/2t) f) Time–Scaling and shift x (3/2 t + 1)
0
n 2
x (n ) 1 - 2 n 4
0
n 4
• For each of the following signals, determine the value of n for which the
function is equal to zero :
a) x(n – 3) b) x( n + 4) C) x (-n ) d) x (- n + 2) e) x(-n –
2)
• Answer: a) n < 1 and n > 7 b) n < - 6 and n > 0 c) n < - 4 and
n>2
d) n < -2 and n > 4 e) n < - 6 and n > 0
4- Determine whether or not each of the following signals is periodic.
a) x1(n) = u(n) – u(-n)
•
k
b) x 2
(n ) [(n 4k ) (n 1 4k )]
k
36
•
6- Determine the signal energy and power of the following signals :
a) x1 (t) = e-2t u(t) b) x2 (t) = e j(2t + π/4)
c) x3 (t) = Cos t d) x4 (n) = (1/2)n u(n)
e) x5 (n) = ej( π /2n + π/8) f) x6 (n) = Cos ( π n /4)
37
•
38
•
problem set 2
39
•
2 Linear time-invariant
system
2.1 LTI systems
40
•
2.3 DIFFERENCE EQUATIONS AND IMPULSE
RESPONSES
• A causal linear time-invariant system can be completely
described by its difference equation or unit-impulse response.
2.3.1 FORMAT OF DIFFERENCE EQUATION
41
•
2.3.2 SYSTEM REPRESENTATION USING ITS IMPULSE
RESPONSE
42
•
By applying the linearity property, we will got the following
results
= ∑ ℎ(𝑛 − 𝑘)𝑥(𝑘)
𝑘=−∞
where (∗) is the convolution.
43
•
∞
𝑦(𝑡) = 𝑥 (𝑡) ∗ ℎ(𝑡) = ∫ 𝑥 (𝑡 − 𝜏) ℎ(𝜏)𝑑𝜏
−∞
∞
= ∫ ℎ(𝑡 − 𝜏) 𝑥 (𝜏)𝑑𝜏
−∞
Example: Given the linear time-invariant system
𝑦(𝑛) = 0.5𝑥(𝑛) + 0.25𝑥(𝑛 − 1),
A. Determine the unit-impulse response ℎ(𝑛).
B. Draw the system block diagram.
44
•
Example
Solution
45
•
46
•
2.3.3 Notes on convolution process
2.3.4 Causality and stability from the unit impulse response of the
system
47
•
3 Fourier analysis for CT
signals
3.1 Introduction
3.1.1 Sine wave
48
•
3.1.2 Frequency and phase
49
•
3.1.3 Time-domain and frequency domain plots of sine wave
50
•
The above signal can be decomposed into a sumation of 3
sinusoids as shown in the following figure, the amplitude of
each sinusoide is calculated using fourier series
52
•
• For consistency we denote the dc term 𝑎0 by 𝐶0, that is,
𝐶0 = 𝑎0
The trigonometric Fourier series can be expressed in the
compact form of the trigonometric Fourier series as
53
•
Example
Find the exponential Fourier series of the following periodic
wave and plot the spectrum
54
•
3.4 Fourier Transform of Signals
• Fourier Transform: Extracts the frequencies of general
class of signals that are usually aperiodic. In other words, the
Fourier tool transforms the signal from the time domain to
the frequency domain.
• The Fourier Transform, 𝐺(𝑓), of a signal in time domain
𝑔(𝑡) is given by
55
•
Then, the relation between 𝑔(𝑡) and 𝑔𝑇0 (𝑡) is given by,
Where, 𝑇0 is the time period of the periodic signal 𝑔𝑇0 (𝑡). The fourier
coeffecients of the periodic signal 𝑔𝑇0 (𝑡) can be expressed as
𝑇0
1 1 ∞
𝐷𝑛 = ∫2
𝑇 𝑔𝑇0 (𝑡) 𝑒 −𝑗𝑛𝜔0𝑡 dt = ∫−∞ 𝑔(𝑡) 𝑒 −𝑗𝑛𝜔0 𝑡 dt, and
𝑇0 − 0 𝑇0
2
𝑔𝑇0 (𝑡) = ∑∞
−∞ 𝐷𝑛 𝑒
𝑗𝑛𝜔0 𝑡
1
Then we have, 𝐷𝑛 = 𝐺(𝑛𝜔0 ), and
𝑇0
∞
𝐺(𝑛𝜔0 ) 𝑗𝑛𝜔 𝑡
𝑔𝑇0 (𝑡) = ∑ 𝑒 0
𝑇0
−∞
56
•
Then,
∆𝜔
𝑔(𝑡) = lim 𝑔𝑇0 (𝑡) = lim ∑∞
−∞ 𝐺(𝑛∆𝜔)𝑒
𝑗𝑛∆𝜔𝑡
𝑇0→∞ ∆𝜔→0 2𝜋
Then,
1 ∞
𝑔(𝑡) = ∫ 𝐺(𝜔)𝑒 𝑗𝜔𝑡 𝑑𝜔
2𝜋 −∞
57
•
58
•
3.4.2 Fourier transform of some useful signals
59
•
Example: Find the Fourier transform of 𝑔(𝑡) =
𝛱(𝑡/𝜏 )
Solution
60
•
Bandwidth of 𝜫(𝒕/𝝉):
• The spectrum 𝑮(𝒇) in the following Figure peaks at f =0 and
decays at higher frequencies. Therefore, 𝜫(𝒕/𝝉 ) is a
lowpass signal with most of its signal energy in lower
frequency components.
• Signal bandwidth is the difference between the highest
(significant) frequency and the lowest (significant)
frequency in the signal spectrum.
• Because the spectrum extends from 0 to ∞, the bandwidth is
∞ in the present case. However, much of the spectrum is
concentrated within the first lobe (from 𝒇 = 𝟎 to 𝒇 = 𝟏/𝝉 ),
and we may consider 𝒇 = 𝟏/𝝉 to be the highest
(significant) frequency in the spectrum.
• Therefore, a rough estimate of the bandwidth of a
rectangular pulse of width 𝝉 seconds is 𝟐𝝅/𝝉 rad/s, or B =
1/τ Hz.
61
•
Example: Find the inverse Fourier transform
of 𝐺(𝑓) = 𝛿(𝑓 )
62
•
Example: Find the Fourier transforms of the
everlasting sinusoid 𝑐𝑜𝑠 2𝜋𝑓0𝑡.
• The spectrum of 𝒄𝒐𝒔 𝟐𝝅𝒇𝟎𝒕 consists of two impulses at 𝒇𝟎
and −𝒇𝟎 in the 𝒇 −domain.
63
•
Table1 Fourier transform of some useful signals
64
•
3.4.3 Properities of Fourier transform
65
•
3.4.3.2 Duality Property:
• The duality property states that if
𝑔(𝑡) ⇐⇒ 𝐺( 𝑓 )
• Then
𝐺(𝑡) ⇐⇒ 𝑔(−𝑓 )
• The duality property states that if the Fourier transform of
𝑔(𝑡) is 𝐺( 𝑓 ), then the Fourier transform of 𝐺(𝑡) , with
𝑓 replaced by 𝑡, is 𝑔(−𝑓 ), which is the original time domain
signal with 𝑡 replaced by −𝑓 .
• Example
66
•
3.4.3.3 Time-Scaling Property:
• The time-scaling property states that time compression of a
signal results in its spectral expansion, and time expansion
of the signal results in its spectral compression. Thus, If
𝑔(𝑡) ⇐⇒ 𝐺( 𝑓 )
• then, for any real constant 𝑎,
67
•
• Intuitively, we understand that compression in time by a
factor a means that the signal is varying more rapidly by the
same factor.
• To synthesize such a signal, the frequencies of its sinusoidal
components must be increased by the factor a, implying that
its frequency spectrum is expanded by the factor a.
• Similarly, a signal expanded in time varies more slowly;
hence, the frequencies of its components are lowered,
implying that its frequency spectrum is compressed.
68
•
3.4.3.4 Time-Shifting Property:
69
•
3.4.3.5 Frequency-Shifting Property:
• Frequency-shifting property states that multiplication of a
signal by a factor 𝑒 𝑗2𝜋𝑓0 𝑡 shifts the spectrum of that signal
by 𝑓 = 𝑓0. Thus, if
𝑔(𝑡) ⇐⇒ 𝐺( 𝑓 )
• then
70
•
3.4.3.6 Convolution Theorem
• The convolution of two functions 𝑔(𝑡) and 𝑤(𝑡), denoted
by 𝑔(𝑡) ∗ 𝑤(𝑡), is defined by the integral
71
•
• then (time convolution)
72
•
Table2 Fourier Transform Properties
73
•
Problems
1- calculate the Fourier transform of
𝑡
a. 𝑥(𝑡) = ∆ (𝜏)
b. x(t)= [et cos0t ]u(t ), 0
c. 𝑥(𝑡) = 𝑒 −𝑎𝑡 𝑢(𝑡)
d. 𝑥(𝑡) = 𝛼𝑠𝑖𝑛𝑐(𝜋𝛼𝑡)
74
•
6- The Fourier transform of the triangular pulse 𝑔(𝑡) in Fig.
1a is given by
Use this information, and the time-shifting and time-scaling properties, to find the Fourier
transforms of the signals shown in Fig. 1b, c, d, e, and f.
Figure 1
75
•
4 Fourier analysis for DT
signals
4.1 Sampling theorem
• The sampling theorem guarantees that an analog signal can
be in theory perfectly recovered as long as the sampling rate,
𝒇𝒔 , is at least twice of the bandwidth of the analog signal to
be sampled, 𝑩 . Otherwise, the signal cannot be
reconstructed (aliasing distortion).
𝒇𝒔 ≥ 𝑵𝒚𝒒𝒖𝒊𝒔𝒕 𝒓𝒂𝒕𝒆,
𝑵𝒚𝒒𝒖𝒊𝒔𝒕 𝒓𝒂𝒕𝒆 = 𝟐𝑩, 𝒇𝒔 = 𝟏/𝑻𝒔
4.1.1 Proof of sampling theorem
76
•
77
•
4.2 Different forms of the Fourier transform
• From the sampling theory, we can conclude that:
1. Sampling in time domain leads to periodicity in
frequency domain and vice versa.
2. The period in the frequency domain equals the
sampling frequency.
• Moreover, using the time-frequency duality property, we can
generalize the sampling rule to be :
“Sampling in one domain (time or frequency) leads to
periodicity in the other domain “
78
•
• The following figure illustrates different forms of Fourier
analysis for continuous and discrete time signals
79
•
• We can conclude that the frequency response of a signal is
the same for all the four cases shown in the above figure. The
difference is in the nature of the signal (discrete or
continuous and periodic or non-periodic).
4.2.1 Discrete Fourier Transform DFT
80
•
sample number. However, in some applications, the signal
frequency content is very useful than the digital signal
samples. The representation of the digital signal in terms of
its frequency component in a frequency domain, that is, the
signal spectrum, needs to be developed.
• The DFT maps a finite-length sequence of N samples in time
domain as shown in the figure to another finite-length
sequence of N samples in frequency domain.
81
•
We note the following points:
• Only the line spectral portion between the frequencies –f /2
s
82
•
• The DFT is widely used in many other areas, including
spectral analysis, acoustics, imaging/video, audio,
instrumentation, and communications systems.
83
•
Fourier series coefficients using one-period N data samples
using DFT formula:
84
•
4.3.1 DFT and zero padding
86
•
4.5 Amplitude, Phase, and Power Spectrum
• The amplitude spectrum is defined as:
87
•
• FFT has many applications like:
1. Spectral Estimation
2. Frequency-Domain Filtering
3. Interpolation
4. Implementation of MCM (multi-carrier modulation) and
OFDM (orthogonal frequency division multiplexing)
communication systems.
88
•
Example 1
89
•
Example 2
100
• The frequency resolution: ∆𝑓 = = 25 𝐻𝑧
4
•
90
•
Amplitude spectrum
Phase spectrum
Power spectrum
91
•
Example3
Example 4
92
•
4.7 SPECTRAL ESTIMATION USING WINDOW
FUNCTIONS
• When we apply DFT to the sampled data in the previous
section, we theoretically imply the following assumptions:
first, the sampled data are periodic to themselves (repeat
themselves), and second, the sampled data is continuous to
themselves and band limited to the folding frequency. The
second assumption is often violated, thus the discontinuity
produces undesired harmonic frequencies. Consider a pure
1-Hz sine wave with 32 samples shown in the following
figure.
93
•
• As shown in the figure, if we use a window size of N=16
samples, which is multiple of the two waveform cycles, the
second window repeats with continuity. However, when the
window size is chosen to be 18 samples, which is not
multiple of the waveform cycles (2.25 cycles), the second
window repeats the first window with discontinuity. It is this
discontinuity that produces harmonic frequencies that are
not present in the original signal. The following figure shows
the spectral plots for both cases using theDFT/FFTdirectly.
94
•
in the original signal. We called such an effect spectral
leakage. The amount of spectral leakage shown in the second
plot is due to amplitude discontinuity in time domain. The
bigger the discontinuity, the more the leakage. To reduce the
effect of spectral leakage, a window function can be used
whose amplitude tapers smoothly and gradually toward zero at
both ends. Applying the window function w(n) to a data
sequence x(n) to obtain the windowed sequence x (n) can be
w
expressed as:
95
•
The following figure illustrates the effect of using a window
function on decreasing discontinuity in time domain, then
decreasing the spectral leakage in frequency domain.
96
•
4.7.1 Example of window functions
97
•
Example 5
98
•
99
•
problems
100
•
101
•
5 The Z-Transform
5.1 The Z-Transform:
• The z-transform is a very important tool in the analysis of
discrete-time system (similar to Laplace for the continuous-
time systems). It also offers techniques for digital filter
design and frequency analysis of digital signals.
• ZT is more general than the FT used for a broader class of
signals, ZT is used for cases in which FT does not converge
(doesn’t exist).
102
•
• Region of convergence (ROC) is the range of values of z for
which x(z) converges to a finite value.
103
•
Example:
Solution:
104
•
5.2 PROPERTIES of the Z-TRANSFORM
105
•
106
•
5.3 INVERSE Z-TRANSFORM
The z-transform of a sequence x(n) and the inverse z-
transform of a function X(z) are defined as, respectively:
107
•
• Eliminate the negative powers of z for the z-transform
function X(z).
• Determine the rational function X(z)/z (assuming it is
proper), and apply the partial fraction expansion to the
determined rational function X(z)/z using the formula in
Table 3.
• Multiply the expanded function X(z)/z by z on both sides of
the equation to obtain X(z).
• Apply the inverse z-transform using table 1.
108
•
109
•
110
•
111
•
5.3.2 Power Series Method
112
•
113
•
5.4 SOLUTION OF DIFFERENCE EQUATIONS
USING THE Z-TRANSFORM
5.4.1 FORMAT OF DIFFERENCE EQUATION
114
•
• where 𝑦(−𝑚), 𝑦(−𝑚 + 1), … , 𝑦(−1) are the initial
conditions.
• If all initial conditions are considered to be zero, The z-
transform of time-shifted sequence can be expressed as:
𝑍(𝑌(𝑛 − 𝑚)) = 𝑧 −𝑚 𝑌(𝑧),
𝑍(𝑥(𝑛 − 𝑚)) = 𝑧 −𝑚 𝑋(𝑧),
𝑌(𝑧)
𝐻 (𝑧) = 𝑋(𝑧).
• By applying the Z-transform to the difference equation, we
get the following relation,
115
•
• The procedure is as follows:
1. Apply z-transform to the difference equation.
2. Substitute the initial conditions.
3. Solve the difference equation in z-transform domain.
4. Find the solution in time domain by applying the
inverse z-transform.
Impulse, Step, and System Responses:
• Impulse Responses: The impulse response h(n) can be
obtained by solving its difference equation using a unit
impulse input 𝜹(𝒏).
𝑦(𝑛) = ℎ(𝑛)
116
•
Example:
Solution:
117
•
• Example:
118
•
• Example:
119
•
120
•
121
•
Example
122
•
• The transfer function H(z) can be factored into the pole-zero
form as:
Example
123
•
Solution
124
•
• If the outmost poles are first-order poles of H(z) and on
the unit circle on the z-plane pole-zero plot, then the
system is marginally stable.
• If the outmost poles are multiple-order poles of H(z) and
on the unit circle on the z-plane pole-zero plot, then the
system is unstable.
• The zeros do not affect the system stability.
125
•
Example of unstable system
126
•
Example: Classify the systems in the following figure in terms of stability.
127
•
Problems
128
•
129
•
130
•
131
•
6 Digital filter design
6.1 Introduction to Digital Filters
• After ADC, the digitized noisy signal 𝑥(𝑛), where 𝑛 is the
sample number, can be enhanced using digital filtering.
• For example, if our useful signal contains low-frequency
components, the high-frequency components above the
cutoff frequency of our useful signal are considered as noise,
which can be removed by using a digital lowpass filter. Then,
we set up the DSP block to operate as a simple digital
lowpass filter.
• After processing the digitized noisy signal 𝑥(𝑛), the digital
lowpass filter produces a clean digital signal 𝑦(𝑛). We can
apply the cleaned signal 𝑦(𝑛) to another DSP algorithm for
a different application or convert it to analog signal via DAC
and the reconstruction filter.
• The digitized noisy signal and clean digital signal,
respectively, are plotted in the above figure, where the top
plot shows the digitized noisy signal, while the bottom plot
demonstrates the clean digital signal obtained by applying
the digital lowpass filter.
• Typical applications of noise filtering include acquisition of
clean digital audio and biomedical signal and enhancement
of speech recording and others.
132
•
Example: Two-band digital crossover
133
•
Example: Interference Cancellation in ECG
134
•
• It is can be observed that the DSP system output is the
weighted summation of the current input value 𝑥(𝑛) and its
past values: 𝑥(𝑛 − 1), … , 𝑥(𝑛 − 𝑀) , and past output
sequence: 𝑦(𝑛 − 1), … , 𝑦(𝑛 − 𝑁).
• The system can be verified as linear, time invariant, and
causal.
• If the initial conditions are specified, we can compute system
output (time response) 𝑦(𝑛) recursively. This process is
referred to as digital filtering.
• In the time domain, the filter output equal to the convolution
between the input and the system transfer function as
𝑦(𝑛) = 𝑥(𝑛) ∗ ℎ(𝑛)
• This can be mapped to the corresponding difference equation
135
•
6.3 Digital Filter Frequency Response
• Frequency response means the reaction (response) of the
system at different frequency ranges.
• To find the system frequency response we substitute 𝑧 =
𝑒 𝐽𝑤𝑡 into the z-transfer function H(z) to acquire the digital
frequency response, which is converted into the magnitude
frequency response and phase response, that is
136
•
Frequency Response properties
1. Periodicity.
(a) Frequency response: 𝐻(𝑒 𝑗Ω ) = 𝐻(𝑒 𝑗(Ω+𝑘2𝜋) ).
(b) Magnitude frequency response: |𝐻(𝑒 𝑗Ω )| = |𝐻(𝑒 𝑗(Ω+𝑘2𝜋) )|.
(c) Phase response: ∠𝐻(𝑒 𝑗Ω ) = ∠𝐻(𝑒 𝑗(Ω+𝑘2𝜋) ).
2. Symmetry.
(a) Magnitude frequency response:|𝐻(𝑒 −𝑗Ω )| = |𝐻(𝑒 𝑗Ω )|.
(b) Phase response: ∠|𝐻(𝑒 −𝑗Ω )| = ∠|𝐻(𝑒 𝑗Ω )|.
137
•
138
•
6.4 Basics Types of Filtering
6.4.1 Low pass filter (LPF)
139
•
6.4.2 High pass filter (HPF)
140
•
6.4.3 Band pass filter (BPF)
141
•
6.4.4 Band stop filter (BSF)
• The band stop (band reject or notch) filter rejects the middle-
frequency components and accepts both the low- and the
high-frequency components.
• ΩpL and ΩsL are the lower passband cutoff frequency and
lower stopband cutoff frequency, respectively
• ΩpH and ΩsH are the upper passband cutoff frequency and
upper stopband cutoff frequency, respectively.
142
•
6.5 FIR & IIR Filter Design
• FIR refers to finite impulse response. FIR filter is
represented by the following input output relationship:
• Thus, the transfer function, which depicts the FIR filter can
be expressed as:
143
•
6.6 Realization of Digital Filters
144
•
• Digital filters described by the transfer function 𝐻(𝑧) may
be generally realized into the following forms:
1. Direct-form I
2. Direct-form II
3. Cascade
4. Parallel
145
•
6.6.2 Direct form II realization
146
•
• Comparison between Direct-form I Realization vs
Direct-form II Realization
• Both realizations require the same number of multipliers.
• The direct-form II realization requires two accumulators,
while the direct-form I requires one accumulators.
• The direct-form II structure reduces number of delay
elements (saving memory). The other benefit relies on the
fixed-point realization, where the filtering process involves
only integer operations.
• The other benefit relies on the fixed-point realization, where
the filtering process involves only integer operations.
Scaling of filter coefficients in the fixed-point
implementation is required to avoid the overflow in the
accumulator.
147
•
• For the direct-form II structure, the numerator and
denominator filter coefficients are scaled separately so that
the overflow problem for each accumulator can easily be
controlled.
148
•
Example:
149
•
150
•
Problems
151
•
7 FIR digital Filter Design
• FIR refers to finite impulse response. FIR filter is
represented by the following input output relationship:
• Thus, the transfer function, which depicts the FIR filter can
be expressed as:
152
•
Thus, using the direct-I form, the filter realization can be like
the shown figure
153
•
154
•
Example 1
Solution:
155
•
156
•
• Figures display the magnitude and phase responses of three-
tap (M=1), in the first figure, and 17 tap (M=8) FIR, in the
second figure, lowpass filters.
• The oscillations (ripples) exhibited in the passband (main
lobe), and stopband (side lobes) of the magnitude frequency
response constitute the Gibbs effect.
• The Gibbs oscillatory is due to the truncation of the infinite
impulse response.
• Using a larger number of the filter coefficients will:
• Produce the sharp roll-off characteristic of the transition
band
• Increase time delay and increase computational complexity
for implementing the FIR filter.
157
•
Example [2]:
158
•
7.2 Designing an FIR Filter using window
• The window method is developed to remedy the undesirable
Gibbs oscillations in the passband and stopband of the
designed FIR filter.
• The FIR filter coefficients for Fourier transform with
Window Method can be expressed as:
Window types:
159
•
Example [3]
160
•
Effect of using different types of window on the filter
transfer function
161
•
Practical FIR design for customer specifications
where 𝒇𝒑𝒂𝒔𝒔 and 𝒇𝒔𝒕𝒐𝒑 are the passband frequency edge and
stop frequency edge.
• The filter length using the Hamming window can be
determined by
162
•
• The passband ripple is defined as:
163
•
Example
164
•
Example
165
•
Example:
166
•
Problems
167
•
8 IIR digital filter design
• IIR refers to infinite impulse response. IIR filter is
represented by the following input output difference
equation:
• Thus, the transfer function, which depicts the IIR filter can
be expressed as:
168
•
Design OF IIR FILTERS
There are different technique to design IIR filter, we will study
three of them:
1 Impulse Invariant Design Method.
2 Frequency Transformation of Lowpass IIR Filter.
3 Bilinear Transformation Design Method
4 Pole-Zero Placement Method.
169
•
8.1 Impulse Invariant Method for IIR Filter Design
170
•
• Solution:
172
•
1. Design a prototype lowpass filter using bilinear
transformation or impulse invariance method.
2. Applying the mapping transformation from the
prototype lowpass Z-plane to the desired filter of z-
plane using the previous equation and the following
table.
Table1 Transformation Table from a Low Pass Digital Filter Prototype to High pass, Band pass, and Band stop filter
Note: the first transformation is the transform of a lowpass filter into another
lowpass filter with different passband and stopband edge frequencies.
173
•
174
•
8.3 Bilinear Transformation (BLT) Design Method
• As we explained the steps of designing IIR filter are
1. transforming digital filter specifications into analog
filter specifications.
2. performing analog filter design.
3. applying BLT.
175
•
2. Perform the prototype transformation using the lowpass
prototype 𝐻𝑃 (𝑠).
176
•
177
•
8.4 Pole-Zero Placement Method for IIR Filter design
• This technique utilizes the effects of the pole-zero placement
on the magnitude response in the z-plane.
• In the z-plane, when we place a pair of complex conjugate
zeros at a given point on the unit circle with an angle, we
will have a numerator factor of (𝑧 − 𝑒 𝑗𝜃 )(𝑧 − 𝑒 −𝑗𝜃 ) in the
transfer function.
• When a pair of complex conjugate poles are placed at a given
point within the unit circle, we have a denominator factor of
(𝑧 − 𝑟 𝑒 𝑗𝜃 )(𝑧 − 𝑟 𝑒 −𝑗𝜃 ) , where 𝑟 is the radius chosen to be
less than and close to 1 to place the poles inside the unit
circle.
• Therefore, we can reduce the magnitude response using zero
placement, while we increase the magnitude response using
pole placement.
179
•
8.4.2 First-Order High Pass Filter Design:
180
•
• where K is a scale factor to adjust the bandpass filter to have
a unit passband gain given by
181
•
• Solution:
182
•
Solution
183
•
Problems
184
•
185
•
References
[1] B.p.Lathi “Signal Processing and Linear Systems”, 2nd edition.
[2] Tan, Li, and Jean Jiang. Digital signal processing: fundamentals and
applications. Academic press, 2018.
186
•