You are on page 1of 54

EE338 - Digital Signal Processing (DSP)

Instructor: Dr. Syeda Narjis Fatima


narjis.fatima@mail.au.edu.pk, sfatima13@ku.edu.tr

Department of Electrical and Computer Engineering (ECE)


Air University, Islamabad, Pakistan

Air University,
Islamabad
March, 2021
Outline Ref: Text book, Chap 1,2
Introduction

Signal Processing
Digital Signal Processing
Comparison of DSP and Analog Signal Processing (ASP)
Advantages of DSP
DSP Applications
Signals, Systems and Signal Processing

Introduction to signals
Signal Processing Systems
Basic Elements of Digital Signal Processing
Classification of Signals

Discrete-Time signals
Continuous-Time signals
Discrete-Time Signals and Systems

System Properties
LTI Systems
LTI System Properties

EE338 Digital Signal Processing Introduction 2


Introduction

EE338 Digital Signal Processing Introduction 3


Introduction

Signal Processing
Deals with extracting information from a signal by carrying out algorithmic
operations
Representing signal in mathematical terms and extracting information from the
signal
Domain transformations
Applications:
Speech Processing
Multimodal Signal Processing
Sentiment Analysis
Emotion Recognition
Digital vs. Analog Signal Processing

EE338 Digital Signal Processing Introduction 4


Comparison between DSP and ASP

Advantages of DSP over Analog Signal Processing


Flexibility
Accuracy
Easy Storage
Mathematical Processing
Cost Efficiency
Adaptability
Size, Reliability and Compatibility

5
EE338 Digital Signal Processing Introduction
Advantages of DSP

 Digital circuits do not depend on precise values of the digital signals for their
operation.
 Digital circuits less sensitive to changes in component values
 Digital circuits less sensitive to changes in temperature, ageing and other external
parameters.
 In a digital processor, the signals and systems coefficients are represented as binary
words. This enables us to choose any accuracy by increasing or decreasing the
number of bits in the binary words.
 DSP facilitates the sharing of a single processor among a number of signals by time-
sharing. This reduces the processing cost per signal.
 Digital implementation of a system allows easy adjustment of the processor
characteristics during processing.
 With digital processing of signals, it is possible to achieve linear phase characteristics
and multirate processing.
 Digital circuits can be connected in cascade without any loading problems, whereas
this cannot be easily done with analog circuits.
 Digital data easy to store.

EE338 Digital Signal Processing Introduction


DSP Applications

Speech Processing
Image Processing
Multimodal Signal Processing
Sentiment Analysis
Emotion Recognition
Military/defense applications- radar signal processing, sonar signal
processing, missile guidance
Radar Signal Processing- used in radar tracking algorithms
Digital Communications
Biomedical Engineering
Commercial/Entertainment Applications

EE338 Digital Signal Processing Introduction 8


DSP Applications

Applications Application Fields


Biomedical • Ultrasound equipment
Engineering • CT scanning equipment
• ECG analysis
• EEG brain mappers
Speech Processing • Speech analysis
• Speech recognition
• Equalization
• Speech coding
Image Processing • Pattern Recognition
• Image enhancement
• Animation
Telecommunications • Echo cancellation
• DTMF
• Spread Spectrum
Consumer Applications • Digital audio
• Digital video
• Television
• Music systems/synthesizers
EE338 Digital Signal Processing Introduction 9
Signals, Systems and Signal Processing

EE338 Digital Signal Processing Introduction 10


What is a Signal?

A physical quantity that varies over time space or any other


independent variable
An information carrying quantity
A function of one or more independent variable
Example
Electrical signals
Acoustic signals
Video Signals
Biological Signals

11

EE338 Digital Signal Processing Introduction


Independent Variables

Can be continuous
e.g. Trajectory of a space shuttle
Daily temperature contours
Can be discrete
DNA base sequence
Can be 1D, 2D, 3D

For this course, we stick to 1D independent variable that we call as


‘time, t’

12

EE338 Digital Signal Processing Introduction


Transformation of the Independent Variable

Time Shifting Q. Consider the following sequence:


x[n-n0] (Signal shift to right by integar factor 𝑥[𝑛] = 2𝛿[𝑛 + 1] + 𝛿[𝑛] + 3𝛿[𝑛 − 1]
n0) Sketch
x[n+n0] (Signal shift to left by integar factor 𝑥[−𝑛]
n0) 𝑥[𝑛 + 2]
𝑥[−𝑛 + 2]
Time Reversal 𝑥[𝑛 − 2]
e.g. x[-n] 𝑥[−𝑛 − 2]
Time Scaling 𝑥[2𝑛]
1
x[an] (Compression of signal by a where a>0) 𝑥[ 𝑛]
2
x[n/a] (Expansion of signal by a where a>0)

Transformation of the independent variable apply to continuous-time signal as well. However, in the case
of discrete-time signals, time-scaling operations are manifested in the form of decimation and
interpolation.

13

EE338 Digital Signal Processing Introduction


Real World Signals

ECG Signal

Seismogram recording seismic activity

14

EE338 Digital Signal Processing Introduction


Classification of Signals

EE338 Digital Signal Processing Introduction 15


Classification of Signals

Discrete-time signals: In this case the independent variable takes a


discrete set of values, i.e., these signals are defined only at discrete
times.
Mathematical expression
Continuous time signals: In this case the independent variable is
continuous, i.e., these signals are defined for a continum of values of
the independent variable.
Mathematical expression

16

EE338 Digital Signal Processing Introduction


Further Classification of Signals

Periodic / Aperiodic
Deterministic / Stochastic
Multichannel / Multidimensional
Real valued / Complex valued
Continuous valued / Discrete valued
Continuous time / continuous valued
Continuous time / discrete valued
Discrete time / continuous valued
Discrete time / discrete valued --------- Digital Signal

17

EE338 Digital Signal Processing Introduction


Further Classification of Signals

Continuous Periodic Signals Discrete Periodic Signals

Continuous periodic signals: Discrete periodic signals:


repeat with some period T repeat with some period N
Fundamental period To : Fundamental period No :
smallest value of T for which smallest positive value of N for
above equation holds which above equation holds

EE338 Digital Signal Processing Introduction 18


Further Classification of Signals

Deterministic Signal

Stochastic/Random Signal

EE338 Digital Signal Processing Introduction 19


Comparison of Energy and Power signal

Energy Signal Power Signal


Total normalized energy is finite and non Total normalized average power is finite
zero. and non zero
Non periodic signals are energy signals Periodic signals are power signals

Time limited Can exist over infinite time


Power of energy signals is zero. Energy of power signals is infinite

E.g. rectangular pulse E.g. periodic pulse train

EE338 Digital Signal Processing Introduction 20


Periodic Signals

EE338 Digital Signal Processing Introduction 21


Further Classification of Signals

 Even signal: A signal x(t) or x[n] is referred as an even signal if its


time reversed version is identical to itself.

 Odd signal: A signal x(t) or x[n] is referred as an odd signal if the time
reversed version of the signal is identical to the reflection of signal is
y-axis.
 An odd signal must necessarily be zero at t=0 or n=0

22

EE338 Digital Signal Processing Introduction


Signal Types (cont.)

 Digital Signals
 those for which both time and amplitude are discrete
 Signal Processing System: map an input signal to an output signal
 Continuous-time systems
 Systems for which both input and output are continuous-time signals
 Discrete-time system
 Both input and output are discrete-time signals
 Digital system
 Both input and output are digital signals

EE338 Digital Signal Processing Introduction 23


Discrete time Signals and Systems

EE338 Digital Signal Processing Introduction 24


Example of Discrete Time Signal

x  {x[n]}, -  n  where n is an integer

EE338 Digital Signal Processing Introduction 25


Generation of Discrete Time Signal

In practice, such sequences can often arise from periodic sampling of an analog
signal.

x  xa [nT ], -  n  

EE338 Digital Signal Processing Introduction 26


Block Diagram Representation of Discrete Time Systems

• The product and sum


of two sequences x[n]
and y[n] are defined x2(n)
as the sample-by-
sample product and x1(n)
+ x1(n) + x2(n) Adder
sum, respectively.

• Multiplication by a a
number a is defined ax(n) Multiplier
as multiplication of x(n)
each sample value by
a.
z1 x(n1) Unit Delay
• Shift operation: y[n] is x(n)
a delayed or shifted
version of x[n] where

yn  xn  n0


n0 is an integar

EE338 Digital Signal Processing Introduction


27
Unit Impulse and Unit Step Function

UNIT IMPULSE FUNCTION UNIT STEP FUNCTION

EE338 Digital Signal Processing Introduction 28


Signal Representation

An arbitrary sequence can be represented as a sum of scaled, delayed impulses.

xn  xk n k


k 

EE338 Digital Signal Processing Introduction 29


Exponential Sequences

Growing Exponential Decaying Exponential

EE338 Digital Signal Processing Introduction 30


Some Signal Examples (cont.)

Sinusoidal sequence

xn A0cosw n 

EE338 Digital Signal Processing Introduction 31


Complex Exponential Sequence

Consider an exponential sequence x[n] = A  n, where  is a complex number


having real and imaginary parts

The sequence oscillates with an exponentially growing envelope if | |>1, or


with an exponentially decaying envelope if | |<1

EE338 Digital Signal Processing Introduction


32
Complex Exponential Sequence

If  =1, the resulted sequence is referred to as a complex exponential sequence


and has the form

The real and imaginary parts of e j w0n  vary sinusoidally with n.

w0 is called the frequency of the complex exponential and  is called the phase.

EE338 Digital Signal Processing Introduction


33
Discrete-time Systems

 A transformation or operator that maps an input sequence with values x[n] into
an output sequence with value y[n] .

 System Examples
 Ideal Delay
 y[n] = x[nnd], where nd is a fixed positive integer called the delay of the system.
 Moving-average filter

EE338 Digital Signal Processing Introduction


36
System Properties

 Memoryless System
 The output y[n] at every value of n depends only on the input x[n], at
the same value of n.
 Eg. y[n] = (x[n])2, for each value of n.

 Linear System
 If y1[n] and y2[n] are the responses of a system when x1[n] and x2[n]
are the respective inputs. The system is linear if and only if
T{x1[n] + x2[n]} = T{x1[n] }+ T{x2[n]} = y1[n] + y2[n] .
T{ax[n] } = aT{x[n]} = ay[n], for arbitrary constant a.
So, if x[n] = k akxk[n], y[n] = k akyk[n] (superposition principle)

 Examples
 Accumulator System

 Nonlinear System.
 w[n] = log10(|x[n]|)
EE338 Digital Signal Processing Introduction
37
System Properties
 Causality
 A system is causal if, for every choice of n0, the output sequence
value at the index n = n0 depends only the input sequence values for
n  n0.

 That is, if x1[n] = x2[n] for n  n0, then y1[n] = y2[n] for n  n0.
 Examples:
 Forward-difference system: (The current value of the output
depends on a future value of the input), (non causal)
y[n] = x[n+1]  x[n]
 Backward-difference (causal)
. y[n] = x[n]  x[n1]
 Time Invariance
 If y[n] = T{x[n]}, then y[nn0] = T{x[n n0]}
 Examples:
 The accumulator is a time-invariant system
 The compressor system (not time-invariant) y[n] = x[Mn],  < n < .
EE338 Digital Signal Processing Introduction
38
System Properties

 Stability
 Bounded input, bounded output (BIBO): If the input is bounded:
|x[n]|  Bx < ∞ for all n
then the output is also bounded, i.e. there exists a positive value By s.t.
|y[n]|  By < ∞ for all n.

 Examples
 the system y[n] = (x[n])2 is stable.
 the accumulated system is unstable, which can be easily verified by setting x[n] =
u[n], the unit step signal.

EE338 Digital Signal Processing Introduction 39


Linear Time Invariant Systems

EE338 Digital Signal Processing Introduction 40


Linear Time Invariant Systems
 A system that is both linear and time invariant is called a linear time invariant (LTI) system.
 By setting the input x[n] as δ[n], the impulse function, the output h[n] of an LTI system is
called the impulse response of this system.

 Time invariant: when the input is δ [n-k], the output is h[n-k].


 Remember that the x[n] can be represented as a linear combination of delayed impulses

 Hence

Therefore, a LTI system is completely characterized by its impulse response h[n].

EE338 Digital Signal Processing Introduction 41


Linear Time Invariant Systems (cont.)

Convolution

yn  xk hn k
k 

The above operation is called convolution sum and can be written in short as:
y[n] = x[n] h[n]

In a LTI system, the input sample at n = k, represented as x[k] [n-k], is


transformed by the system into an output sequence x[k]h[n-k] for  < n < .

Convolution can be carried out in a number of ways:


Solve Convolution Sum
Illustrative approach
Analytical Evaluation

EE338 Digital Signal Processing Introduction 42


Convolution - An Illustrative Approach

Example

EE338 Digital Signal Processing Introduction 43


Convolution - An Illustrative Approach

EE338 Digital Signal Processing Introduction 44


Convolution Computation

Convolution can be realized in five simple steps.


 Flip: Reflecting h[k] about the origin to obtain h[-k].

 Shift: Shifting the origin of the reflected sequences to k=n.

 Multiply and Add: Computing the weighted moving average of x[k] by using
the weights given by h[n-k].

 Repeat

0, 0, 5, 2, 3, 0, 0, ...
 Example *) 0, 0, 1, 4, 3, 0, 0, ...
 x[n] = 0, 0, 5, 2, 3, 0, 0…
 h[n] = 0, 0, 1, 4, 3, 0, 0… 0, 0, 5, 2, 3, 0, 0, 0
 x[n]  h[n]: 0, 0, 0, 20, 8, 12, 0, 0
0, 0, 0, 0, 15, 6, 9,

0
0, 0, 5, 22,26,18, 9, 0
EE338 Digital Signal Processing Introduction 45
Properties of LTI System and Convolution

 Communitive:
x[n]  h[n] = h[n]  x[n].
 Distributive over addition
x[n]  (h1[n] + h2[n]) = x[n]  h1[n] + x[n]  h2[n].
 Cascade connection

h1[n] h2[n]
x[n] y[n]
h2[n]  h2[n]
x[n] y[n]
h2[n] h1[n]
x[n] y[n]

 Parallel combination of LTI systems and its equivalent system.

EE338 Digital Signal Processing Introduction 46


Properties of LTI System and Convolution (cont.)

 Stability: A LTI system is stable if and only if



S  h k   
k 

Since
 
yn   hk xn k  hk xn k  
k  k 

When |x[n]|  Bx.

 This is a sufficient condition proof.

EE338 Digital Signal Processing Introduction 47


Properties of LTI System and Convolution (cont.)

 Stability: necessary condition


 to show that if S = , then the system is not BIBO stable, i.e., there exists a
bounded input that causes unbounded output.
 Such a bounded input can be set as (h*[n] is the complex conjugate of
h[n])

 In this case, the value of the output at n = 0 is

EE338 Digital Signal Processing Introduction 48


Properties of LTI System and Convolution (cont.)

 Causality:
 systems for which the output depends only on the input samples y[n0]
depends only the input sequence values for n  n0.
 Follow this property, an LTI system is causal iff

h[n] = 0 for all n < 0.

 Causal sequence: a sequence that is zero for n<0. A causal sequence could
be the impulse response of a causal system.

EE338 Digital Signal Processing Introduction 49


Impulse Responses of Some LTI Systems

Ideal delay

Moving average

Accumulator

Forward difference

Backward difference

EE338 Digital Signal Processing Introduction 50


Examples of Stable/Unstable Systems

 In the above, moving average, forward difference and backward


difference are stable systems, since the impulse response has only a
finite number of terms.
 Such systems are called finite-duration impulse response (FIR)
systems.
 FIR is equivalent to a weighted average of a sliding window.
 FIR systems will always be stable.

 The accumulator is unstable since



S un  
n0

EE338 Digital Signal Processing Introduction 51


Examples of Stable/Unstable Systems (cont.)

 When the impulse response is infinite in duration, the system is


referred to as an infinite-duration impulse response (IIR) system.
 The accumulator is an IIR system.
 Another example of IIR system: h[n] = anu[n]
 When |a|<1, this system is stable since
 S = 1 +|a| +|a|2 +…+ |a|n +…… = 1/(1|a|) is bounded.
 When |a| 1, this system is unstable

EE338 Digital Signal Processing Introduction 52


Equivalent Systems

 A LTI system can be realized in different ways by separating it into


different subsystems.

hn  n 1  n n 1


  n 1 n 1  n
  n  n 1

EE338 Digital Signal Processing Introduction 53


Equivalent Systems (cont.)

 Another example of cascade systems – inverse system.

hn un n  n 1  un un 1  n

EE338 Digital Signal Processing Introduction 54


Analog to Digital and Digital to Analog Conversion

EE338 Digital Signal Processing Introduction 55


Basic Elements of DSP

ADC DSP DAC

1. Analog to Digital Converter (ADC)


1. converts analog signal to digital signal, determines sampling rate and
quantization error.
2. Digital Signal Processor(DSP)
1. Performs amplification, attenuation, filtering, spectral analysis, feature
extraction operations on digital data.
2. DSP consists of ALU, shifters, serial ports, interrupts, address generators
etc.
3. Digital to Analog Converter (DAC)
1. converts digital output from DSP Processor to analog equivalent.

56

EE338 Digital Signal Processing Introduction


Textbook

 Digital Signal Processing (Principles, Algorithms and


Applications) by John G. Proakis, Dimitris G. Manolakis and D.
Sharma

EE338 Digital Signal Processing Introduction

You might also like