Signal Processing Course Overview
Signal Processing Course Overview
Previous TA/SA:
TA:Emre Bilgili (2022)
TA:Mete Tuluhan Akbulut (2019-2021)
SA: Adalet Turgut Veyis (2021)
TA: Yekta Said Can (2014-2019)
TA: Ozlem Salehi (2012-2014)
cmpe 362- Introduction to Signal Processing for Computer Eng.
INTRO
I will first start with an overview of the ideas contained in this lecture about signals and systems.
Since we are living in an age of multimedia, audio, video, infotainment, AR/VR entertainment systems,
computational analysis for almost everything e.g. behavioral /clinical sciences, IoT, body dynamics, face
analysis, wearable devices, space travel, Industry 4.0, 5G and beyond digital communications systems,
etc, it is almost certain that you have been formed with some impression of the meaning of the terms
“signal” and “system”.
cmpe 362- Introduction to Signal Processing for Computer Eng.
INTRO
It is quite likely that your usage and understanding of the term signal and system are partially correct. For
example, you make think of a signal for something that carries information.
Usually that something is a pattern of variations with physical quantity that can be manipulated, stored or
transmitted by physical processes.
The terms “signal” and “system” maybe somewhat harder to pin down because they have variety of meanings.
As of January 2022, Google searches result in 1.48 billion and 6.43 billion for the former and latter ,
respectively. For example, the word “system” might refer to a large organization such as the Financial System
or Social Security system.
cmpe 362- Introduction to Signal Processing for Computer Eng.
INTRO
However, we are interested in a much narrower definition that is very closely linked to
signals. For our purposes a system is something that can operate on signals to produce
new signals or new signal representations. For example an Audio compact disc player is
a system for converting the music signals stored on the CD to an acoustic signal that we
can hear.
The Recording is digital because it represents the music signal as sequence of numbers.
Our goal in this course is to develop a framework that makes precise statements about
those signals and systems.
We will use mathematics as the appropriate language for describing and understanding
signals and systems.
cmpe 362- Introduction to Signal Processing for Computer Eng.
INTRO
We want to show how mathematical equations allow us to represent signals and systems
into design, and implement systems that achieve a prescribed purpose.
In the lectures to come, we will start with the basics of sine and cosine functions and
than show how complex numbers can simplify the algebra of these trigonometric
functions.
We will than introduce the concept of the frequency spectrum of a signal in the concept
of filtering with a Linear Time Invariant (LTI) system.
cmpe 362- Introduction to Signal Processing for Computer Eng.
INTRO
For each lecture we will provide demonstrations, labs, solved homework problems.
These will be ready on the course Moodle site, and there are also links in the text of the
CD demos for individual sections of the text book.
Supplementary materials should provide a broader perspective among these topics than
what might be gained by just reading the book or just listening to me.
cmpe 362- Introduction to Signal Processing for Computer Eng.
INTRO
Unfortunately given the limited resources at hand, we will prepare our best to teach this
course in online form.
Since you may experience connection problems, we will generally be on somewhat slow
mode of teaching. Please stop me at times when you are lost when surfing in
mathematics.
Please also search the Internet for better recordings/presentations of each topic we
discuss in class and share it with your friends.
In this course we will use MATLAB as an exercise tool for all kind of technical
computation like data and algorithm analysis, simulations, etc .
What is Signal?
Signal is the variation of a physical quantity with respect to one or more
independent variable
A signal is a function
RC circuit
8
Example 2: Vocoder Signal
Index
MT W T F
Fig. Stock exchange
10
is this a signal ?
11
Signal Processing
Process signal(s) for solving many scientific/ engineering/ theoretical purposes
H( z) =
å bk z -k
jwˆ
1- åaz - z=e
TIME-DOMAIN FREQ-DOMAIN
N M M
y[n] a y[n ] bk x[n k ] k jˆ k
b e
1 k 0 H (e jˆ ) k 0
N
1 ae jˆ
4/3/2024
14
1
Signal Processing First
LECTURE #1
Sinusoids
LECTURE OBJECTIVES
Acos(w t + j )
A cos(2 (440)t )
“A” is at 440 Hertz (Hz)
Waveform is a SINUSOIDAL SIGNAL
Computer plot looks like a sine wave
Mathematical representation
[Link]/tone-generator/
4/3/2024 2003 rws/jMc 18
SINUSOID AMPLITUDE EXAMPLES
0.25 sin(2π 300t) 0.5sin(2π 300t)
1 sin(2π 300t)
Tone Signals with Different Amplitudes:
4/3/2024 19
SINUSOID FREQUENCY EXAMPLES
1-)1.00sin(2π*300t)
2-)1.00*sin(2π*600t)
3-)1.00*sin(2π*1200t)
Amplitude = 1.00sin(2π*600t)
Amplitude = 1.00sin(2π*1200t)
4/3/2024 20
SINUSOID PHASE EXAMPLES
1-)1.00sin(2π*300t)
2-)1.00*sin(2π*300t+ π/2)
3-)1.00*sin(2π*300t+ π)
4/3/2024 21
HUMAN VOICE WITH DIFFERENT
SAMPLING FREQUENCIES
With the original sampling frequency Fs
4/3/2024 22
TIME VS FREQUENCY REPRESENTATION OF
ONE CLAP RECORD(SPECTROGRAM)
4/3/2024 23
TIME VS FREQUENCY REPRESENTATION OF
TWO CLAPS RECORD (SPECTROGRAM)
4/3/2024 24
Time vs Frequency Representation of Clap + Snap
Record (Spectrogram) (First Clap Then Finger Snap)
4/3/2024 25
TUNING FORK A-440 Waveform
T 8.15 5.85
2.3 ms
Time (sec)
f 1/ T
1000 / 2.3
435 Hz
4/3/2024 2003 rws/jMc 26
SPEECH EXAMPLE
Acos(w t + j )
FREQUENCY w
Radians/sec
AMPLITUDE
Magnitude
A
Hertz (cycles/sec)
w = (2p ) f
PERIOD (in sec)
PHASE j
1 2p
T= =
4/3/2024 f w 2003 rws/jMc 32
EXAMPLE of SINUSOID
Given the formula 5 cos(0.3 t 1.2 )
A=5
Formula defines w = 0.3p
Make a plot j = 1.2 p
5 cos(0.3 t 1.2 )
Determine period:
T 2 / 2 / 0.3 20 / 3
Determine a peak location by solving
(t ) 0 (0.3 t 1.2 ) 0
Zero crossing is T/4 before or after
Positive & Negative peaks spaced by T/2
4/3/2024 2003 rws/jMc 34
PLOT the SINUSOID
5 cos(0.3 t 1.2 )
Use T=20/3 and the peak location at t=-4
20
3
A cos( (t tm )) A cos( t )
and we obtain: tm
or,
tm
4/3/2024 © 2003, JH McClellan & RW Schafer 38
SINUSOID from a PLOT
T 10period
.01sec
100
1
2
T 2
0.01 200
tm 0.00125 sec tm (200 )(tm ) 0.25
4/3/2024 © 2003, JH McClellan & RW Schafer 40
SINE DRILL (MATLAB GUI)
To solve: z2 = -1
z=j
Math and Physics use z = i
Complex number: z = x + j y
y z
Cartesian
coordinate
x system
z3 z1 z2
(4 j 3) (2 j5)
(4 2) j ( 3 5)
4/3/2024
6 j2
© 2003, JH McClellan & RW Schafer 45
*** POLAR FORM ***
Vector Form
Length =1
Angle =
Common Values
j has angle of 0.5
1 has angle of
j has angle of 1.5
also, angle of j could be 0.51.52
1 y
Tan x x r cos
x
Most calculators do
Polar-Rectangular y r sin
Need a notation for POLAR FORM
4/3/2024 © 2003, JH McClellan & RW Schafer 47
Euler’s FORMULA
Complex Exponential
Real part is cosine
Imaginary part is sine
Magnitude is one
j
e cos( ) j sin( )
j
re r cos( ) jr sin( )
4/3/2024 © 2003, JH McClellan & RW Schafer 48
COMPLEX EXPONENTIAL
j t
e cos( t ) j sin( t )
Interpret this as a Rotating Vector
t
Angle changes vs. time
ex: rad/s
Rotates in 0.01 secs
j
e cos( ) j sin( )
4/3/2024 © 2003, JH McClellan & RW Schafer 49
cos = REAL PART
Real Part of Euler’s
j t
cos( t ) e{ e }
General Sinusoid
x(t ) A cos( t )
So, j ( t )
A cos( t ) e{ Ae }
j j t
e{ Ae e }
4/3/2024 © 2003, JH McClellan & RW Schafer 50
REAL PART EXAMPLE
Acos( t ) e Ae e j j t
Evaluate:
Answer:
x(t ) e 3 je j t
x (t ) e ( 3 j )e j t
e 3e
4/3/2024
j 0.5
e j t
3cos( t 0.5 ) 51
© 2003, JH McClellan & RW Schafer
COMPLEX AMPLITUDE
General Sinusoid
x(t ) A cos( t ) e Ae e j jt
Complex AMPLITUDE = X
jt j
z (t ) Xe X Ae
Then, any Sinusoid = REAL PART of Xejt
x(t ) e Xe jt
eAe j
e jt
4/3/2024 © 2003, JH McClellan & RW Schafer 52
AVOID Trigonometry
Algebra, even complex, is EASIER !!!
Can you recall cos(1+2) ?
Use: real part of ej 1 2 = cos( + ) 1 2
j (1 2 ) j1 j 2
e e e
(cos1 j sin 1 )(cos 2 j sin 2 )
(cos1 cos 2 sin 1 sin 2 ) j (...)
4/3/2024 © 2003, JH McClellan & RW Schafer 54
Ex: Find Complex Amplitude
Find the COMPLEX AMPLITUDE for:
x(t ) 3 cos(77 t 0.5 )
Use EULER’s FORMULA:
x(t ) e 3e j ( 77 t 0.5 )
e 3e j 0.5
e j 77 t
j 0.5
4/3/2024 X 3e
© 2003, JH McClellan & RW Schafer 59
WANT to ADD TWO SINUSOIDS
(SAME FREQUENCY)
x3
(t ) 2 cos(77 t ) 3
4/3/2024 © 2003, JH McClellan & RW Schafer 64
ADD SINUSOIDS
x3 (t ) x1 (t ) x2 (t )
X1
VECTOR
X3
(PHASOR)
ADD
x1 (t ) cos(77 t )
x2 (t ) cos(77 t 0.5 )
x3 (t ) x1 (t ) x2 (t ) A cos(wt )
[Link]
[Link]
Lecture 4
Spectrum Representation
This Lecture:
Chapter 3, Section 3-1
Other Reading:
Appendix A: Complex Numbers
10
j / 3 j / 3
7e 7e
j / 2 j / 2
4e 4e
A cos(7t ) A e j 7t A e j 7t
2 2
One has a positive frequency
The other has negative freq.
Amplitude of each is half as big
[Link]
1 j 0.5 1 j 0.5
(2 A)e (2 A)e
-7 0 7
x(t ) 10
j / 3 j 2 (100) t j / 3 j 2 (100) t
7e e 7e e
j / 2 j 2 ( 250) t j / 2 j 2 ( 250) t
4e e 4e e
4/3/2024 © 2003, JH McClellan & RW Schafer 17
Simplify Components
x(t ) 10
j / 3 j 2 (100) t j / 3 j 2 (100) t
7e e 7e e
j / 2 j 2 ( 250) t j / 2 j 2 ( 250) t
4e e 4e e
Use Euler’s Formula to get REAL sinusoids:
j j t j j t
A cos( t ) Ae 1
2
e 1
Ae
2
e
4/3/2024 © 2003, JH McClellan & RW Schafer 18
FINAL ANSWER
N
x(t ) X 0 e X k e j 2 f k t
j k
k 1 X k Ak e
e{z} 12 z 1 z Frequency f k
2
N
x (t ) X 0 1
2
Xke j 2 f k t
1
2
j 2 f k t
Xke
k 1
4/3/2024 © 2003, JH McClellan & RW Schafer 20
Example: Synthetic Vowel
0.5Ak
k
Lecture 5
Periodic Signals, Harmonics
& Time-Varying Sinusoids
Next Lecture:
Fourier Series ANALYSIS
Sections 3-4, 3-5 and 3-6
j ( t T ) j t
e e e j 2 k 1
jT
e 1 T 2 k
2 k 2
k 0k k = integer
4/3/2024
T T
© 2003, JH McClellan & RW Schafer 32
Harmonic Signal Spectrum
N
x (t ) X 0 1
2
X ke j 2 kf0t
1
2
j 2 kf0t
X ke
k 1
4/3/2024 © 2003, JH McClellan & RW Schafer 33
Define FUNDAMENTAL FREQ
N
x(t) = A0 + Ak cos(2p kf0 t + fk )
k=1
fk = k f0 (w 0 = 2p f0 ) 1
f0
T0
f0 = fundamental Frequency
T0 = fundamental Period
4/3/2024 © 2003, JH McClellan & RW Schafer 34
Harmonic Signal (3 Freqs)
3rd
5th
3rd
5th
NOT
4/3/2024 © 2003, JH McClellan & RW Schafer PERIODIC
39
FREQUENCY ANALYSIS
Given a recording of a song, have the
computer write the music
IDEAL
1
4
e j / 2 1
4
e j / 2 1
4
e j / 2 1
4
e j / 2
648 Hz ? 24 Hz ?
4/3/2024 © 2003, JH McClellan & RW Schafer 46
STEPPED FREQUENCIES
C-major SCALE: successive sinusoids
Frequency is constant for each note
IDEAL
From SPECGRAM
ANALYSIS PROGRAM
ARTIFACTS at Transitions
Sinusoids ONLY
Analysis Frame = 40ms
ARTIFACTS at Transitions
For Sinusoid:
x(t ) A cos( 2 f 0t )
(t ) 2 f 0t Makes sense
i (t ) dt
d (t ) 2 f
0
4/3/2024 © 2003, JH McClellan & RW Schafer 52
INSTANTANEOUS FREQ
of the Chirp
x(t ) A cos( t t ) 2
(t ) t t 2
i ( t ) d (t )
dt
2 t
4/3/2024 © 2003, JH McClellan & RW Schafer 53
CHIRP SPECTROGRAM
x (t ) A cos( cos( t ) )
i (t ) d
dt
(t ) sin( t )
(t) could be speech or music:
FM radio broadcast
1
Continuous-Time (CT) vs. Discrete-Time (DT)
Graphically,
x[n ]
x(t )
... x[3] x[ 2] ...
x[2] x[1]
x[1] x[0]
0 t ... -3 -2 -1 0 1 2 3 4 ... n
(Fig.1.7 Oppenheim)
2
Total energy of a CT signal x(t ) over t1 t t2 is x(t ) dt
t1 t
1 2
2
Average power of x(t) (The time average of total energy) is x (t ) dt
(t2 t1 ) t1
n2
x[n]
2
Similarly, total energy of a DT signal x[n ] over n1 n n2 is
n1
2 2
E lim x(t ) dt x(t ) dt Total energy in CT signal
T T
D N
2 2
E = lim x [n ] = x [n ] Total energy in DT signal
N n =- N n =-
In order to define the power over infinite intervals we need to take limit of
the average:
5
Transformation of Independent
Variable
6
Examples of Transformations
x[n]
Time shift
... ... n
x[n-n0]
........ ... n
n0
If n0 > 0 x[n-n0] is the delayed version of x[n]
(Each point in x[n] occurs later in x[n-n0])
7
Examples of Transformations
x(t)
Time shift
x(t-t0)
t
t0
t0 < 0 x(t-t0) is an advanced version of x(t)
8
Examples of Transformations
x(t)
9
Examples of Transformations
x(t)
Time scaling
x(2t)
compressed!
t
x(t/2)
stretched!
t
10
Examples of Transformations
It is possible to transform the independent variable with a general nonlinear
function h(t) ( we can find x(h(t)))
However, we are interested in 1st order polynomial transforms of t, i.e., x(t+)
x(t)
1
Given the signal x(t):
t
0 1 2
x(t+1)
Let us find x(t+1): 1
t
-1 0 1
x((3/2)t+1)
1
t
12 -2/3 0 2/3
Periodic CT Signals
2T T 0
2T
T
14
Even and Odd Signals
If x(t ) x(t ) or x[n] x[n] even signal (symmetric wrt y-axis)
x(t) x(t)
even odd
t t
C t C
t
16
Exponential and Sinusoidal Signals
2
The fundamental period is T0
0
Thus, the signals ejω0t and e-jω0t have the same fundamental
period 17
Exponential and Sinusoidal
Signals
Alternatively,
A cos(0t ) A Re e j (0t )
A sin( t ) A Ime
0
j (0t )
2
T0
x(t ) 0
A cos
CT sinusoidal signal
A cos(0t )
t
x(t ) A cos(0t )
19
Exponential and Sinusoidal Signals
Complex periodic exponential and sinusoidal signals are of infinite
total energy but finite average power
T T0 T T0
j 0 t 2
E period
T
e dt 1 dt
T
(T T0 ) T T0
1
Pperiod E period 1
(T T0 ) T
We have the conditions from (*) and (**) that m and N must be integers.
m
So DT exp is periodic when 0 is a rational number, not periodic otherwise! !!
2 N
27
Periodicity Properties of DT
Signals
2
The fundamenta l period is then N m (* ***)
0
0
Therefore to find the fund. freq. of a complex exp. we need to express as in (* * *)
2
(The same developmen t is also valid for DT sinusoidal signals.)! !
28
Periodicity Properties of DT
Signals: Examples
30
Periodicity Properties of DT
Signals: Examples 0 m
(* * *)
2 N
if
x(t ) cos 8t
31
and
x[n] cos 8n
31
x(t) is periodic with 31/4.
0 4
In DT there can be no fractional periods, for x[n] we have
2 31
then N=31.
6
If x(t ) cos t and 6
x[n] cos n
0 1
x(t) is periodic with 12, but x[n] is NOT periodic, because there is
no way to express it as in (***). 2 12
31
Unit Impulse and Unit Step
Functions (Continuous-Time)
0, t 0 u(t)
CT unit step: u (t )
1, t 0 t
δ(t)
34
Continuous-Time Impulse
REMARKS:
Signal of a unit area
Derivative of unit step function
Sampling property
x(t ) (t t0 ) x(t0 ) (t t0 )
The integral of product of (t) and (t) equals (0) for
any (t) continuous at the origin and if the interval of
integration includes the origin, i.e.,
t2
( ) ( )d
t1
(0) for t1 0 t 2
35
Unit Impulse and Unit Step
Functions
Basic signals used to construct and represent other signals
0, n 0 δ[n]
[ n] Unit impulse (unit sample)
u[n]
0, n 0
u[n]
DT unit step: 1, n 0 - - - - - -
n
Lecture 6B
Fourier Series Coefficients
This Lecture:
Fourier Series in Ch 3, Sects 3-4, 3-5 & 3-6
Replaces pp. 62-66 in Ch 3 in DSP First
Notation: ak for Fourier Series
Other Reading:
Next Lecture: More Fourier Series
N
x (t ) Xa0 { aXkk e j 2 f k t * j 2 f k t
1
2
1
2 aXkk e
k 1
4/3/2024 © 2003, JH McClellan & RW Schafer 41
Jean Baptiste Joseph Fourier
1807 thesis: “On the Propagation of Heat in Solid Bodies”
Fourier accompanied Napoleon Bonaparte on his Egyptian expedition in 1798, as scientific adviser, and was
appointed secretary of the Institut d'Égypte. Fourier was appointed as Prefect (Governor) of Department of
Isère, Granoble, by Napoleon in 1802 after a brief return to his former position as Professor of Analysis at
the Ecole Polytechnique in Paris.
[Link]
4/3/2024 © 2003, JH McClellan & RW Schafer 42
Harmonic Signal
x (t ) ak e j 2 k f 0 t
k
PERIOD/FREQUENCY of COMPLEX EXPONENTIAL:
2 1
2 f 0 0 or T0
T0 f0
[Link]
es_square_wave_circles_animation.svg
4/3/2024 © 2003, JH McClellan & RW Schafer 43
Fourier Series Synthesis
x (t ) ak e j 2 k f 0 t
k
j k
ak X k Ak e
1
2
1
2
N
x (t ) A0 Ak cos(2 kf 0t k )
k 1
COMPLEX
j k
X k Ak e AMPLITUDE
T = 0.1
SYNTHESIS ANALYSIS
Easy Hard
Given (k,Ak,k) create Given x(t), extract
x(t) (k,Ak,k)
How many?
Synthesis can be Need algorithm for
HARD computer
Synthesize Speech so that
it sounds good
1
T0
0 k
j ( 2 / T0 ) t j ( 2 / T0 ) kt
T0 0
e e dt
1 k
T0
1 j ( 2 / T0 )( k ) t
T0 0
e dt
k
T0 T0
j ( 2 / T0 ) k t j ( 2 / T0 ) t
k
j ( 2 / T0 ) t
1
T0 x (t )e dt 1
T0
ak e e
dt
0 0
T0 T0
1
T0 x ( t ) e j ( 2 / T0 ) t
dt a k
T0
1 e j ( 2 / T0 ) k t
e j ( 2 / T0 ) t
dt a
k
0 0
Integral is zero
T0
ak 1
T0 x ( t ) e j ( 2 / T0 ) k t
dt except for k
0
4/3/2024 © 2003, JH McClellan & RW Schafer 50
SQUARE WAVE EXAMPLE
1 0 t 12 T0
x (t )
1T t T
0 2 0 0
for T0 0.04 sec.
x(t)
1
k
1 j ( ) k 1 ( 1)
(e 1)
( j 2 k ) j 2 k
4/3/2024 © 2003, JH McClellan & RW Schafer 52
DC Coefficient: a0
T0
1 j ( 2 / T0 ) kt
ak x ( t ) e dt ( k 0)
T0 0
T0
1 1
a0
T0 x(t )dt T0 (Area )
0
.02
1 1
a0
.04 0
1 dt
.04
(.02 0) 1
2
1
k 1,3,
k j k
1 ( 1)
ak 0 k 2,4,
j 2 k
21 k 0
4/3/2024 © 2003, JH McClellan & RW Schafer 54
Spectrum from Fourier Series
j
k k 1,3,
0 2 /(0.04) 2 (25)
ak 0 k 2,4,
12 k 0
j j 9 t 3 j j 3 t 3 j j 3 t j j 9 t
x (t ) e e e e
8 8 8 8
4/3/2024 © 2003, JH McClellan & RW Schafer 56
Example x (t ) sin (3 t ) 3
j j 9 t 3 j j 3 t 3 j j 3 t j j 9 t
x (t ) e e e e
8 8 8 8
In this case, analysis
just requires picking
off the coefficients.
ak
k 1 k 1
k 3 k 3
j ( 2 / T0 )( k 1) t T0 / 2 j ( 2 / T0 )( k 1) t T0 / 2
e e
j 2T0 ( j ( 2 / T0 )( k 1))
j 2T0 ( j ( 2 / T0 )( k 1))
4/3/2024 © 2003, JH McClellan & RW Schafer 59
0 0
FS: Rectified Sine Wave
{ak}
j ( 2 / T0 )( k 1) t T0 / 2 j ( 2 / T0 )( k 1) t T0 / 2
e e
ak j 2T0 ( j ( 2 / T0 )( k 1))
j 2T0 ( j ( 2 / T0 )( k 1))
0 0
1
4 ( k 1)
e j ( 2 / T0 )( k 1)T0 / 2
1 4 (1k 1) e j ( 2 / T0 )( k 1)T0 / 2 1
1
4 ( k 1) e j ( k 1)
1 4 (1k 1) e j ( k 1) 1
0 k odd
k 1 ( k 1)
4 ( k 2 1)
k
1
(1) 1 ?j 4 k 1
1 k even
( k 2 1)
4/3/2024 © 2003, JH McClellan & RW Schafer 60
Fourier Series Synthesis
HOW do you APPROXIMATE x(t) ?
T0
j ( 2 / T0 ) k t
ak 1
T0 x ( t ) e dt
0
Use FINITE number of coefficients
N
x (t ) ak e j 2 k f 0 t
ak ak* when x (t ) is real
k N
4/3/2024 © 2003, JH McClellan & RW Schafer 61
Fourier Series Synthesis
[Link]
x (t ) sin (3 t ) 3
4/3/2024 © 2003, JH McClellan & RW Schafer 72
Selected Problems/Demos 1.1
j 3 j j 3 t 3 j j 3 t j j 9 t
x (t ) e j 9 t e e e
8 8 8 8
j 3 j j 3 t 3 j j 3 t j j 9 t
4/3/2024
x (t ) e j 9 t © 2003, JHMcClellan
e & RW e
Schafer e 75
8 8 8 8
Selected Problems/Demos 2.
Determine the Instantaneous Frequency of a Chirp Signal
Study at home:
A-2
B-4
C-5
D-3
E-1
Sampling is the technique used for recording analog signal information like audio
signals or images by recording their snapshots at periodic time intervals (Ts).
For example, with the sampling rate of 10 Hz, the 13 Hz sine signal will be converted
into 3 Hz.
Aliased
Antialiased
4/3/2024 © 2003, JH McClellan & RW Schafer 8
LECTURE OBJECTIVES
SAMPLING can cause ALIASING
Nyquist/Shannon Sampling Theorem
Sampling Rate (fs) > 2 fmax(Signal bandwidth)
x(t) y(t)
SYSTEM
PROCESSING GOALS:
We need to change x(t) into y(t) for many
engineering applications:
For example, more BASS, image deblurring,
denoising, etc
x(t) y(t)
ELECTRONICS
DIGITAL/MICROPROCESSOR
Convert x(t) to numbers stored in memory
x(t) x[n]=x(nTs)
A-to-D
f s = 2 kHz
f s = 500Hz
HOW OFTEN ?
DEPENDS on FREQUENCY of SINUSOID
ANSWERED by NYQUIST/SHANNON/KOTELNIKOV
ALSO DEPENDS on “RECONSTRUCTION”
2f
ˆ Ts
fs
4/3/2024 © 2003, JH McClellan & RW Schafer 19
SPECTRUM (DIGITAL)
f 1
X
* 1
X
ˆ 2 2 2
fs
f s 1 kHz –2 2 wˆ
x[n ] A cos(2 (100)( n / 1000) )
fs
f s = 100 Hz –2 2 wˆ
x[n ] A cos(2 (100)( n / 100) )
[Link]
Q
A cos(wˆ n + j ) = A cos((wˆ + 2p )n + j )
4/3/2024 © 2003, JH McClellan & RW Schafer 23
ALIASING DERIVATION
Other Frequencies give the same wˆ
x1 (t ) cos(400 t ) sampled at f s 1000 Hz
x1[n ] cos(400 1000
n
) cos(0.4 n )
x2 (t ) cos(2400 t ) sampled at f s 1000 Hz
x2 [n ] cos(2400 1000
n
) cos(2.4 n )
A-to-D
Convert x(t) to numbers stored in memory
D-to-A
Convert y[n] back to a “continuous-time” signal,
y(t)
y[n] is called a “discrete-time” signal
y(t)
t
kTs (k+1)Ts
y[k] STAIR-STEP
y(t) APPROXIMATION
t
kTs (k+1)Ts
EASIER TO RECONSTRUCT
SQUARE PULSE:
å y[n]p(t - nT ) =
n= - ¥
s
CALLED
“BANDLIMITED
INTERPOLATION”
t
sin Ts
p (t ) t
for t
Ts
p(t ) 0 for t Ts , 2Ts ,
4/3/2024 © 2003, JH McClellan & RW Schafer 48
PRACTICAL PULSE
USING AWGN-Gaussian Noise
1st,2nd, 3rd, 4 deriative of Gaussian
a first derivative using the 2-point central-difference method, deriv1, an unsmoothed first derivative using adjacent differences,
deriv2, a second derivative using the 3-point central-difference method,
a third derivative deriv3 using a 4-point formula, and deriv4, a 4th derivative using a 5-point formula.
[Link]
function d=deriv1(a)
% First derivative of vector using simple adjacent differences.
% Example: deriv([1 1 1 2 3 4]) returns [0 0 0 1 1 1]
% T. C. O'Haver, 2013.
n=length(a);
d=zeros(size(a));
d(1)=a(2)-a(1);
for j = 2:n;
d(j)=a(j)-a(j-1);
end
4/3/2024 © 2003, JH McClellan & RW Schafer 49
PRACTICAL PULSE
USING AWGN-Gaussian Noise
1st,2nd, 3rd, 4 deriative of Gaussian
a first derivative using the 2-point central-difference method, deriv1, an unsmoothed first derivative using adjacent differences,
deriv2, a second derivative using the 3-point central-difference method,
a third derivative deriv3 using a 4-point formula, and deriv4, a 4th derivative using a 5-point formula.
[Link]
function d=deriv1(a)
% First derivative of vector using simple adjacent differences.
% Example: deriv([1 1 1 2 3 4]) returns [0 0 0 1 1 1]
% T. C. O'Haver, 2013.
n=length(a);
d=zeros(size(a));
d(1)=a(2)-a(1);
for j = 2:n;
d(j)=a(j)-a(j-1);
end
4/3/2024 © 2003, JH McClellan & RW Schafer 50
Selected Problems/Demos
Check! Depict MATLAB plots of these two signals to verify that the phase must change sign
to have identical plots?
4/3/2024 © 2003, JH McClellan & RW Schafer 52
Selected Problems/Demos
Sampling & aliasing given continuous-time spectrum
Acos(w t + j )
FREQUENCY
Radians/sec
w AMPLITUDE
A
Magnitude
Hertz (cycles/sec)
w = (2p ) f
PERIOD (in sec)
1 2p
PHASE
j
T= =
4/3/2024 f w 2003 rws/jMc 4
SINUSOID from a PLOT
Vector Form
Length =1
Angle =
Common Values
j has angle of 0.5
1 has angle of
j has angle of 1.5
also, angle of j could be 0.51.52
Complex Exponential
Real part is cosine
Imaginary part is sine
Magnitude is one
j
e cos( ) j sin( )
j
re r cos( ) jr sin( )
4/3/2024 © 2003, JH McClellan & RW Schafer 7
COMPLEX AMPLITUDE
General Sinusoid
x(t ) A cos( t ) e Ae e j j t
Complex AMPLITUDE = X
j t j
z (t ) Xe X Ae
Then, any Sinusoid = REAL PART of Xejt
x(t ) e Xe j t
eAe j
e j t
4/3/2024 © 2003, JH McClellan & RW Schafer 8
Spectrum Representation
10
j / 3 j / 3
7e 7e
j / 2 j / 2
4e 4e
x (t ) 10
j / 3 j 2 (100) t j / 3 j 2 (100) t
7e e 7e e
j / 2 j 2 ( 250) t j / 2 j 2 ( 250) t
4e e 4e e
4/3/2024 © 2003, JH McClellan & RW Schafer 11
Fourier Series:
LECTURE OBJECTIVES
Work with the Fourier Series Integral
T0
j ( 2 k / T0 ) t
ak 1
T0
0
x (t )e dt
ANALYSIS via Fourier Series
For PERIODIC signals: x(t+T0) = x(t)
Later: spectrum from the Fourier Series
1 0 t 12 T0
x (t )
1T t T
0 2 0 0
for T0 0.04 sec.
x(t)
1
.02
1 j ( 2 / .04 ) kt
.02
j ( 2 / .04 ) kt
ak 1 e dt 1
.04 ( j 2 k / .04 )
e
.04 0 0
k
1 j ( ) k 1 ( 1)
(e 1)
( j 2 k ) j 2 k
4/3/2024 © 2003, JH McClellan & RW Schafer 14
Spectrum from Fourier Series
j
k k 1,3,
0 2 /(0.04) 2 (25)
ak 0 k 2,4,
12 k 0
HOW OFTEN ?
DEPENDS on FREQUENCY of SINUSOID
ANSWERED by NYQUIST/SHANNON/KONELIKOV
ALSO DEPENDS on “RECONSTRUCTION”
CALLED
“BANDLIMITED
INTERPOLATION”
t
sin Ts
p (t ) t
for t
Ts
p(t ) 0 for t Ts , 2Ts ,
4/3/2024 © 2003, JH McClellan & RW Schafer 18
Signal Processing First
Filtering Intro
For the price of a small house, you could have one of these.
4/3/2024
Now it plays video
© 2003, JH McClellan & RW Schafer 24
FILTERED STOCK SIGNAL
INPUT
OUTPUT
LOG SCALE
Double every
18 months ?
Double every
18 months ?
x[n] y[n]
SYSTEM
4/3/2024
Fig.5.2 © 2003, JH McClellan & RW Schafer 29
3-PT AVERAGE SYSTEM
ADD 3 CONSECUTIVE NUMBERS
Do this for each “n”
Make a TABLE
n=0
4/3/2024 n=1
© 2003, JH McClellan & RW Schafer 30
INPUT SIGNAL
OUTPUT SIGNAL
“n” is TIME
Lecture 11-Chapter5
FILTER
y[n ] bk x[n k ]
k 0
4/3/2024 © 2003, JH McClellan & RW Schafer 42
SPECIAL INPUT SIGNALS
1 n 0
[n ]
0 n 0
UNIT-IMPULSE
1
n
4/3/2024 © 2003, JH McClellan & RW Schafer 43
FIR IMPULSE RESPONSE
M M
h[n ] bk [n k ] y[n ] bk x[n k ]
k 0 k 0
4/3/2024 © 2003, JH McClellan & RW Schafer 44
MATH FORMULA for h[n]
0 4 n
–1
bk { 1, 1, 2, 1, 1 }
4/3/2024 © 2003, JH McClellan & RW Schafer 45
LTI: Convolution Sum
Output = Convolution of x[n] & h[n]
NOTATION: y[n ] h[n ] x[n ]
Here is the FIR case:
FINITE LIMITS
M
y[n ] h[k ] x[n k ]
k 0
Same as bk FINITE LIMITS
4/3/2024 © 2003, JH McClellan & RW Schafer 46
CONVOLUTION Example
h[n ] [n ] [n 1] 2 [n 2] [n 3] [n 4]
x[n ] u[n ]
h[0] x[n ]
h[1] x[n 1]
h[2] x[n 2]
h[3] x[n 3]
h[4] x[n 4]
4/3/2024 © 2003, JH McClellan & RW Schafer 47
GENERAL FIR FILTER
SLIDE a Length-L WINDOW over x[n]
x[n-M] x[n]
4/3/2024 © 2003, JH McClellan & RW Schafer 48
DCONVDEMO: MATLAB GUI
Find y[n]
y[n ] u[n ] u[n 1] [n ]
4/3/2024 © 2003, JH McClellan & RW Schafer 50
HARDWARE STRUCTURES
x[n] y[n] M
FILTER y[n ] bk x[n k ]
k 0
y[n ] x1[n ] x2 [n ]
y[n ] x[n ]
4/3/2024
y[n ] x[n 1]
© 2003, JH McClellan & RW Schafer 52
FIR STRUCTURE
Direct Form M
y[n ] bk x[n k ]
SIGNAL
FLOW GRAPH k 0
M
y[n ] bk x[n k ]
k 0
x[n] y[n]
SYSTEM
MATHEMATICAL DESCRIPTION
TIME-INVARIANCE
LINEARITY
CAUSALITY
“No output prior to input”
IDEA:
“Time-Shifting the input will cause the same
time-shift in the output”
EQUIVALENTLY,
We can prove that
The time origin (n=0) is picked arbitrary
SUPERPOSITION:
“Adding two inputs gives an output that is the
sum of the individual outputs”
S1 S2
S1 S2
S2 S1
4/3/2024 © 2003, JH McClellan & RW Schafer 63
CONVOLUTION Example
1 n 0
[n ]
0 n 0
UNIT-IMPULSE
1
n
4/3/2024 © 2003, JH McClellan & RW Schafer 65
UNIT IMPULSE SIGNAL [n]
n3
[n] is NON-ZERO [n 3]
When its argument
is equal to ZERO
M M
y[n ] bk x[n k ] y[n ] h[k ] x[n k ]
k 0 k 0
CONVOLUTION
4/3/2024 © 2003, JH McClellan & RW Schafer 71
FILTERING EXAMPLES
6
y7 [n ] 17 x[n k ]
7-point AVERAGER k 0
Smooth compared to 3-point Averager
By making its amplitude (A) smaller
2
y3[n ] 13 x[n k ]
3-point AVERAGER
Changes A slightly
k 0
Time domain
x[n]
h[n] y[n]
This Lecture:
Chapter 6, Sections 6-1, 6-2, 6-3, 6-4, & 6-5
Other Reading:
Recitation: Chapter 6
FREQUENCY RESPONSE EXAMPLES
Next Lecture: Chap. 6, Sects. 6-6, 6-7 & 6-8
MAG
FREQUENCY RESPONSE of FIR
PHASE
PLOTTING vs. Frequency
MAGNITUDE vs. Freq jˆ jˆ jH ( e jˆ )
PHASE vs. Freq H (e ) H (e ) e
• Sinusoid IN ------ (LTI) ---> Sinusoid OUT
At the SAME Frequency
4/3/2024 © 2003, JH McClellan & RW Schafer 5
DOMAINS: Time & Frequency
M M
y[n] bk x[n k ] h[k ]x[n k ]
k 0 k 0
FIR DIFFERENCE EQUATION
M jˆ ( k )
bk e
j jˆ n
Ae e
k 0
j jˆ n
H (ˆ ) Ae e
4/3/2024 © 2003, JH McClellan & RW Schafer 8
FREQUENCY RESPONSE
At each frequency, we can DEFINE
M M
H (e ) bk e
jˆ jˆ k
H (ˆ ) bk e jˆ k
k 0 k 0
Complex-valued formula
Has MAGNITUDE vs. frequency
And PHASE vs. frequency
Notation: H ( e jˆ ) in place of H (ˆ )
4/3/2024 © 2003, JH McClellan & RW Schafer 9
EXAMPLE 6.1
{bk } { 1, 2, 1 }
Since ( 2 2 cos ˆ ) 0
jˆ
Magnitude is H ( e ) ( 2 2 cos ˆ )
and Phase is H ( e jˆ ) ˆ
4/3/2024 © 2003, JH McClellan & RW Schafer 10
PLOT of FREQ RESPONSE
{bk } {1,2,1}
̂
H ( e jˆ ) ( 2 2 cos ˆ )e jˆ RESPONSE at /3
4/3/2024
̂ (radians)
© 2003, JH McClellan & RW Schafer 11
EXAMPLE 6.2
jˆ
Find y[n] when H (e ) is known
j / 4 j ( / 3) n
and x[n] 2e e
x[n] ĵ y[n]
H (e )
jˆ jˆ
H ( e ) ( 2 2 cos ˆ )e
4/3/2024 © 2003, JH McClellan & RW Schafer 12
EXAMPLE 6.2 (answer)
j / 4 j ( / 3) n
Find y[n ] when x[n ] 2e e
jˆ
One Step - evaluate H ( e ) at ˆ / 3
jˆ jˆ
H ( e ) ( 2 2 cos ˆ )e
jˆ j / 3
H (e ) 3e @ ˆ / 3
y[n ] 3e j / 3
2e j / 4 j ( / 3) n
e 6 e j /12e j ( / 3) n
HH = freqz(bb,1,ww)
VECTOR bb contains Filter Coefficients
SP-First: HH = freekz(bb,1,ww)
k 0
4/3/2024 © 2003, JH McClellan & RW Schafer 19
Time & Frequency Relation
M M
H (e ) bk e
jˆ jˆ k
h[k ] e jˆ k
k 0 k 0
IMPULSE RESPONSE
Equivalent Representations
x[n] y[n]
h[n]
{bk } { 0, 1 }
ĵ
H (e )
x[n] ĵ y[n]
e
wˆ wˆ
4/3/2024 © 2003, JH McClellan & RW Schafer 22
FIRST DIFFERENCE SYSTEM
jˆ
Find h[n] and H (e ) for theDifference
Equation : y[n] x[n] x[n 1]
x[n] y[n]
[n] [n 1]
ĵ
H (e )
x[n] ĵ y[n]
1 e
4/3/2024 © 2003, JH McClellan & RW Schafer 23
DLTI Demo with Sinusoids
[n] h1[n] h2 [n ]
S1 h1[n] S2 h1[n ] h2 [n]
1 k 0 H ( e jˆ ) k 0
N
1 ae jˆ
4/3/2024 5
© 2003, JH McClellan & RW Schafer
1
Recall: Delay by nd
y[n ] x[n nd ]
CAUSALITY
NOT USING FUTURE OUTPUTS or INPUTS
MATLAB
yy = filter([3,-2],[1,-0.8],xx)
u[n] = 1, for n ⇡ 0
4/3/2024 © 2003, JH McClellan & RW Schafer 17
IMPULSE RESPONSE
DIFFERENCE EQUATION:
y[n] = 0.8y[n -1]+ 3x[n]
Find h[n]
n
h[n] = 3(0.8) u[n]
CONVOLUTION in TIME-DOMAIN
n 0 n 0
b0
1
if z a1
1 a1 z
4/3/2024 © 2003, JH McClellan & RW Schafer 21
H(z) = z-Transform{ h[n] }
b0
H(z) = -1
1 - a1 z
4/3/2024 © 2003, JH McClellan & RW Schafer 22
H(z) = z-Transform{ h[n] }
MULTIPLICATION of z-TRANSFORMS
X(z) Y(z) = H(z)X(z)
H(z)
CONVOLUTION in TIME-DOMAIN
u[n] = 1, for n ⇡ 0
FIRST-ORDER CASE:
b0 = 1, a1 = a
n
h[n] = a u[n]
Original
Original
x(n) y(n)
M
Lecture 17
IIR Filters: H(z) and
Frequency Response
1 k 0 H ( e jˆ ) k 0
N
1 ae jˆ
4/3/2024 © 2003, JH McClellan & RW Schafer 40
1
H(z) = z-Transform{ h[n] }
b0
H(z) = -1
1 - a1 z
4/3/2024 © 2003, JH McClellan & RW Schafer 41
Typical IMPULSE Response
n n
h[n] = b0 (a1) u[n] = 3(0.8) u[n]
n b
h[n] = ba u[n] H(z) = -1
1- az
GEOMETRIC SEQUENCE:
H ( z ) b0 a1n z n b0 (a1 z 1 ) n
n 0 n 0
b0
if z a1
1 a1 z 1
4/3/2024 © 2003, JH McClellan & RW Schafer 43
DELAY PROPERTY of X(z)
DELAY in TIME<-->Multiply X(z) by z-1
x[n] X(z)
x[n - 1] z X(z) -1
1
3 2z
Y ( z )
1
X ( z )
1 0.8 z
4/3/2024 © 2003, JH McClellan & RW Schafer 47
CONVOLUTION PROPERTY
MULTIPLICATION of z-TRANSFORMS
X(z) Y(z) = H(z)X(z)
H(z)
CONVOLUTION in TIME-DOMAIN
2 2( 45 ) 1 9
POLE at z=0.8
H ( z) 1
2
1 0.8( 45 ) 0
4/3/2024 © 2003, JH McClellan & RW Schafer 50
POLE-ZERO PLOT
ZERO at z = -1
POLE at
-1
2 + 2z z = 0.8
-1
1 - 0.8z
4/3/2024 © 2003, JH McClellan & RW Schafer 51
FREQUENCY RESPONSE
SYSTEM FUNCTION: H(z)
H(z) has DENOMINATOR
FREQUENCY RESPONSE of IIR
We have H(z)
jwˆ
H(e ) = H(z ) z = e jwˆ
THREE-DOMAIN APPROACH
jwˆ
h[n] H(z) H(e )
4/3/2024 © 2003, JH McClellan & RW Schafer 52
FREQUENCY RESPONSE
EVALUATE on the UNIT CIRCLE
jwˆ
H(e ) = H(z ) z = e jwˆ
WHERE is
the POLE ?
UNIT CIRCLE
4/3/2024 © 2003, JH McClellan & RW Schafer 57
MOVIE for H(z) in 3-D
POLES to H(z) to Frequency Reponse
TWO POLES SHOWN
b
h[n] = ba n u[n] H(z) =
1 - a z-1 h(n) and H(z) for 1st order IIR
Lets H(z)
observe
what
happens
when pole
moves H ( e ĵ )
towards left
h[n]
4/3/2024
5/24/21 ©©2003,
2003,JH
JHMcClellan
McClellan&&RW
RWSchafer
Schafer 73
51
3 DOMAINS MOVIE: IIR
4/3/2024
5/24/21 © 2003, JH McClellan & RW Schafer 75
53
3 DOMAINS MOVIE: IIR
4/3/2024
5/24/21 © 2003, JH McClellan & RW Schafer 76
54
3 DOMAINS MOVIE: IIR
4/3/2024
5/24/21 © 2003, JH McClellan & RW Schafer 77
55
PeZ Demo: Pole-Zero Placing
-1
Given: 2 + 2z
H( z) = -1
1 - 0.8z
Find the Impulse Response, h[n]
Find the output, y[n]
When
x[n] = cos(0.25p n)
4/3/2024 © 2003, JH McClellan & RW Schafer 80
Evaluate FREQ. RESPONSE
z 1 is ˆ 0 2 + 2z - 1 ˆ
-1 at w = 0.25 p
1 - 0.8z
2 2( 22 j 22 ) j1.309
H ( z) j 0.25
5.182e
1 0.8e
y[n] = 5.182cos(0.25p n - 0.417p )
4/3/2024 © 2003, JH McClellan & RW Schafer 82
CASCADE EQUIVALENT
This Lecture:
Chapter 8, all
Other Reading:
Recitation: Ch. 8, all
POLES & ZEROS
Next Lecture: Chapter 9
TIME-DOMAIN FREQ-DOMAIN
M
bk e
N M jˆ k
y[n] a y[n ] bk x[n k ]
1 k 0 H (e jˆ ) k 0
N
1 ae jˆ
4/3/2024 © 2003, JH McClellan & RW Schafer 5
1
Z-TRANSFORM TABLES
= (re )
“RESONANCE” jq n
( pk )
n n jnq
=re
Find FREQUENCY RESPONSE
Depends on Pole Location jq
Close to the Unit Circle?
pole = re
Make BANDPASS FILTER r 1?
4/3/2024 © 2003, JH McClellan & RW Schafer 9
2nd ORDER EXAMPLE
n p
h[n] = (0.9) cos( 3 n)u[n]
-1
1 - 0.45z
-1 -2
4/3/2024
1 - 0.9z + 0.81z
© 2003, JH McClellan & RW Schafer 11
2nd ORDER Z-transform PAIR
GENERAL ENTRY for
n z-Transform TABLE
h[n] = r cos(qn)u[n]
1 - r cosq z -1
H(z) = -1 2 -2
1 - 2r cosq z + r z
n
h[n] = Ar cos(qn + j )u[n]
cos j - r cos(q - j )z -1
H(z) = A -1 2 -2
1 - 2r cos q z + r z
4/3/2024 © 2003, JH McClellan & RW Schafer 12
2nd ORDER EX: n-Domain
-1
1 - 0.45z
-1 -2
1 - 0.9z + 0.81z
y[n] = 0.9y[n - 1] - 0.81y[n - 2]+ x[n] - 0.45x[n - 1]
aa = [ 1, -0.9, 0.81 ];
bb = [ 1, -0.45 ];
nn = -2:19;
hh = filter( bb, aa, (nn==0) );
HH = freqz( bb, aa, [-pi,pi/100:pi] );
4/3/2024 © 2003, JH McClellan & RW Schafer 13
Complex POLE-ZERO PLOT
-2
1- z
-2
1 + 0.7225z
n p
h[n] = (0.9) cos( 3 n)u[n]
-1
1 - 0.45z
-1 -2
4/3/2024
1 - 0.9z + 0.81z
© 2003, JH McClellan & RW Schafer 17
Complex POLE-ZERO PLOT
-1
1 - 0.45z
-1 -2
1 - 0.9z + 0.81z
4/3/2024 © 2003, JH McClellan & RW Schafer 18
h[n]: Decays & Oscillates
“PERIOD”=12
n p
h[n] = (0.95) cos( 6 n)u[n]
-1
1 - 0.8227 z
-1 -2
4/3/2024
1 - 1.6454 z + 0.9025z
© 2003, JH McClellan & RW Schafer 19
Complex POLE-ZERO PLOT
-1
1 - 0.8227 z
-1 -2
1 - 1.6454 z + 0.9025z
4/3/2024 © 2003, JH McClellan & RW Schafer 20
3 DOMAINS MOVIE: IIR
POLE MOVES
H(z)
H()
h[n]
20 25
Y(z) = 9 + 9
-1 -1
1 + .8z 1- z
20 n 25
y[n] = ( -.8) u[n] + u[n]
9 9
25
y[n] as n
9
4/3/2024 © 2003, JH McClellan & RW Schafer 28
Stability
¥
Nec. & suff. condition: å h[n] < ¥
n= - ¥
n b
h[n] = b(a) u[n] H(z) = -1
1 - az
¥
n Pole must be
å b a < ¥ if a < 1 ↵ Inside unit circle
n=0
4/3/2024 © 2003, JH McClellan & RW Schafer 29
SINUSOID starting at n=0
We’ll look at an example in MATLAB
cos(0.2n)
Pole at –0.8, so an is (–0.8) n
There are two components:
TRANSIENT
Start-up region just after n=0; (–0.8) n
STEADY-STATE
Eventually, y[n] looks sinusoidal.
Magnitude & Phase from Frequency Response
2p
wˆ 0 =
10
need a1 < 1
4/3/2024 © 2003, JH McClellan & RW Schafer 32
STABILITY CONDITION
ALL POLES INSIDE the UNIT CIRCLE
UNSTABLE EXAMPLE: POLE @ z=1.1
x[n] = cos(0.2pn)u[n]
(pole)n
4/3/2024 © 2003, JH McClellan & RW Schafer 37
SPLIT Y(z) to INVERT
Need SUM of Terms:
FIR
L = 24
M=23
23 zeros
2z(z + 1)
2
z - z +1
4/3/2024 © 2003, JH McClellan & RW Schafer 45
POLES & ZEROS of IIR
3 POLES
3 POLES
EVALUATE H(z)
-2
EVERYWHERE 1- z
-2
1 + 0.7225z
UNIT CIRCLE
4/3/2024 © 2003, JH McClellan & RW Schafer 48
FLYING THRU Z-PLANE
H()
H(z)
POLES CAUSE
PEAKS in H(z)
Lecture 22- 23
the Fourier Transform
(Read: Chapter 11 in your book)
st
X ( s) x (t ) e dt LaplaceTransform
s j and 0
jwt
X ( jw) x (t ) e dt Fourier Transform
h (t ) e t u (t )
t 1
h(t ) e u(t ) H ( j )
1 j
4/3/2024 © 2003, JH McClellan & RW Schafer 6
Magnitude and Phase Plots
1 1 1
H ( j )
a j a j a2 2
1
H ( j ) tan
a
H ( j ) H ( j )
4/3/2024 © 2003, JH McClellan & RW Schafer 7
Ex.1.1 bilateral –two sided
exp. case
T /2 T /2
- jw t - jw t
X( jw ) = ò (1)e dt = ò e dt
-T/2 -T/2
- jw t T /2 - jw T / 2 jw T /2
e e -e
X( jw ) = =
- jw - T/2
- jw
sin(wT / 2)
X( jw ) =
(w / 2)
4/3/2024 © 2003, JH McClellan & RW Schafer 9
1 t <T /2 sin(wT / 2)
x(t) = X( jw ) =
0 t >T /2 (w / 2 )
j t b jb t jb t
1 e 1 e e
x (t )
2 jt b
2 jt
sin( bt )
x (t )
4/3/2024
t
© 2003, JH McClellan & RW Schafer 11
sin(bt ) 1 b
x (t ) X ( j )
t
0 b
¥
- jw t
X( jw ) = ò d (t)e dt = 1
-¥
4/3/2024 © 2003, JH McClellan & RW Schafer 13
x(t) = d (t) X( jw ) = 1
Lecture 23
Fourier Transform
Properties
h (t ) e t u (t )
t 1
h(t ) e u(t ) H ( j )
1 j
4/3/2024 © 2003, JH McClellan & RW Schafer 21
1 t T /2 sin(T / 2)
x (t ) X ( j )
t T /2 /2
0
t0 0
sin(bt ) 1 b
x (t ) X ( j )
t
0 b
j t0
x(t ) (t t0 ) X ( j ) e
jct
x(t ) e
4/3/2024 X ( j ) 2 ( c )
© 2003, JH McClellan & RW Schafer 25
x (t ) cos(ct ) X ( j ) ( c ) ( c )
jk0t
Therefore,since e 2 ( k0 )
X ( j ) 2 ak ( k0 )
k
4/3/2024 © 2003, JH McClellan & RW Schafer 27
Square Wave Signal
x(t) = x(t + T0 )
- 2T0 - T0 0 T0 2T0 t
T0 / 2 T0
1 - jw 0 kt 1 - jw 0 kt
ak =
T0 ò (1)e
0
dt + ò
T0 T0 / 2
( - 1)e dt
- jw 0 kt T0 / 2 - jw 0 kt T0
- j pk
e e 1- e
ak = - =
- jw 0 kT0 - j w 0 kT0 T
0 © 2003, JH McClellan & RW Schafer
j pk
4/3/2024 0 /2 28
Square Wave Fourier Transform
x(t) = x(t + T0 )
- 2T0 - T0 0 T0 2T0 t
¥
X( jw ) = å 2 p a d (w - k w
k=- ¥
k 0 )
x(at ) 1 X(
j )
a a
j t j ( / a ) d
x ( at ) e dt
x ( )e a
1
a
X ( j a )
x(2t ) shrinks; 1
X ( j ) expands
2 2
4/3/2024 © 2003, JH McClellan & RW Schafer 31
Scaling Property
x(at ) 1
a
X ( j a )
x2 (t ) x1 (2t )
Differentiation Property
dx(t)
( jw )X( jw )
4/3/2024 dt © 2003, JH McClellan & RW Schafer 34
Convolution Property
X( jw ) Y( jw ) = H( jw )X( jw )
Convolution in the time-domain
¥
y(t) = h(t) * x(t) = ò h( t )x(t - t )d t
-¥
corresponds to MULTIPLICATION in the
frequency-domain Y( jw ) = H( jw )X( jw )
4/3/2024 © 2003, JH McClellan & RW Schafer 35
Convolution Example
Bandlimited Input Signal
“sinc” function
Output is Bandlimited
Convolve “sincs”
b 100
Hlp ( jw )
- w co w co
y(t) = x(t) if w 0 < w co
y(t) = 0 if w 0 > w co
4/3/2024 © 2003, JH McClellan & RW Schafer 40
Ideal Lowpass Filter
ì 1 w < w co
H( jw ) = í
î 0 w > w co
f co "cutoff freq."
4 4
y(t) = sin(50pt ) + sin (150pt )
p 3p
Lecture 24
Amplitude Modulation (AM)
X( jw ) Y( jw ) = H( jw )X( jw )
Convolution in the time-domain
¥
y(t) = h(t) * x(t) = ò h( t )x(t - t )d t
-¥
corresponds to MULTIPLICATION in the
frequency-domain Y( jw ) = H( jw )X( jw )
4/3/2024 © 2003, JH McClellan & RW Schafer 7
Cosine Input to LTI System
Y (j w ) = H( jw )X(j w )
= H( jw )[pd (w - w 0 ) + pd (w + w 0 )]
= H( jw 0 ) pd (w - w 0 ) + H( - jw 0 ) pd (w + w 0 )
jw 0 t - jw 0t
y(t) = H (j w 0 ) e + H( - j w 0 ) e
1
2
1
2
1 jw0 t * 1 - jw0 t
= H( jw 0 ) 2 e + H ( jw 0 ) 2 e
= H( jw 0 ) cos(w 0t + H( jw 0 ))
4/3/2024 © 2003, JH McClellan & RW Schafer 8
Ideal Lowpass Filter
Hlp ( jw )
- w co w co
y(t) = x(t) if w 0 < w co
y(t) = 0 if w 0 > w co
4/3/2024 © 2003, JH McClellan & RW Schafer 9
Ideal LPF: Fourier Series
ì 1 w < w co
H( jw ) = í
î 0 w > w co
f co "cutoff freq."
4 4
y(t) = sin(50pt ) + sin (150pt )
p 3p
How do we share
bandwidth ?
1 ¥
Y( jw ) = ò X( jq )P( j(w - q ))dq
4/3/2024
2p - ¥
© 2003, JH McClellan & RW Schafer 13
y (t ) x (t ) p(t ) Y ( j ) 1
2 X ( j ) P( j )
p(t ) cos(ct )
P( j) ( c ) ( c )
y (t ) x(t ) cos(ct )
Y ( j) 1
2 X ( j) ( c ) ( c )
Y ( j ) 12 X ( j ( c )) 12 X ( j ( c ))
4/3/2024 © 2003, JH McClellan & RW Schafer 14
Amplitude Modulator
x(t) y(t) = x(t)cos(w c t)
X( jw ) Y( jw ) =
1
X( j(w - w c ))
2
cos(w ct)
1
+ X( j(w + w c ))
2
1 t T sin( T )
x (t ) X ( j ) 2
t T ( )
0
y (t ) x(t ) cos(ct )
sin(( c )T ) sin(( c )T )
Y ( j )
( c ) ( c )
4/3/2024 © 2003, JH McClellan & RW Schafer 16
y (t ) x(t ) cos(ct )
Y ( j) 12 X ( j( c )) 12 X ( j( c ))
x(t)
1
2 X ( j ( c )) 1
2 X ( j ( c ))
- wc wc
4/3/2024 © 2003, JH McClellan & RW Schafer 17
DSBAM Modulator
Frequency-shifted
copies Upper sideband
Lower sideband
1 1
2
w(t) = x(t)[cos(w c t)] = x(t) + x(t)cos(2w c t)
2 2
1 1 1
W( jw ) = X( jw ) + X( j(w - 2w c )) + X( j(w + 2w c ))
2 4 4
V( jw ) = H( jw )W( jw )
4/3/2024 © 2003, JH McClellan & RW Schafer 21
DSBAM Demodulation
ì 2 | w | < w co
H( jw ) = í
î 0 | w | > w co
cos(w c1t)
Spectrum of inputs
must be bandlimited
Need w c 2 - w c1 > 2w b
cos(w c 2t)
w c1 w c2
cos(w c1t)
cos(w c 2t)
4/3/2024 © 2003, JH McClellan & RW Schafer 25
Bandpass Filters for De-Mux
co co
Input x(t ) X ( j ) 4 ( 30 k )
k
Lecture 25
Reconstruction from Samples
x[n] = x(nTs )
FOURIER
TRANSFORM
of xs(t) ???
2p
p(t ) (t nTs ) ak e jk st
ws =
Ts
n k
Ts / 2
1 jk s t 1 Fourier Series
ak
Ts (t )e dt
Ts
4/3/2024
Ts / 2 © 2003, JH McClellan & RW Schafer 3
FT of Impulse Train
2
p(t ) (t nTs ) P( j ) ( ks )
n k Ts
2
s
Ts
¥ ¥
xs (t) = x(t) å d (t - nTs ) = å x(t)d (t - nTs )
n= - ¥ n= - ¥
¥
xs (t) = å x(nTs )d (t - nTs )
4/3/2024 n= - ¥
© 2003, JH McClellan & RW Schafer 5
Illustration of Sampling
x(t)
t
xs ( t ) x(nTs ) (t nTs )
n
x[n] = x(nTs )
n
4/3/2024 © 2003, JH McClellan & RW Schafer 6
Sampling: Freq. Domain
ak e jkst EXPECT
FREQUENCY
k SHIFTING !!!
p(t ) (t nTs ) ak e jk st
n k
4/3/2024 © 2003, JH McClellan & RW Schafer 7
Frequency-Domain Analysis
¥ ¥
xs (t) = x(t) å d (t - nTs ) = å x(nTs )d (t - nTs )
n= - ¥ n= - ¥
¥ 1 ¥
1 jkw st jkw st
xs (t) = x(t) å e = å x(t)e
Ts
k = - ¥ Ts k= - ¥
1 ¥
Xs ( jw ) = å X( j(w - kw s ))
Ts
k= - ¥ 2p
ws =
Ts
4/3/2024 © 2003, JH McClellan & RW Schafer 8
Frequency-Domain
Representation of Sampling
“Typical”
bandlimited signal
1 ¥
Xs ( jw ) = å X( j(w - kw s ))
Ts
k= - ¥
¥
xs (t) = å x(nTs )d (t - nTs )
n= - ¥
1 ¥
Xs ( jw ) = å X( j(w - kw s ))
Ts
k= - ¥
Xr ( jw ) = Hr ( jw )Xs ( jw )
4/3/2024 © 2003, JH McClellan & RW Schafer 11
Reconstruction: Frequency-Domain
If s 2 b , the copies of
H r ( jw ) X ( j ) do not overlap, so
X r ( j ) H r ( j ) X s ( j )
p
sin T t hr (0) = 1
s
hr (t) = p
Ts
t
¥ sin Tp (t - nTs )
s
xr (t) = å x[n] p
x[n] = x(nTs ) n= - ¥ Ts
(t - nTs )
Ideal Sampler Ideal bandlimited interpolator
1 ¥ Xr ( jw ) = Hr ( jw )Xs ( jw )
Xs ( jw ) = å X( j(w - kw s ))
Ts
k= - ¥
4/3/2024 © 2003, JH McClellan & RW Schafer 17
Signal Processing First
Important FT properties
Convolution multiplication
Frequency shifting
p(t ) ak e jk st EXPECT
FREQUENCY
k
SHIFTING !!!
p(t ) (t nTs ) ak e jk st
n k
4/3/2024 © 2003, JH McClellan & RW Schafer 4
Frequency-Domain
Representation of Sampling
“Typical”
bandlimited signal
1 ¥
Xs ( jw ) = å X( j(w - kw s ))
Ts
k= - ¥
¥
xs (t) = å x(nTs )d (t - nTs )
n= - ¥
1 ¥
Xs ( jw ) = å X( j(w - kw s ))
Ts
k= - ¥
Xr ( jw ) = Hr ( jw )Xs ( jw )
4/3/2024 © 2003, JH McClellan & RW Schafer 7
Reconstruction: Frequency-Domain
If s 2 b , the copies of
H r ( jw ) X ( j ) do not overlap, so
X r ( j ) H r ( j ) X s ( j )
p
sin T t hr (0) = 1
s
hr (t) = p
Ts
t
¥ sin Tp (t - nTs )
s
xr (t) = å x[n] p
x[n] = x(nTs ) n= - ¥ Ts
(t - nTs )
Ideal Sampler Ideal bandlimited interpolator
1 ¥ Xr ( jw ) = Hr ( jw )Xs ( jw )
Xs ( jw ) = å X( j(w - kw s ))
Ts
k= - ¥
4/3/2024 © 2003, JH McClellan & RW Schafer 13
DT Filtering of CT Signals
x(t) x[n] jwˆ y[n] y(t)
C-to-D H(e ) D-to-C
X( jw ) jwˆ jwˆ
Y( jw )
X(e ) Y(e )
Y( jw ) = Heff ( jw )X( jw )
jwTs
ì H(e ) w < w s 1
2
Heff ( jw ) = í UNDEFINED
4/3/2024
î NOT0LTI w > 2ws
1
© 2003, JH McClellan & RW Schafer 14
DT Filtering of a CT Signal
Analog Input
Spectrum of
Discrete-Time Signal
̂
Digital Filter
̂
Reconstruction Filter
(Analog)
Analog Output
wˆ = w Ts = w
fs
DIGITAL FILTER
f s = 1000 Hz
EFFECTIVE RESPONSE
Heff ( jw )
ˆ Ts
fs
1000
Analog Frequency Response
sin(11 / 2000 )
H ( j )
sin( / 2000 )
4/3/2024 © 2003, JH McClellan & RW Schafer 18
POP QUIZ
Given:
-1
x(t) x[n] 2 + 2z y[n] y(t)
A-to-D -1 D-to-A
1 - 0.8z
Find the output, y(t)
When
x(t) = cos(2000p t)
f s = 5000Hz
4/3/2024 © 2003, JH McClellan & RW Schafer 19
POP QUIZ BECOMES
-1
Given: 2 + 2z
H( z) = -1
1 - 0.8z
Find the output, y[n]
When
x[n] = cos(0.4p n)
Because
wTs = 2000p / 5000 = 0.4p
NO Aliasing
4/3/2024 © 2003, JH McClellan & RW Schafer 20
SINUSOIDAL RESPONSE
Given: wˆ = ?
-1
x(t) x[n] 2 + 2z y[n] y(t)
A-to-D -1 D-to-A
1 - 0.8z
Find the output, y(t)
x(t ) cos(2 (7500)t )
When
wˆ = ?
f s = 5000Hz
4/3/2024 © 2003, JH McClellan & RW Schafer 24
2nd POP QUIZ ANSWER
ˆ cos(2 (7500) / 5000 2 (1.5)
Given:
-1
x(t) x[n] 2 + 2z y[n] y(t)
A-to-D -1 D-to-A
1 - 0.8z
w =?
When
x(t ) cos(2 (7500)t )
ˆ 3
f s = 5000Hz y(t) = ?
4/3/2024 © 2003, JH McClellan & RW Schafer 25
IMPORTANT CONCEPTS
ALL Signals have Frequency Content
Sum of Sinusoids
Complex Exponentials
Impulses, Square Pulses
FILTERS alter the Frequency Content
Image Processing Example: Blur
Linear Time-Invariant Processing
3 Domains for Analysis
H( z) =
å bz
k
-k
1- å a z
-
jwˆ
z=e
h(t) H( jw )
Implementation is Frequency
RLC-op-amp circuit Response
1 ¥
jw t Fourier Synthesis
x(t) = ò X( jw )e dw (Inverse Transform)
2p - ¥
¥
- jw t
X( jw ) = ò x(t)e dt Fourier Analysis
-¥ (Forward Transform)