COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital...

43
Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof. Ahmed El-Mahdy Communications Department, German University in Cairo. e-mail: [email protected]

Transcript of COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital...

Page 1: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

COMM 602: Digital Signal Processing

Prof. Ahmed El-Mahdy

Communications Department, German University

in Cairo.

e-mail: [email protected]

Page 2: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

COMM 602: Digital Signal Processing

• Instructor: Prof. Ahmed El-Mahdy

• Office : C3.319

• Email: [email protected]

Page 3: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Text Book

J. Proakis, Digital Signal Processing:

Principles, Algorithms, and Applications”,

Communication Systems, 4th edition,

Prentice-Hall, 1996.

Page 4: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Grading • Assignments (2 Assignments best 2) 10%

• Practical Assignment 5%

• Quizzes (3 Quizzes best 2) 20%

(NO Compensation for the Quizzes)

• Midterm Exam 25%

• Final Exam 40%

Page 5: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Course Contents Subject No.

-Introduction to Digital Signal Processing. 1

-Linear Time Invariant Systems. 2

- The z-transform and its application to the LTI systems. 3

- Discrete Fourier Transform 4

- Fast Fourier Transform 5

- IIR Digital Filter Design. 6

- FIR Digital Filter Design. 7

Page 6: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

COMM 602: Digital Signal Processing

Lecture 1

Introduction to Digital Signal Processing

Page 7: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

What is DSP?

Page 8: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Advantages of Digital over Analog Signal Processing

• Flexibility: Digital programmable system, allows flexibility in

reconfiguring the digital signal processing operations simply by

changing the program. Reconfiguration of an analog system

usually implies a redesign of the hardware.

• Ex: Changing a filter from low pass to bandpass. In Digital: requires

changing the program, but in analog changing the components of the

circuit.

• Controlling the Accuracy: Digital systems provide much

better control of accuracy than analog systems by specifying

the accuracy requirements in A/D converter (number of

levels,... In analog systems, it is difficult to control the accuracy

because it is affected by other factors, for example, the circuit

components (resistors and capacitors) are affected by

temperature.

Page 9: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Advantages of Digital over Analog Signal Processing

• Storing: digital signals are easily stored on magnetic media

(disk), then the signal become transportable and can be

processed off-line.

• Cost: digital hardware is cheaper.

• Transmission: modern communication networks (internet &

LANS) use digital transmission.

Page 10: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Page 11: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Limitations of Digital Signal Processing

• Finite word length effect:

The use of limited number of bits (due to economical

considerations) affect the performance of the DSP systems.

Ex: Quantization with more levels requires more coding bits.

• Speed:

Analog signals with wide bandwidth require high sampling-

rate A/D converters to prevent Aliasing.

Page 12: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Analog to Digital (A/D) Conversion

Based on min error.

Page 13: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Sampling Theorem and Aliasing

Page 14: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Sampling Theorem and Aliasing (Contd.)

ms ff 2

Page 15: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Signal Classifications Signal is a representation of physical quantity or phenomenon

Deterministic Signals Random Signals

Time Domain Representation t is the independent variable

Frequency Domain Representation f is the independent variable

Representation

Continuous

Discrete

Continuous

Discrete

Page 16: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

CONTINUOUS VERSUS DISCRETE TIME SIGNAL

Continuous Time Signal (CTS) Discrete Time Signal (DTS)

• the independent variable t is continuous.

• the signal values are defined for all t in

in the interval of interest.

• notation x(t).

• Example: volt or current.

• the independent variable t is discrete.

• it takes only a discrete values n.

• n is an integer.

• notation x(nTs)=x(n), Ts is the sampling period.

• it results from sampling of (CTS).

1

-1

5

-5

t

X(t)

0 2

-2

5

-5

n

X(n)

1

2.5

-2.5

- 1

0

Page 17: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Representation of Discrete Signals

Page 18: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Some Important Discrete Time Signals

1. Unit impulse (unit sample sequence)

00

01

n

nn

X(n)

. . . . . . . . . . . . 0 1 2 3 4 5 -1 -2 -3 -4 -5 6

n

. 1

Page 19: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Some Important Discrete Time Signals (Contd.)

2. Unit Step (unit sample sequence)

00

01

n

nnU

X(n)

. . . . . . . . . . . . 0 1 2 3 4 5 -1 -2 -3 -4 -5 6

n

. 1

Page 20: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Relationship between Unit impulse and unit step

Page 21: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Some Important Discrete Time Signals (Contd.)

3. Rectangular Signal

otherwise

Nnnx

0

01

X(n)

. . . . . . . . . . . . 0 1 2 -1 -2 -3 -4 -5 N

n

. 1

. ….

.

Page 22: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

(Contd.)Some Important Discrete Time Signals

4. Real value exponential

aanx n

…….

a > 1 X(n)

. . . . . . . . . . . . 0 1 2 -1 -2 -3 -4 -5 n

. 1

. 3 4 5

X(n)

. . . . . . . . . . . . 0 1 2 -1 -2 -3 -4 -5 n

. 1

. 3 4 5

a < 1

Page 23: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Mathematical Formulas for the exponential signals

1a

Page 24: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

(Contd.)Some Important Discrete Time Signals

5. Sinusoidal Signal

10 15 20 25 30

-1

-0.5

0

0.5

1

nwnxo

sin

n

x(n)

1

1 2 3 4 5……………………………..N

Page 25: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Operations on Signals

. Signal Addition1

• This is sample –to-sample addition and it is given by :

nxnxny 21

Or

nxnxny 21

nx1

nx2

nxnxny 21

+ + Adder

Page 26: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

(Contd.)Operations on Signals

. Signal Multiplication2

• This is sample –to-sample multiplication given by :

nxnxny 21 .

Or

nxnxny 21 .

nx1

nx2

nxnxny 21 .

Multiplier

Page 27: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

(Contd.)Operations on Signals

. Scaling3

• Each sample is multiplied by a scale or constant a

nxany

nx

a

. nxany

Page 28: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

. Shifting:4

(Contd.)Operations on Signals

Page 29: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

(Contd.)Operations on Signals

. Sample Summation5 • It adds all sample values of x(n) between n1 and n2

2

1

211 ..........1n

nn

nxnxnxnxny

. Sample Product6 • It multiplies all sample values of x(n) between n1 and n2

211 ..........12

1

nxnxnxnxnyn

nn

. Time Reversal7

• The signal y(n) = x (-n) is obtained by reflecting x (n) about n=0.

Page 30: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Example:

• Using basic building blocks introduced above, sketch the block diagram

representation of the discrete-time system described by input output

relation:

y(n)=0.25y(n-1)+0.5x(n)+0.5x(n-1)

where x(n) is the input and y(n) is the output of the system.

x(n)

z-1

0.5 z-1

0.25

y(n)

x(n-1)

y(n-1)

Page 31: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Energy and Power

2

n

nxE

3- For non-periodic discrete signal x(n)

12 lim

N

EP

Nav

4- For periodic discrete signal x(n) with period N

0

2

N

n

period nxE

N

EP

period

av

Page 32: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Periodic Signals

x(n) is periodic with period N, where N is a positive integer if

Nnxnx

N is called the fundamental period

. . . . . . . . . . . . . . . . . . . n

X(n)

N = 4

0 1 4 5

2 3

Page 33: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Even and Odd Signals x(n) is even if it is symmetric around y-axis nxnx

Examples

nUnx neither even nor odd 1-

2-

02

100

02

1

n

n

n

nxeven signal

3-

02

100

02

1

n

n

n

nx odd signal

x(n) is odd if it is symmetric around the origin nxnx

Page 34: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Discrete System or Digital system

a. Representation of a discrete system:

The discrete system is mathematically described as an operator or

transformation T [.]

• It takes an input sequence x(n), or the excitation, and transform it into another

sequence called the output sequence or the response y (n) .

T [.]

Processor

y(n)=T[x(n)]

input sequence

x(n)

Output sequence

y (n)

excitation response

b. Discrete System Analysis:

• It is the process of determining the response of that system to a given excitation

Page 35: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

for any value of a

Basic System Properties

1. Linearity

Page 36: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Basic System Properties

Page 37: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Basic System Properties

Page 38: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Basic System Properties

2. Systems with memory and without memory

Memory less system

• If the output of the system dependents only on the present value of the input

signal. Otherwise, the system has memory.

System with memory

222 nxnxny

nxnxny 1

Page 39: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Basic System Properties (contd.)

3. CAUSALITY

Note: the causal system is a realizable one

A system is causal if the output at any time depends only on

values of the input at the present time and in the past. (the

system output does not anticipate the future values of the

input).

causalNonnxnxny

Causalnxnxny

]1[][][

]1[][][

Page 40: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Basic System Properties (contd.)

4. Time Invariance

• A system is time invariant if any delay in the input produces a

similar delay in the output.

• A specific input will produce the same output

independently of the time of application

. (1) y[n]=3x[n] …… Time invariant system

(2) y[n]=nx[n] …… Time variant system

Page 41: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

• Example: Investigate the time invariance of the system:

y[n]=n x(n)

Solution

Let x1(n) be an arbitrary input to this system:

Then y1(n)=n x1(n)

is the corresponding output. Consider x2(n) =x1(n-no), then the

output corresponding to this input is:

y2(n)=n x2(n)=n x1(n-no) ……..(1)

Now we want to check whether y2[n]=y1[n-no] or not??

Then y1(n-no)=(n-no) x1(n-no) …………………(2)

which is not the same as y2(n). From (1) & (2), the system is time

variant

Page 42: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

(contd.)Basic System Properties

The system is said to be stable if for a bounded input

there is a bounded output.

valuesfinite&veare,

,|][|,|][|

oi

oi

BandB

nBnynBnx

5. Stability

Page 43: COMM 602: Digital Signal Processing - GUCeee.guc.edu.eg/Courses/Communications/COMM602 Digital Signal... · Dr. Ahmed El-Mahdy COMM 602: DSP COMM 602: Digital Signal Processing Prof.

Dr. Ahmed El-Mahdy COMM 602: DSP

Example: • Consider a discrete time system whose input-output relation is

defined by:

Where r >1. Show that this system is unstable.

solution

for a bounded input x(t):

Then we find that:

With r>1, the output increases with increasing n. Then the system is

unstable.

,.....2,1,0],[][ nnxrny n

nallforMnx x ][

x

n

n

n

Mr

nxr

nxrny

][.

][][

Check the stability if r<1