You are on page 1of 28

ECE 3331b

Introduction to Signal Processing


Lecture 7

Instructor: Dr. Ilia G. Polushin

Department of Electrical & Computer Engineering

Faculty of Engineering

The University of Western Ontario

Winter 2017
Schedule: Laboratories
Matlab tutorials: January 23rd January 27th

4 Lab sessions:

Lab 1: January 30th February 3rd


Lab 2: February 13th February 17th
Lab 3: March 13th March 17th
Lab 4: March 27th March 31st

Location: SEB 1004

Reports are due one week after the lab session. To be submitted to locker #
206, 2nd floor of TEB
Schedule: Laboratories

Lab Schedule by Section:

Section 003: Tuesday 9:30 a.m. 12:30 p.m. TAs: Farid, Anastasiia

Section 004: Thursday 4:30 p.m. 7:30 p.m. TAs: Soulaimane, Yousef
Section 005: Friday 12:30 p.m. 3:30 p.m. TAs: Samantha, Hessam
Section 006: Wednesday 2:30 p.m. 5:30 p.m. TAs: Samantha, Hessam

Section 007: Wednesday 11:30 a.m. 2:30 p.m. TAs: Farid, Anastasiia
Section 008: Monday 2:30 p.m. 5:30 p.m. TAs: Soulaimane, Yousef
Numerical Computation of Convolution
Convolution sum:
+1
X
y(n) = x(k)h(n k) (CS).
k= 1

Suppose x(k) and h(k) are finite duration sequences:


i) x(k) 6= 0 only for N1 k N2 ;
ii) h(k) 6= 0 only for M1 k M2 .

Formula (CS) implies that:


a) y(n) 0 for n < N1 + M1 .
Proof: if n N1 < M1 , then for each k N1 we have n kn N1 < M1 which implies
h(n k) = 0.
b) y(n) 0 for n > N2 + M2 .
Proof: if n N2 > M2 , then for each k N2 we have n k n N2 > M2 which implies
h(n k) = 0.

Therefore, y(n) 6= 0 is only possible for N1 + M1 n N2 + M2 .


Numerical Computation of Convolution
Convolution sum:
+1
X
y(n) = x(k)h(n k) (CS).
k= 1

Example: Suppose x(k) and h(k) are finite duration sequences:


i) x(k) 6= 0 only for 0 k 5;
ii) h(k) 6= 0 only for 0 k 2.

Formula (CS) can be written in the form:


2 3 2 3
y(0) x(0) 0 0
6 7 6 7
6y(1)7 6x(1) x(0) 0 7
6 7 6 7
6y(2)7 6x(2) x(1) x(0)7 2 3
6 7 6 7 h(0)
6y(3)7 6x(3) x(2) x(1)7
6 7 6 76 7
6 7=6 7 4h(1)5 . (M AT RIX CS)
6y(4)7 6x(4) x(3) x(2)7
6 7 6 7
6y(5)7 6x(5) x(4) x(3)7 h(2)
6 7 6 7
6 7 6 7
4 y(6) 5 4 0 x(5) x(4) 5
y(7) 0 0 x(5)

The matrix form of convolution sum involves a matrix where elements along each diagonal
are the same. Matrices of this type are called Toeplitz matrices.
Numerical Computation of Convolution

Problem: Determine the response of the system with impulse response h(n) to the input signal
x(n), where
h(n) = {1, 2, 1, 1} , x(n) = {1, 2, 3, 1} .
" "
Solution: y(n) 6= 0 is only possible for 1 n 5. We have
2 3 2 3 2 3 2 3
y( 1) x(0) 0 0 0 1 0 0 0 1
6 y(0) 7 6x(1) 0 7 3 6 07 6 47
6 7 6 x(0) 0 72 62 1 0 72 3 6 7
6 7 6 7 h( 1) 6 7 1 6 7
6 y(1) 7 6x(2) x(1) x(0) 0 76 63 2 1 07 6 6 87
6 7 6 7 6 h(0) 7
7 6 76 7
27 6 7
6 y(2) 7 = 6x(3) 7 7=6 17 7=6 87
6 7 6 x(2) x(1) x(0)7 6
4 5 61 3 2 76 15 6 7.
6 7 6 7 h(1) 6 74 6 7
6 y(3) 7 6 0 x(3) x(2) x(1)7 60 1 3 27 6 37
6 7 6 7 h(2) 6 7 1 6 7
4 y(4) 5 4 0 0 x(3) x(2) 5 40 0 1 35 4 25
y(5) 0 0 0 x(3) 0 0 0 1 1
Topic 2: Discrete-Time Signals and Systems

Discrete-Time Signals

Discrete-Time Systems

Analysis of Discrete-Time Linear Time-Invariant (LTI) Systems

Discrete-Time Systems Described by Dierence Equations

Implementation of Discrete-Time Systems


Impulse Response of Causal LTI Systems
For a causal LTI system, the impulse response satisfies

h(i) 0 for i < 0.

Two types of causal LTI systems:

Systems with finite-duration impulse response (FIR systems): there exists a finite number
M such that
h(i) = 0 for all i M ;

Systems with infinite-duration impulse response (IIR systems): no such number M exists.

The convolution formula for a causal FIR system has a form


M
X1
y(n) := h(k)x(n k),
k=0

The output y(n) of a causal FIR system is uniquely determined by M input samples x(n), x(n 1),
. . . , x(n M + 1). Thus, causal FIR system is said to be a system with finite memory.
The output y(n) of a causal IIR system is uniquely determined by infinite number of input samples
x(n), x(n 1), . . . . Thus, IIR system is said to be a system with infinite memory.
Recursive vs. Nonrecursive DT Systems
The convolution formula for a causal FIR system:
M
X1
y(n) := h(k)x(n k). (F IR)
k=0

Implementation of (FIR) requires finite number of multiplications and additions, and


finite number of memory locations.
Causal FIR systems can be implemented directly according to the formula (FIR).

The convolution formula for a causal IIR system:


+1
X
y(n) := h(k)x(n k). (IIR)
k=0

Implementation of (IIR) requires infinite number of multiplications and additions,


and infinite number of memory locations.
Causal IIR systems cannot be implemented directly according to the formula (IIR).
Recursive vs. Nonrecursive DT Systems

Example: Accumulator
n
X
y(n) = x(k) = x(n) + x(n 1) + x(n 2) + . . . ()
k= 1

The computation of y(n) according to the formula (*) requires the storage of all the input
samples x(k), 0 k n 1. ) Memory requirements grow with time.

Note that
n
X1
y(n 1) = x(k) = x(n 1) + x(n 2) + . . .
k= 1

therefore, (*) can be rewritten as follows


n
X1
y(n) = x(k) + x(n) = y(n 1) + x(n). ()
k= 1

The computation of y(n) according to the formula (**) requires the storage of y(n 1) only.
This is an example of a recursive system.
Recursive vs. Nonrecursive DT Systems

Example: Cumulative average system:


n
!
1 X
y(n) = x(k) , n = 0, 1, . . . ()
n+1
k=0

We have !
n
X1
1
y(n 1) = x(k) , n = 0, 1, . . . ,
n
k=0

and
n
! n
! !
1 X n 1 X1 n 1
n
X1 n 1
x(k) = x(k) + x(n) = x(k) + x(n)
n+1 n+1 n n+1 n n+1 n
k=0 k=0 k=0

therefore, the system (*) can be rewritten in recursive form, as follows


n 1
y(n) = y(n 1) + x(n) ()
n+1 n+1

The computation of y(n) requires the storage of y(n 1) only.


Recursive vs. Nonrecursive DT Systems

Example: Cumulative average system:


n 1
y(n) = y(n 1) + x(n) ()
n+1 n+1

In the above equation, the value y(n 1) is called the state (or initial conditions) of the
system (*).
State of a system summarizes all relevant information about the history of the system; in
particular, it summarizes the eect of all previous inputs.
Recursive vs. Nonrecursive DT Systems

General form of a FIR causal nonrecursive system:

y(n) = F [x(n), x(n 1), . . . , x(n M )]

General structure:
Recursive vs. Nonrecursive DT Systems

General form of a causal recursive system:

y(n) = F [y(n 1), y(n 2), . . . , y(n N ), x(n), x(n 1), . . . , x(n M )]

General structure:
Systems Described by Linear Constant-Coefficient
Difference Equations

General form:
N
X M
X
y(n) = ak y(n k) + bk x(n k)
k=1 k=0

Equivalent form:
N
X M
X
ak y(n k) = bk x(n k), a0 = 1.
k=0 k=0

The integer N is called the order of the dierence equations (system).


Systems Described by Linear Constant-Coefficient
Difference Equations

Example:
y(n) = ay(n 1) + x(n)

Solution:

y(0) = ay( 1) + x(0),


y(1) = ay(0) + x(1) = a2 y( 1) + ax(0) + x(1)
y(2) = ay(1) + x(2) = a3 y( 1) + a2 x(0) + ax(1) + x(2)
.. ..
. .

P
n
y(n) = an+1 y( 1) + ak x(n k)
k=0

Zero-input response Zero-state response


(natural response, free response) (forced response)
Systems Described by Linear Constant-Coefficient
Difference Equations

Overall Response:
n
X
y(n) = an+1 y( 1) + ak x(n k)
k=0

Zero-input response
(natural response, free response)

Zero-Input (Natural, Free) Response:

is obtained by setting the input signal to zero (x(n) 0)


depends on systems properties and initial condition (initial state) y( 1)
does not depend on input
Systems Described by Linear Constant-Coefficient
Difference Equations
Overall Response:
n
X
y(n) = an+1 y( 1) + ak x(n k)
k=0

Zero-state response
(forced response)

Zero-State (Forced) Response:

is obtained by setting the initial condition (initial state)


to zero (y( 1) = 0)
depends on systems properties and the input signal
does not depend on initial state
Systems Described by Linear Constant-Coefficient
Difference Equations

For a system described by linear constant-coefficient dierence equa-


tions of a general form
N
X M
X
ak y(n k) = bk x(n k), a0 = 1, ()
k=0 k=0

the solution is also a sum of zero-input (natural) and zero-state (forced)


responses,
y(n) = yzi (n) + yzs (n)

For a system of order N (such as (*)), zero-input response depends on initial


conditions y( 1), y( 2), . . ., y( N ).
Linearity of recursive systems
A system is called linear if it satisfies the superposition principle; otherwise, the system
is nonlinear.
Given two arbitrary input sequences x1 (n), x2 (n), suppose the responses of an initially relaxed
(i.e., with zero initial condition) system to these inputs are y1 (n) and y2 (n), respectively:

x1 y1
T

x2 y2
T
The system is linear if and only if its response to input sequence 1 x1 (n) + 2 x2 (n), where
1, 2 R is 1 y1 (n) + 2 y2 (n)

1 x1 (n) + 2 x2 (n) 1 y1 (n) + 2 y2 (n)


T
Linearity of recursive systems
Definition: A causal recursive system

y(n) = F [y(n 1), y(n 2), . . . , y(n N ), x(n), x(n 1), . . . , x(n M )]

is linear if and only if

1. The response of the system is a sum of the zero-input and zero state responses

y(n) = yzi (n) + yzs (n),

where:
the zero-input response yzi (n) depends on initial conditions y( 1), y( 2), . . . , y( N ),
and does not depend on input x(k), k = 0, 1, . . . , n,
the zero-state response yzs (n) depends on input x(k), k = 0, 1, . . . , n, and does not
depend on initial conditions y( 1), y( 2), . . . , y( N )
2. The zero-state response yzs (n) satisfies the superposition principle with respect to inputs
3. The zero-input response yzi (n) satisfies the superposition principle with respect to initial
conditions.

A system described by linear constant-coecient difference equations of the form


N
X M
X
ak y(n k) = bk x(n k), a0 = 1
k=0 k=0

is linear.
Topic 2: Discrete-Time Signals and Systems
Discrete-Time Signals

Discrete-Time Systems

Analysis of Discrete-Time Linear Time-Invariant (LTI) Systems

Discrete-Time Systems Described by Dierence Equations

Implementation of Discrete-Time Systems


Implementation of Discrete-Time Systems

Example: Consider a first-order system

y(n) = a1 y(n 1) + b0 x(n) + b1 x(n 1) (SY S)

System (SYS1) can be considered as a cascade interconnection of two LTI


subsystems:
v(n) = b0 x(n) + b1 x(n 1) (SU B1)
y(n) = a1 y(n 1) + v(n) (SU B2)

This representation leads to direct form I realization structure:


Implementation of Discrete-Time Systems

For cascaded LTI systems, the order of


the subsystem in the cascade can be
changed without changing the overall
response

This leads to direct form II realiza-


tion structure, which has only one
delay element and is more efficient in
terms of memory requirements
Implementation of Discrete-Time Systems

Direct form II realization structure:

w(n) = a1 w(n 1) + x(n)


y(n) = b0 w(n) + b1 w(n 1)
Implementation of Discrete-Time Systems

General recursive LTI system:


N
X M
X
y(n) = ak y(n k) + bk x(n k)
k=1 k=0

Direct form I realization structure:


Implementation of Discrete-Time Systems

General recursive LTI system:


N
X M
X
y(n) = ak y(n k) + bk x(n k)
k=1 k=0

Direct form II realization structure:


Implementation of Discrete-Time Systems
Problem: Consider a system:

y(n) = 0.9y(n 1) 0.2y(n 2) + x(n) 0.5x(n 1).

Determine an implementation of this system that requires the minimum possible amount of mem-
ory and sketch the corresponding block diagram.

Solution:

x(n) y(n) x(n) y(n)

1 1
0.9 z z
1
z 0.9 0.5
0.5
1 1
0.2 z 0.2 z

You might also like