0% found this document useful (0 votes)
62 views88 pages

DSP 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views88 pages

DSP 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 88

EEE 324: Digital Signal Processing

Dr. Khurram Ali


Assistant Professor
Department of Electrical & Computer Engineering,
COMSATS University Islamabad, Lahore Campus
Course Overview
Topics and Milestones:
• Some basic concept in digital signal processing
• Digital Signals in Time and Frequency Domains
• Discrete Time LTI Systems
• Z‐Transform
• Frequency domain analysis of signals and LTI systems
• Sampling, Quantization of Signals, A/D and D/A Signal Transformation

Midterm Exam

• Sampling, Quantization of Signals, A/D and D/A Signal Transformation


• Discrete Fourier Transform and Fast Fourier Transform
• Discrete Time System Implementation
• Digital Filters: FIR, IIR

Terminal Exam
Course Information
Textbook:
John G. Proakis and Dimitris G. Manolakis, Digital Signal Processing:
Principles, Algorithms, and Applications, 4th edition, 2007

Reference Books:
• Discrete‐Time Signal Processing by Alan V. Oppenheim, Ronald. W. Schafer,
Pearson Education (OS)

• Digital Signal Processing: A Computer‐based approach by S. K. Mitra,


McGraw‐Hill Science (SKM)

• Schaums Outline of Digital Signal Processing, 2nd Edition (Schaum's Outline


Series) by Monson Hayes
Grading Policy

Midterm Exam 15%


Quizzes/Assignments 25%
Terminal Examination 50%

At Least:
• 4 Quizzes
• 4 Assignments
Class Room Ethics
Attendance:
• At least 80% Attendance is mandatory in order to get permission to sit
in Terminal Exam

• Switch off mobiles


• No gossip etc.
• Sleeping ?
• If you are not able to understand any
concept, ask questions.
• No question is silly rather it is the
answer that could be.
What is Digital Signal Processing
Signal: A parameter (electrical quantity or effect) that can be varied in
such a way as to convey some information

Mathematically, a signal is a function. A function is a dependent variable of


some variables which are independent variables.

A signal can be represented as a function x(t) and consists of:


1. One or more dependent variable components (e.g., air pressure x, R‐G‐B
color [x1 x2 x3]T ).
2. One or more independent variables (e.g. time t, 3‐D spatial location
represented by (s1 s2 s3) ).

Independent variable: Do not limit yourself to TIME only !


What is Digital Signal Processing
Signal: A parameter (electrical quantity or effect) that can be varied in
such a way as to convey some information

Examples: • Pressure as a function of altitude, sound as a function of time,


color as a function of space, . . .

x  t   A cos t    , x  n, m    n  m  ,
2

x t   4 t  t 3 etc.

Note: We will use time to represent independent variable in this


course. In general, it could be any other independent variable
What is Digital Signal Processing
Continuous Time vs. Discrete Time Signals:
Continuous‐Time Signals: Signal is defined for every value of time in a given interval
 a, b  where a    and b  

Examples: Voltage as a function of time, Pressure as a function of height etc.


What is Digital Signal Processing
Continuous Time vs. Discrete Time Signals:
Discrete‐Time Signals: Signal is defined only for certain specific values of time;
typically taken to be equally spaced points in an interval
in a given interval  a, b  where a    and b  

Examples: Number of stocks traded per day, Average income per province.
What is Digital Signal Processing
Continuous Amplitude vs. Discrete Amplitude Signals:
Continuous Amplitude Signals: Signal amplitude takes on values from an infinite set

Examples: Color, temperature, pain‐level etc.


What is Digital Signal Processing
Continuous Amplitude vs. Discrete Amplitude Signals:
Discrete Amplitude Signals: Signal amplitude takes on values from a finite set

Examples: Digital image, population of a country etc.


What is Digital Signal Processing
Analog Signals: Continuous Time + Continuous Amplitude

Digital Signals: Discrete Time + Discrete Amplitude


What is Digital Signal Processing
Analog Signals: Continuous Time + Continuous Amplitude

Digital Signals: Discrete Time + Discrete Amplitude

Analog signals are fundamentally significant because we must


interface with the real world which is analog by nature.
Then why Digital Signals?

Digital signals facilitate the use of digital signal processing (DSP) systems (e.g.
PC, smartphone etc. ), which have practical and performance advantages.

Processing To obtain the signal in more desirable form


What is Digital Signal Processing
In short:
Why Signals?
They carry information and information is the basic thread of life.

Why Digital Signals?


Because it is easier to process them.

Why Processing?
To obtain the signal in more desirable form
What is Digital Signal Processing
Examples: Multiplexing
A number of signals which are to be transmitted over the same channel, then we do a
processing called multiplexing. At the receiver end the signals have to be separated
and therefore there is a need for de‐multiplexing which is again signal processing
What is Digital Signal Processing
Examples: Filtering
The signal is always corrupted by noise and other disturbances whenever passed
through any medium. One of the most important type of signal processing is to filter
out the noise and other disturbances.

Filter = A DSP system

Dirty water = signal corrupted by noise

Dirt = Noise (unwanted part)

Clean water = useful information


DSP Applications
DSP Applications
DSP Applications
DSP Applications
DSP Applications
DSP Applications
DSP Applications
DSP Applications
A lot of apps !
Concept of Frequency
CT Sinusoids: What is a “pure frequency” signal?
xa  t   A cos  t     A cos  2 Ft    ; t 
• Analog signal:  A  xa  t   A and    t  
• A = Amplitude (units depends on nature of signal e.g. for voltage signal, units are volts)
•   Frequency in rad/s
•   2 F
• F  Frequency in Hz or cycles/s
•   Phase in rad
Concept of Frequency
CT Sinusoids: What is a “pure frequency” signal?
xa  t   A cos  t     A cos  2 Ft    ; t 

1 • For F  , xa  t  is periodic with period = Tp . It means there exists a


Tp    such that xa  t   xa  t  Tp 

2 • Distinct frequencies result in distinct sinusoids i.e. if


F1  F2 , A cos  2 F1t     A cos  2 F2t   

3 • Increasing frequency results in increase in rate of oscillation of the


sinusoid i.e. if F1  F 2 ,
A cos  2 F1t    has a lower rate of oscillation than A cos  2 F2t   
Concept of Frequency
CT Sinusoids: What is a “pure frequency” signal?
xa  t   A cos  t     A cos  2 Ft    ; t 

1
F
T

Smaller F  Larger T
Larger F  Smaller T
Concept of Frequency
DT Sinusoids: What is a “pure frequency” signal?

x  n   A cos  n     A cos  2 fn    ; n


• Discrete time signal (not digital !):  A  x  n   A and n  
• A = Amplitude (units depends on nature of signal e.g. for voltage signal, units are volts)
•   Frequency in rad/sample
•   2 f
• f  Frequency in cycles/samples (remember never Hz)
•   Phase in rad
Concept of Frequency
DT Sinusoids: What is a “pure frequency” signal?
x  n   A cos  n     A cos  2 fn    ; n
1 • x  n  is periodic only if its frequency is a RATIONAL NUMBER
k1
Note: rational number is of the form for k1 , k2  
k2
 2  1
• Periodic sinusoids:x  n   2 cos  n  f 
 7  7
• Non‐periodic sinusoids: x  n   2 cos  n   f 
2 1
7  7
2 • Radian frequencies separated by integer multiple of 2 are identical
OR
cyclic frequencies separated by an integer multiple are identical.
 2   16 
cos  n  and cos  n  are identical as f 2  f1  1
 7   7 
Concept of Frequency
DT Sinusoids: What is a “pure frequency” signal?
x  n   A cos  n     A cos  2 fn    ; n

3 • Lowest rate of oscillation is obtained when


  2k or f  k (integer)

• Highest rate of oscillation is obtained when


k 1
   2k  1  or f 
2
(half integer)

for k  .
Concept of Frequency
Complex Exponentials
Complex exponentials play a major role in the analysis of signals and systems, so, we
need to review them

e j  cos( )  j sin( ) Euler's Relation

e j  e  j
cos( ) 
2
e j  e  j
s in( ) 
2j

where j  1
Complex Exponentials
Complex exponentials play a major role in the analysis of signals and systems, so, we
need to review them

j ( t  ) j (2 Ft  )
Continuous-time: Ae  Ae
j ( n  ) j (2 fn  )
Discrete-time: Ae  Ae

Rotating Phasors: Rate of rotation is given by angular frequencies


Complex Exponentials

We will explore THREE important characteristics of a Complex


Exponential

• Periodicity

• Uniqueness

• Fundamental Frequency Range


Complex Exponentials
Periodicity CT:

x(t )  x(t  T ), T  
Ae j (2 Ft  )  Ae j (2 F ( t T )  )
e j 2 Ft e j  e j 2 Ft e j 2 FT e j
1  e j 2 FT
e j 2 k  1  e j 2 FT ,k 
k
T
F
1
Fundamental period = T0 
F
Complex Exponentials
Periodicity DT:

x(n)  x(n  N ), N 
Ae j (2 fn  )  Ae j (2 f ( n  N )  )
e j 2 fn e j  e j 2 fn e j 2 fN e j
1  e j 2 fN
e j 2 k  1  e j 2 fN , k 
k
f 
N
k' k '
Fundamental Period: N 0  , min k '   such that  
f f
Complex Exponentials
Periodicity DT:

n 
Example 1: x(n)  cos  6 
 
  1
f     Rational Number
2 2 .6 12
k
N  12k
f
Fundamental Period: N 0  12 for k  1

The fundamental period is 12 which corresponds to k = 1 envelop cycles


Complex Exponentials
Periodicity DT:

n 
Example 1: x(n)  cos  
 6 
The fundamental period is 12 which corresponds to k = 1 envelop cycles
Complex Exponentials
Periodicity DT:

 8 n 
Example 2: x(n)  cos  31 
 
 8 4
f     Rational Number
2 2 .31 31
k 31
N  k
f 4
N 0  31 for k  4

The fundamental period is 31 which corresponds to k = 4 envelop cycles


Complex Exponentials
Periodicity DT:

 8 n 
Example 2: x(n)  cos  
 31 
The fundamental period is 31 which corresponds to k = 4 envelop cycles
Complex Exponentials
Periodicity DT:

Example 3: n
x(n)  cos  
6
 1 1
f     Irrational Number
2 2 .6 12
k
N   12 k
f
N    does not exist for any k  ;

x(n) is non‐periodic
Complex Exponentials
Periodicity DT:

Example 3: n
x(n)  cos  
6
Complex Exponentials
Uniqueness CT:

For F1  F2 ,

A cos(2 F1t   )  A cos(2 F2t   )

So, continous time sinuosids and complex exponentials having


different frequencies are always unique except at
some discrete points in time
Complex Exponentials
Uniqueness DT:

For two signals x0  n  and x1  n  , let f1  f 0  k where k  ,

x1 (n)  Ae j (2 f1n  )


 Ae j (2 ( f0  k ) n  )
 Ae j (2 f0 n  ) e j (2 kn )
 x0 (n)  1  x0 (n)

Both signals are same ! But HOW ?


Complex Exponentials
Uniqueness DT:

Both signals are same ! But HOW ?


Complex Exponentials
Uniqueness DT:

Both signals are same ! But HOW ?


Complex Exponentials
Uniqueness DT:

Both signals are same ! But HOW ?


Complex Exponentials
Uniqueness DT:

• So, discrete time sinusoids are unique for f  0,1

• For any sinusoid with f1  0,1 ,  f0  0,1 such that


x1  n  Ae j 2 f1n  Ae j 2 f0n  x0  n

• Example: A DT sinusoid with frequency 4.56 is same as a discrete


time sinusoid with frequency 4.56 ‐ 4 = 0.56 .

• Example: A DT sinusoid with frequency ‐7/8 is same as a DT sinusoid


with frequency ‐7/8 + 1 = 1/8
Complex Exponentials
Fundamental Frequency Range:

Frequency range of discrete time sinusoids is finite

0    2 OR     
 
1 1
0  f 1 OR   f 
2 2
Harmonically Related Complex
Exponentials
• In general, sinusoids and complex exponentials play a major role in the analysis of
signals and systems

• In some cases, we deal with sets of harmonically related sinusoids or complex


exponentials.

Set of periodic complex exponentials with fundamental frequencies that are multiples
of a single positive frequency.
Harmonically Related Complex
Exponentials
CT Harmonically Related CE :

sk  t   e jk o t
e j 2 kFo t
; k  0, 1, 2,...

• For each value of k, a different CE having different fundamental


frequency but the fundamental frequencies of all CE’s are
multiples of a single positive frequency i.e.  o
Harmonically Related Complex
Exponentials
CT Harmonically Related CE :

sk  t   e jk o t
e j 2 kFo t
; k  0, 1, 2,...

1 To
 sk  t  is periodic with fundamental period  
kFo k
To
 A signal that is periodic with period: So, all of the sk  t  have a
k
1
T  common period of To 
is also periodic with period: k  o   To Fo
k 

Fo is allowed to take any value


Harmonically Related Complex
Exponentials
CT Harmonically Related CE :

sk  t   e jk o t
e j 2 kFo t
; k  0, 1, 2,...

 If k1  k2 , then sk1  t   sk2  t  All members of the


set sk  t  are unique
Harmonically Related Complex
Exponentials
CT Harmonically Related CE :

sk  t   e jk ot  e j 2 kFot ; k  0, 1, 2,...


We can construct a linear combination of harmonically related CE’s


xa  t  =  ck sk  t  where ck , k  0, 1, 2,... are arbitrary complex constants
k 

1
xa  t  is periodic with fundamental period = To 
Fo
Fourier series expansion
of xa  t 
Harmonically Related Complex
Exponentials
DT Harmonically Related CE :

sk  n   e jko n
e j 2 kf o n
; k  0, 1, 2,...

• Is this set periodic ? NOT Necessarily! Depends on fo

f o is allowed to be rational only.

1
Let f o 
N
Harmonically Related Complex
Exponentials
DT Harmonically Related CE :

1
j 2 kn
Let fo 
1
then: sk  n   e N
;k  ?
N

1 1
j 2  k  N  n j 2 kn
Notice that: sk  N  n   e N
 e j 2 n e N
 e j 2 n sk  n   sk  n 

There are only N distinct periodic DT CE’s, starting from k=0


to k=N‐1
Harmonically Related Complex
Exponentials
CT Harmonically Related CE :

n
j 2 k
sk  n   e jko n  e N
; k  0,1, 2, ... N  1

We can construct a linear combination of harmonically related DT CE’s also:

N 1
x  n  =  ck sk  n  where ck , k  0,1, 2,...N  1 are arbitrary complex constants
k 0

x  n  is periodic with fundamental period =N


Fourier series expansion
of x  n 
DSP Implementation
Operations
DSP Chips
DSP Chips
DSP Chips
DSP Chips
Analog to Digital Conversion
Analog to Digital Conversion
Analog to Digital Conversion

Sampling:
Conversion from continuous time to discrete time by taking
“samples” at discrete time instants.
e.g. Uniform Sampling:
Analog to Digital Conversion
Uniform Sampling:

x  n   xa  nT  where T  sampling period and n  


1
Fs   Sampling Frequency or rate
T
n
t and n are linearly related through: t  nT 
Fs

There must be a relationship between F and f
Analog to Digital Conversion
Uniform Sampling: Relationship between F and f ?

 OR
f  Normalized Frequency (Normalized by Fs )
Frequency in Hz i.e. F can only be found if Fs is known
Analog to Digital Conversion
Uniform Sampling: Relationship between F and f ?
What is the fundamental difference between CT and DT signals?

Range of frequencies !
Analog to Digital Conversion
What is the fundamental difference between CT and DT signals?

Range of frequencies !

Continuous Time Discrete Time


Signal Signal

We are trying to map an infinite range variable F to a finite


range variable f

Will it be a unique one‐to‐one mapping ?


Analog to Digital Conversion
Will it be a unique one‐to‐one mapping ?

For sure NO. There will be ambiguity. Only the frequencies (in analog signal)
in a certain range will be uniquely mapped in discrete time domain.

What is the maximum frequency that will be uniquely mapped?

The answer certainly depends on sampling rate. For a given sampling rate = Fs

1
Since the maximum frequency in DT is: f 
2
F
From the relation: F  f .Fs  Fmax  s
2
Fmax is the highest frequency in analog signal that will
be uniquely mapped in discrete domain
Analog to Digital Conversion
What happens to frequencies above Fs ?
2

Example:


So, for Fs=40 Hz, we say that F=50 Hz is an ALIAS of Both DT sinusoids are
F=10 Hz same and identical
Analog to Digital Conversion
Is F=50 Hz the only ALIAS of F=10 Hz for Fs = 40 Hz ?

Fk  Fo  kFs k  0, 1, 2,...


Fk  Aliases of Fo
Analog to Digital Conversion
What happens to frequencies above Fs ?
2

All the frequencies above Fs/2 are folded back to fundamental range
Fs/2 = FOLDING Frequency
Analog to Digital Conversion
Given an analog signal what should be the sampling rate to avoid
aliasing ?

Sampling Theorem: If the highest frequency contained in an analog


signal xa  t  is Fmax  B and the signal is sampled at a rate Fs  2 Fmax  2 B
then xa  t  can be EXACTLY recovered from its samples using the interpolation
function: sin  2 Bt 
g t  
2 Bt

Note: FN  2 B  2 Fmax is called the Nyquist Rate


Analog to Digital Conversion
Sampling Theorem: If the highest frequency contained in an analog
signal xa  t  is Fmax  B and the signal is sampled at a rate Fs  2 Fmax  2 B
then xa  t  can be EXACTLY recovered from its samples using the interpolation
function: sin  2 Bt 
g t  
2 Bt
 
Reconstruction: xa  t    x  nT g  t  nT    x  n g  t  nT 
n 
a
n 
Bandlimited Interpolation

Interpolation/Reconstruction:
What will be the value of the corresponding
analog signal between two samples?
Analog to Digital Conversion
Sampling Theorem: If the highest frequency contained in an analog
signal xa  t  is Fmax  B and the signal is sampled at a rate Fs  2 Fmax  2 B
then xa  t  can be EXACTLY recovered from its samples using the interpolation
function: sin  2 Bt 
g t  
2 Bt
 
Reconstruction: xa  t    x  nT g  t  nT    x  n g  t  nT 
n 
a
n 

Bandlimited Interpolation ?

The original (analog) signal is always assumed to be bandlimited to Fmax


Analog to Digital Conversion
Sampling Theorem: If the highest frequency contained in an analog
signal xa  t  is Fmax  B and the signal is sampled at a rate Fs  2 Fmax  2 B
then xa  t  can be EXACTLY recovered from its samples using the interpolation
function: sin  2 Bt 
g t  
2 Bt
 
Reconstruction: xa  t    x  nT g  t  nT    x  n g  t  nT 
n 
a
n 

This is IDEAL interpolation/reconstruction.


Analog to Digital Conversion
Analog to Digital Conversion

Lets go back to the discussion of ADC !


Analog to Digital Conversion

Quantization:
Conversion from discrete‐time‐continuous valued signal to
discrete‐time‐discrete valued signal

Quantization Error:
Analog to Digital Conversion
Analog to Digital Conversion
Digital to Analog Conversion (DAC)
Digital to Analog Conversion (DAC)
DAC is all about interpolating the signal values between two consecutive samples
Digital to Analog Conversion (DAC)
DAC is all about interpolating the signal values between two consecutive samples
Digital to Analog Conversion (DAC)
DAC is all about interpolating the signal values between two consecutive samples
Home Work Suggestions:
1.3‐1.10, 1.15

You might also like