0% found this document useful (0 votes)
2 views

Unit 6 Implementation of discrete-time systems

The document covers the implementation of discrete-time systems, specifically focusing on non-recursive (FIR) and recursive (IIR) systems. It includes definitions, methods for implementation, pseudo code, and C code examples for both types of systems. Additionally, it provides assignments related to block diagrams and impulse response analysis.

Uploaded by

tuanmigi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Unit 6 Implementation of discrete-time systems

The document covers the implementation of discrete-time systems, specifically focusing on non-recursive (FIR) and recursive (IIR) systems. It includes definitions, methods for implementation, pseudo code, and C code examples for both types of systems. Additionally, it provides assignments related to block diagrams and impulse response analysis.

Uploaded by

tuanmigi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

HANOI UNIVERSITY

TRƯỜNG OF SCIENCE
ĐẠI HỌC ANDHÀ
BÁCH KHOA TECHNOLOGY
NỘI
SCHOOL OF INFORMATION AND COMMUNITCATION TECHNOLOGY

UNIT 6
IMPLEMENTATION OF DISCRETE-TIME SYSTEM

Department of Computer Engineering


❑ Contents

1. Implementation of a non-recursive system

2. Implementation of a recursive system

IT 4172 Signal processing Chapter 1. Signal and system 2


❑ Learning Objectives
After completing this lesson, you will have a grasp of the following concepts:

▪ The definition and methods for implementing a non-recursive system.

▪ The definition and methods for implementing a recursive system.

IT 4172 Signal processing Chapter 1. Signal and system 3


1. Non recursive system FIR (Finite Impulse Response)
● Constant-Coefficient Linear Differential Equation:

N M
෍ ak y(n − k) = ෍ bk x(n − k)
k=0 k=0

N = 0: FIR, N > 0: IIR

● Non-recursive system: N = 0

bk M M
y n =෍ x n − k = ෍ h(k)x(n − k)
a
k=0 0 k=0

● Example: M = 1 ⟹ y n = h 0 x n + h(1)x(n − 1)

● Diagram:

IT 4172 Signal processing Chapter 1. Signal and system 4


Pseudo code for system implementation (FIR)

Const
h0 = 0.5; (* Filter coefficients *)
h1 = 0.5; (* calculated based design *)
Var
xn, xnt1, yn: real;
Begin
xnt1 := 0;
Repeat
(* Enter input signal from keyboard*)
Write(Input signal xn = ’);
Readln(xn);
(* Compute output signal *)
yn:= h0 * xn + h1 * xnt1;
(* Delay the signal*)
xnt1 := xn;
Until End;
End.

IT 4172 Signal processing Chapter 1. Signal and system 5


C code for system implementation (FIR)
#include <stdio.h>
#include <stdlib.h>
#define h0 0.5 /* Filter coefficients */
#define h1 0.5 /* calculated based on design */
float xn, xnt1, yn;
void main(void)
{
xnt1 = 0;
while (1)
{
/* Enter input signal from keyboard */
printf("Input signal xn = ");
scanf("%f", &xn);
/* Compute output signal */
yn = h0 * xn + h1 * xnt1;
/* Delay signal */
xnt1 = xn;
}
}

IT 4172 Signal processing Chapter 1. Signal and system 6


Diagram for system implementation FIR
● The general case ℎ(0)
𝑥(𝑛) 𝑦(𝑛)
M
𝐷
y n = ෍ h(k)x(n − k)
ℎ(1)
k=0 𝑥(𝑛 − 1)

𝐷
y(n) = h(0).x(n) + h(1).x(n-1) + … + h(M).x(n-M) ℎ(2)
𝑥(𝑛 − 2)

𝐷
ℎ(𝑀)
𝑥(𝑛 − 𝑀)

IT 4172 Signal processing Chapter 1. Signal and system 7


2. Implementation of IIR (Infinite Impulse Response) system
● N = 1, M = 0:
a0 y n + a1 y n − 1 = b0 x(n)

● Assuming that a0 = 1:
y n = −a1 y n − 1 + b0 x(n)

● Diagram
𝑏0
𝑥(𝑛) 𝑦(𝑛)

D
𝑦(𝑛 − 1)
−𝑎1

IT 4172 Signal processing Chapter 1. Signal and system 8


Implementation of IIR system
● N = M = 1:
a0 y n + a1 y n − 1 = b0 x n + b1 x n − 1

● Assuming that a0 = 1:
y n = −a1 y n − 1 + b0 x n + b1 x n − 1
= −a1 y n − 1 + w(n)

với w n = b0 x n + b1 x n − 1 .
𝑏0 𝑤(𝑛)
● Diagram 𝑥(𝑛) 𝑦(𝑛)

𝐷 𝐷
𝑏1
𝑦(𝑛 − 1)
−𝑎1
IT 4172 Signal processing Chapter 1. Signal and system 9
Implementation of IIR system

𝑤(𝑛)
𝑥(𝑛) 𝑦(𝑛)
N M
෍ ak y(n − k) = ෍ bk x(n − k) 𝐷 𝐷
k=0 k=0
𝑏1 −𝑎1

N
y n =w n −෍ ak y n − k 𝐷 𝐷
k=1 𝑏2 −𝑎2

M
w n =෍ bk x(n − k)
k=0
𝐷 𝐷
Dạng trực tiếp 1 𝑏𝑀 −𝑎𝑁

IT 4172 Signal processing Chapter 1. Signal and system 10


Implementation of IIR system

𝐻ệ 1 𝐻ệ 2
𝑥(𝑛) 𝑤(𝑛) 𝑦(𝑛)

𝐻ệ 2 𝐻ệ 1
𝑥(𝑛) 𝑧(𝑛) 𝑦(𝑛)

IT 4172 Signal processing Chapter 1. Signal and system 12


Implementation of IIR system
𝑏0
𝑧(𝑛)
𝑥(𝑛) 𝑦(𝑛)

𝐷 𝐷
−𝑎1 𝑏1

𝐷 𝐷
−𝑎2 𝑏2

𝐷 𝐷
−𝑎𝑁 𝑏𝑀

IT 4172 Signal processing Chapter 1. Signal and system 13


Implementation of IIR system
𝑧(𝑛) 𝑏0
𝑥(𝑛) 𝑦(𝑛)

𝐷
−𝑎1 𝑏1

𝐷 𝑀>𝑁
Direct form 2 −𝑎2 𝑏2

𝐷
−𝑎𝑁 𝑏𝑁

𝐷
𝑏𝑀

IT 4172 Signal processing Chapter 1. Signal and system 14


4. Summary
● Discrete-time systems are classified into finite impulse response (FIR) systems
and infinite impulse response (IIR) systems.

● FIR systems can be implemented using pseudo code, software, or block


diagrams.

● Block diagrams for implementing IIR systems include two forms: direct form I
and direct form II.

IT 4172 Signal processing Chapter 1. Signal and system 15


5. Assignment
● Assignment 1
❑ Draw the block diagrams for direct form I and II, and write the pseudo code to
implement the following systems.
a. y n − 2y n − 1 + 3y n − 2 = x n + x n − 1 + 2x n − 4
b. 5y n + 3y n − 1 + 6y n − 4 = x n + 3x n − 2 + 5x n − 3
c. 2y n + 6y n − 3 + 3y n − 4 = x n
d. 3y n = x n − 1 + 3x n − 3 + 4x n − 5

IT 4172 Signal processing Chapter 1. Signal and system 16


Homework
● Assignment 2
❑ Compute the impulse response and examine the stability of the following
system

IT 4172 Signal processing Chapter 1. Signal and system 17


Homework
● Assignment 3
❑ Compute the impulse response and examine the stability of the following
system

IT 4172 Signal processing Chapter 1. Signal and system 18


The next unit.
7
Z TRANSFORM

References:
• Nguyễn Quốc Trung (2008), Xử lý tín hiệu và lọc số, Tập 1, Nhà xuất bản Khoa học và Kỹ
thuật, Chương 1 Tín hiệu và hệ thống rời rạc.
• J.G. Proakis, D.G. Manolakis (2007), Digital Signal Processing, Principles, Algorithms, and
Applications, 4th Ed, Prentice Hall, Chapter 1 Introduction.

IT 4172 Signal processing 19


SCHOOL OF INFORMATION AND
COMMUNICATION TECHNOLOGY

Wishing you all the best in your studies!

IT 4172 Signal processing Chapter 1. Signal and system 20

You might also like