Chapter 1 Slides
Chapter 1 Slides
Chapter 1 Slides
Systems
1
Discrete Time Signals and Systems
Outline
Introduction
Discrete-time signals
Common DT signals
Classification of signals
Discrete-time systems
Classification of systems
Linear time-invariant (LTI) systems
Convolution
Properties of LTI systems
Linear constant coefficient difference equations (LCCDEs)
2
Introduction
Definition
Digital signal processing (DSP) is the use of digital processor such as
computer to analyse and manipulate digital signal in order to perform a
wide variety of operations.
The signals are discrete and represented as a sequence of numbers that
represent samples of a continuous variable in a domain such as time,
space, or frequency.
Video https://youtu.be/R90ciUoxcJU
3
Introduction
Advantages of DSP over conventional analog methods:
Perfect reproducibility, i.e., digital signals can be copied repeatedly
without degrading signal quality
No drift in performance with temperature or age
Greater reliability and lower power consumption due to advances in
semiconductor technology
Greater reusability as digital systems can often be reprogrammed
without modifying the hardware
Disadvantages of DSP:
Higher fabrication cost especially in the case of broadband frequencies
(above 100MHz)
Finite wordlength problem, i.e., limited bits in number representation,
resulting in performance degradation
4
Introduction
A signal is a function or variable that represents information
A signal stores measurable, physical quantity that varies
Examples: heartbeat signal, stock price, speech and engine
vibration signal
Examples: Biomedical signals, radio waves, weather conditions
(e.g. temperature, rainfall, wind speed), stock exchange movement
Speech signal
voltage (V)
t, time (s)
5
Discrete-time Signals
As signals are generally continuous, these signals have to be
converted to the digital form before being introduced into DSP
systems
A preliminary step to this process is the sampling process in which
the original continuous-time signal is converted to the discrete-
time counterpart
This is performed through sampling the continuous-time signal at
regular intervals (or sampling period or sampling interval T)
T is the inverse of sampling frequency fs: T = 1/fs
6
Example 1: CT to DT conversion
Convert the continuous-time signal x(t) to the discrete-time
signal x(n) using a sampling period of 125 µs.
Solution:
7
Discrete-time Signals
Discrete-time (DT) signal is a digital signal obtained from
sampling a continuous-time signal
DT signal is a function of time
E.g. speech, music, stock price
DT signal is not continuous and is defined only at discrete
times, thus the independent variable n has discrete values
Discrete-time signals are typically represented as sequences of numbers
Example:
Unlike continuous-time signals, one cannot tell the rate at which discrete-
time signals are changing unless the sampling period is also specified
8
Discrete-time Signals
Common DT signals
Unit impulse function
e. g. : 0 = 1, 2 =0
9
Discrete-time Signals
Common DT signals
Exponential function x(n) = an
Converges with increasing n if a < 1
Diverges with increasing n if a > 1
Sinusoidal function
x(n) = sin (Ωn + ϕ)
10
Discrete-time Signals
Shifted unit impulse
-2
11
Discrete-time Signals
Shifted unit step
-2
12
Discrete-time Signals
Simple relationships
u[n]
n
0
u[n − 1]
n
0 1
δ[n]
n
0
13
Discrete-time Signals
General equation for DT sequence:
...
14
Example 2: Sketching Signal
sketch x(n).
x(n)
15
Discrete-time Signals
Classification of signals
Finite-length
x[n] = 0, n < N1 and n > N2
16
Discrete-time Signals
Classification of signals
17
Discrete-time Signals
Classification of signals
Further reading: Solved Problems 1.1, 1.2, 1.3, 1.4, 1.7, 1.11 of Schaum’s
Outlines Digital Signal Processing.
18
Discrete-time Systems
A discrete-time system transforms an input discrete-
time signal and produces an output discrete-time
signal.
The system output y[n] is a function of the system input x[n], i.e.,
y[n] = F(x[n]) where F represents the transform function.
19
Discrete-time Systems
Classification of systems
Memoryless
A system is memoryless if the output at time n depends only on the
input at the same time n
Examples:
Memoryless
Not memoryless
Causality
A system is causal if the output depends only on the present and past
inputs
Examples:
Causal
Non-causal
20
Discrete-time Systems
Classification of systems
Stability
A system is stable in the bounded-input and bounded-output (BIBO)
sense if every bounded input produces a bounded output
Systems that are unstable can produce unbounded output even if the
input is bounded
Showing BIBO stability requires us to show that every bounded input
produces a bounded output
To show the opposite (instability), it is sufficient to only find one
bounded input that produces an unbounded output
Example:
Stable
21
Discrete-time Systems
Classification of systems
Linearity
A linear system exhibits the additive and scaling properties
Additive property:
22
Discrete-time Systems
Classification of systems
Linearity
A linear system exhibits the additive and scaling properties
Scaling property:
23
.
Example 3: Linearity
y[n] = 3e− x[ n]
24
Discrete-time Systems
Classification of systems
Time or Shift Invariance:
A system is time-invariant (or shift-invariant) if, for any delay, the
output of the system for the shifted input is the same output shifted by
the same delay
x[n − n0]
x[n] z−mn0 F(·) F(x[n − n0]) These outputs
are the same if
the system is
y[n]
x[n] F(·) z−mn0 y[n − n0] time-invariant
25
Discrete-time Systems
Time or Shift invariance:
If input sequence x1(n) is shifted by n0, then the corresponding output
y1(n) will also be shifted by n0
Further reading: Solved Problems 1.12, 1.14, 1.15, 1.16, 1.17, 1.18,1.19,
1.20, 1.21, 1.23 of Schaum’s Outlines Digital Signal Processing.
26
Example 4: Time Invariance
y[n] = 3e − x[ n]
27
Linear Time-invariant Systems
Definition
The linear time-invariant (LTI) system is both linear and
time-invariant
To facilitate the discussion of LTI systems, it is useful to
define the system impulse response
The impulse response h[n] is the system output given the
impulse input δ[n]
δ[n] h[n]
F(·)
n n
0 0
The impulse response h[n]
plays an important role in
defining LTI systems
28
Linear Time-invariant Systems
The impulse response h[n] is the system output given the impulse input δ[n]
012
[ −δ[n]
1] ℎ[ −h[n]
1] h[n] =[0 1 2 1 1 2 1.3]
F(·)
n n
0 0120
01
Example:
0ℎ + 1 ℎ −1 +
2ℎ −2 + 3 ℎ −3
29
Convolution
Convolution and LTI Systems
The output of an LTI system is the convolution of the input and the
impulse response
30
Convolution
Properties of convolution
31
Convolution
Convolution using table method
y(n) = x(n) * h(n),
32
Convolution
Using MATLAB function conv( )
% code
h=[3 2 1]
x=[3 1 2]
y = conv(h,x)
% Result
y=
9 9 11 5 2
33
Example 5: Convolution
h[−k] x[k] x[k]h[−k] h[n]=[… 0 1 2 -1 1 1 -1 0 …]
2 x[n]=[… 0 1 -1 2 1 0 …]
1
k × k = k 1×1 = 1 = y[0]
−1
y[n]
h[1 − k] x[k] x[k]h[1 − k]
2×1 + 1×(−1) 1 1
k × k = k = 1 = y[1]
n
−1 −1
h[2 − k] x[k] x[k]h[2 − k]
(−1)×1 + 2×(−1)
k × k = k + 1×2 = −1 = y[2]
...
k × k = k (−1)×1 = −1 = y[8]
34
h[n]=[… 0 1 2 -1 1 1 -1 0 …]
x[n]=[… 0 1 -1 2 1 0 …]
n -3 -2 -1 0 1 2 3 4 5 6 7 8
h[n] 1 2 -1 1 1 -1
x[-n] 1 2 -1 1 y[0] = 1
x[1-n] 1 2 -1 1 y[1] = 1
x[2-n] 1 2 -1 1 y[2] = -1
x[3-n] 1 2 -1 1 y[3] = 7
x[4-n] 1 2 -1 1 y[4] = 0
x[5-n] 1 2 -1 1 y[5] = -1
x[6-n] 1 2 -1 1 y[6] = 4
x[7-n] 1 2 -1 1 y[7] = -1
x[8-n] 1 2 -1 1 y[8] = -1
35
Convolution
Analytical convolution, with examples
36
Convolution
37
Convolution
38
Convolution
Further reading: Solved Problems 1.27, 1.29, 1.30, 1.31, 1.33, 1.34, 1.35
of Schaum’s Outlines Digital Signal Processing.
39
Properties of LTI Systems
Causality
The LTI system is causal if the impulse response obeys the
following relation
40
Properties of LTI Systems
Stability
The LTI system is stable if the following relation holds
41
Properties of LTI Systems
Causal
& unstable
Causal
& stable
Non-causal
& stable
42
Linear Constant Coefficient Difference Equations
43
Linear Constant Coefficient Difference Equations
The accumulator system
The accumulator, for instance, is a system of this class
In this form, it is possible to compute the output y[n] for any arbitrary
input x[n]; computation-wise, however, this is not the most efficient
representation
In some cases, the output can be expressed in terms of the past
outputs in addition to the current and past inputs
44
Linear Constant Coefficient Difference Equations
This LCCDE form allows us to implement the accumulator system
in a more efficient manner
45
Example 6: LCCDE
Example of LCCDE for a filter
x[n] is the input sequence and y[n] is the resulting output sequence
y (n) = 0.5 x(n) + 0.4 x(n − 1)
Answer
n=1;
y(n) = y(1)
= 0.5 x(1) + 0.4 x(1-1)
= 0.5 (2) + 0.4 (1)
= 1.4
46
Linear Constant Coefficient Difference Equations
The LCCDE has the form
47
Linear Constant Coefficient Difference Equations
For Infinite Impulse Response (IIR) systems
Non-zero coefficients ak and bk exist
Output depends on current input, and previous input and output
IIR system is a form of digital filter (recursive system)
Example:
Filter coefficients
b0=1, a1= -1
As before, the impulse response of this system (replacing x[n] with δ[n])
49
Frequency-domain Analysis
Outline
Introduction
Discrete-time Fourier Transform (DTFT)
Frequency response of LTI systems
50
Introduction
To understand how frequency arises in signal analysis,
consider the following continuous-time sinusoids
= sin(2 ) = sin(ω )
x1(t)
t
0 0.02
x2(t)
t
0
x3(t)
t
0
51
Introduction
The previous 3 signals can be combined to produce a
new signal
10 -4
0 1000 2000 3000 4000 5000 6000 7000 8000
Frequency
53
Discrete-time Fourier Transform (DTFT)
Signal transformation
A signal in the time domain can be transformed to the frequency
domain and then transformed back to the time domain
Forward Fourier transform is used to convert a signal representation
from the time domain to the frequency domain
Inverse Fourier transform is used to convert a signal representation
from the frequency domain to the time domain
54
Discrete-time Fourier Transform (DTFT)
Fourier transform for discrete-time (DT) signals is
known as the discrete-time Fourier transform (DTFT)
2πf
ω = 2πf ; Ω = = ωT
fs
f s = Sampling frequency
1
T = = Sampling period
fs
55
Discrete-time Fourier Transform (DTFT)
The periodicity of the Fourier spectrum
Example: Rectangular Pulse
!"
X(X(Ω))
Ωn Ω
X( )
Ω
Ω
56
Discrete-time Fourier Transform (DTFT)
The periodicity of the Fourier spectrum
Since the spectrum is periodic with period 2π hence the spectrum
is completely specified over an interval of the period, e.g., [0, 2π]
or [–π, π]
Loosely speaking, the region where the radian frequency Ω is near
0 is the low frequency region and the region near π (or –π) is the
high frequency region
|X( )|2
(.wav)
Further reading: Solved Problems 2.6, 2.7, 2.8, 2.9, 2.10, 2.20 of
Schaum’s Outlines Digital Signal Processing.
57
Discrete-time Fourier Transform (DTFT)
Properties of DTFT
X( ), Y( )
aX( ) + bY( )
& '( X( )
' x[n] ( & )
( X( ( )
X( & )
X( )
#Ω*%
#Ω
X( )Y( )
Y( ))
58
Discrete-time Fourier Transform (DTFT)
Properties of DTFT
X( )
59
Discrete-time Fourier Transform (DTFT)
Common DTFT pairs
X( )
& '(
Ω+
(
' Ω − Ω0
& -jΩ
Ω+
1 − e
&
1 − ,
(1 − , &
)2
sinΩ- n |Ω| Ω-
+( )
Ω- |Ω|
sinΩ & //0
sinΩ/2
60
Discrete-time Fourier Transform (DTFT)
Example: DTFT
61
Example 7: DTFT
62
63
Frequency Response of LTI Systems
The impulse response h[n] describes DT system
behavior in time domain
The DTFT of the system impulse response gives the
frequency response of the system
2(Ω) = 3454(ℎ )
DTFT
H(Ω)
h[n]
π/2
64
Frequency Response of LTI Systems
The frequency response of LTI systems is simply the
DTFT of the impulse response h[n]
& '
H( ) =
H(e jω)) exists only if h[n] is absolute summable and,
As before, H(
H( jω)) is also periodic with period 2π
since this is a DTFT, H(e
Like the impulse response, the frequency response H( H(e jω))
completely characterizes the LTI system
Conversely, the impulse response can be obtained
from the frequency response by the IDTFT
H( ) ' dΩ
65
Frequency Response of LTI Systems
Time-domain convolution, which is central in all LTI
systems, has a particularly appealing and elegant
counterpart in the frequency-domain
Y( ) = X( ) H( )
Y( ) = X( ) H( )
66
Frequency Response of LTI Systems
& '
9 = [*]ℎ[ − *]
& '
Hence, if time-
domain convolution
proves a tad too
difficult to perform,
& ' you can always turn
9 =
to using spectral
multiplication as an
alternative
Further reading: Solved Problems 2.21, 2.22, 2.23, 2.26, 2.27, 2.28, 2.32 of
Schaum’s Outlines Digital Signal Processing.
67
Chapter 1: Discrete-time Signals &
Systems
68
DSP for Continuous-time Signals
Outline
69
DSP System Overview
The discrete-time processing of continuous-time signals,
for the most part, involves the continuous-to-discrete
(C/D) conversion at the system input and discrete-to-
continuous (D/C) conversion at the output
70
C/D Conversion
The C/D conversion consists of the following steps
The sampling process in which the input signal xc(t) is modulated
by the impulse train s(t); the modulated signal xm(t) is made up of
impulses at regular intervals T in time
The zero-order-hold (ZOH) and analog-to-digital (A/D) units then
convert the modulated signal xm(t) to the desired xd[n]
Recall that the discrete-time signal xd[n] contains
no information about the sampling period T
71
C/D Conversion
Sampling process in time-domain
The sampling process is parameterized by the sampling period T
or the sampling frequency fs
Not surprisingly, with different values of T, different sets of
samples are obtained from the same CT signal
72
C/D Conversion
Sampling process in time-domain
73
C/D Conversion
Sampling process in frequency-domain
The Fourier spectrum of the modulated signal Xm(ω) consists of
periodically repeated copies of Xc(ω) at integer multiples of the
sampling frequency ωs
74
C/D Conversion
S(jω)
S(ω) = δ (ω - kωs)
Xm(ω) = δ (ω - ξ - kωs) dξ
Xc(ξ)δ (ω - ξ - kωs) dξ
Xc(ω - kωs)
ω
-ωs ωs
Xm(ω) = Xc(ω)∗S(ω)
ω
Ω
0 ωΩNN Ωs
ωs
ω ωss −- ω
((Ω ΩNN)
-ωs -ωN ωN ωs
(ωs - ωN)
ωs - ωN ≥ ωN
76
C/D Conversion
Sampling process in frequency-domain
Xcc((Ω)
ω)
ω
Ω
-−Ω
ωNN 0 Ω
ωNN
ω)
S(Ω)
S(
ω
Ω
ωs s
-−Ω 0 ωss
Ω
ω
ω)
XXmm((Ω) ωN ωs
(ωs - ωN)
The spectrum overlaps
if the sampling rate is
ω
Ω chosen too small!
ωs s
-−Ω 0 ωs
Ω
77
Spectrum of Sampled Signal
78
Example 8: Spectrum of Sampled Signal
79
a.
80
b.
81
C/D Conversion
The Nyquist (or Shannon) Sampling Theorem
Choosing the sampling frequency ωs too small results in the copies
of Xc(ω) overlapping and one can no longer retrieve the original
spectrum; signal distortion arising from this phenomenon is called
aliasing
The Nyquist sampling theorem states that if xc(t) is strictly
bandlimited or
(ω) |ω| ωN
then xc(t) can be uniquely recovered from the samples xd[n] = xc(nT) if
ωs ωN
For a uniformly sampled DSP system, an analog signal can be
perfectly recovered as long as the sampling rate ωs is at least twice as
large as the highest-frequency component ω(max) of the analog signal to
be sampled
ωs ≥ 2ω(max)
82
C/D Conversion
Aliasing Problem
83
Example 9: Shannon Sampling Theorem
Question 1
Suppose you need to digitize an analog speech signal containing
frequencies up to 4 kHz, what is the minimum sampling rate ?
Question 2
Suppose you have decided to use a sampling frequency of 5000
Hz or 5000 samples/sec. What is the maximum analog signal
frequency that is allowed in order to ensure the analog signal can
be reconstructed back exactly? Aliasing noise must be avoided.
f (max) = f s / 2 = 2500 Hz
84
C/D Conversion
The A/D process, in the frequency-domain
The spectrum of the discrete-time signal xd[n] resembles that of
(continuous-time) signal xm(t) except for the change of the
frequency variable
2πf
ω)
XXmm((Ω) ω = 2πf ; Ω = = ωT
fs
f s = Sampling frequency
1
ω
Ω T = = Sampling period
ωs
-−Ωs 0 ωΩs
s
fs
XXd(e jΩjω
d (e ) )
jΩ)
ωsΩ
Xd (e
Ω
ω
−2π 0 2π
86
D/C Conversion
The low pass reconstruction filter smoothen the signal
from DAC
87
D/C Conversion
The reconstruction process, in the frequency-domain
Ys(ω)
-ωs -ωN ωN ωs
ω
(ωs - ωN)
Hr(ω) This denotes the cutoff
frequency of the
reconstruction filter
ω
-ωr ωr
Yc(ω) = Ys(ω)Hr(ω)
-ωN ωN
ω ωN ≤ ωr ≤ ωs - ωN
88