Welcome to the digital
signal processing class
and today we are going to
talk about sampling theorem
and its applications
But first IĄŻd like to invite you
To enjoy a very interesting
and amazing video
That I first saw in Oxford
at a seminar group
This software is called
CITY ENGINE
And you can see
The software provides very
exciting results
for example, when the
vehicle goes on the road
all the surroundings
and buildings have
been located and identified
and based on this software
we can reconstruct 3D model
of its surroundings
and potential applications include
national security, traffic monitoring
and so on.
But one of the most important
applications will be unmanned vehicles
Because all these information will
be sent back to the control panel for
further analysis
Based on all these acquired information
the vehicle can be very smart to avoid
any obstacle in front of it
So this technology provides us some
useful information of signal processing
Although it contains many cutting-edge
and state-of-the-art technologies that
we donĄŻt know
But our lectures will
introduce some basic
and fundamental ideas of
signal processing
Now letĄŻs have a pause and
start todayĄŻs lecture
first letĄŻs take a look at
a simple question about time
Every day we use clocks
We use it to know
when to get up
when to go to school
when to start lectures
when to have breakfast supper or lunch
But have you noticed that sometimes we
sometime goes very fast
sometimes we think it goes too slow
For example, if you
are not well-prepared
and you have to sit
in the exam room
what you can do
Nothing
At that moment the clock is ticking
But a second is like a year
So at that moment the time is too slow
But when you make a new year resolution,
And you think you want to do
all these good things 1, 2, 3, 4
But after a year,
you blow out the dust
on your note book
and you find you havenĄŻt
achieved any of them
And you feel the whole year just flies
like an arrow
So at that moment you
say time is so fast
Why?
Why do we say time is fast
and sometimes we say it is too slow
To find out we need to learn a theory
This theory is called sampling theorem
To do that, letĄŻs go over what we have
learned before
in the previous lectures,
we talked about
Fourier transform
So who can tell us how
many kind of transforms
we have learned?
Please put up your hands
Ok, good
(Student answers)
Yeath, he mentioned we
learned Fourier properties
Take a seat please
And in the Fourier transform
We talk about 2 things:
Discrete time and continuous time signals
For continuous time signal
Fourier transform is expressed
as discrete Fourier transform
And we call it Fourier series
It is called Fourier transform
And we also introduce
some important properties
Such as: time shifting,
frequency shifting,
convolution, integration
and differentiation
Maybe at that moment
you have the faintest idea about
the application of Fourier transform
and you have no idea on
how to apply those properties
but in todayĄŻs lecture
weĄŻll apply Fourier
transform and also some of its
properties to solve our problem
Now letĄŻs take a look what
we are going to learn today
In todayĄŻs lecture
We are gone to talk about 3 things
First, we need to know
the definition of sampling
The mathematical expression of sampling
Second, we gone to introduce
the reason of sampling.
From the beginning of our lectures
I told youĄŻd better know the reason
to do something
because if you donĄŻt know why to do it
You are wasting your time
Third, it is called how to sample
That is the implementation of sampling process
LetĄŻs look at this acoustic signal
We can see when the pistons move
back and forth
The sound is transmitted forward
And this part is
waveform of long length
And this part is
waveform of short
Comparing these two,
we find that we can record or sample
Signals using one dimension
But for example, this is
the point sound (acoustic source)
And it propagates all
the way to its surroundings
for example I stand in
the center of this room
and I continue to carry on the lecture
itĄŻs similar to the image shown here
my voice will transmit
And compare this with
previous slide, we can say
sound can be recorded
in two ways (one dimension
or two dimension)
So how to define the sampling
Now letĄŻs take a look
Here we give the definition of sampling
We can see in the definition
ThereĄŻs a quite important sentence called
T is the sampling period
Sampling period, a new terminology
And IĄŻll explain in the following graph
Here is a continuous signal and
all these black dots are sampled points
If we take over the envelope and keep
The discrete form and
we draw the discrete time signal
And this is called sample
And IĄŻd like to give you
the first mathematical equation
Here, the x(k) is equal to x(t) at t=kT
So this is the first equation of sampling
And also give the definition of sampling
So please keep in mind,
it is very important
And later weĄŻll
explain how to use it
Next the second question, that is
the reason to carry out sampling
This is the flow chart of sampling
LetĄŻs look at the input
The input is x(t),
And the final output is y(t)
Both x(t) and y(t) are continuous
But in the middle
X(k) and Y(k)
They are very interesting
They are discrete form
So base on this flow chart
Have you seen some weird
thing or some interesting question
you want to ask
(Student question)
Take a seat, please
One word, I have to correct not
CONVERSATION
But
CONVERSION
He said, here we convert x(t)
The continuous time signal
To its discrete form
through the analogy to digital conversion
And here we convert
the digital form y(k) to its
Analog form or continuous form
Through the digital to analogy conversion
Why?
Because there are some
many advantages that we can benefit from
Here I list five of them
The first stability because when we do
the sampling or when
we do the analog to digital
conversion, we change
the continuous signal to
its discrete form
And we use 0 and 1 to represent it
Make it more stable
and very simple to realize it.
Based on stability and simplicity
When we transmit the digitized signal
For example, in the digital
communication technology
We find it very reliable
And if you want to increase
the accuracy of the sampling process
It is very easy to do that
you just simply increase the sampling bits
The final one, and we find
it is very easy to implement it
based on current technology
So it is very flexible
So the five advantages give us
the reason why to carry out sampling
The third question,
Since sampling is very important
And we give the definition of sampling
how to do that?
How to implement it?
Hope you still remember this equation
this mathematical expression that
I presented at the beginning of the lecture
I say it is very important
Because I give you some demonstration
For example, these few dots are sampled signal
Can you recover the original
signal x(t) based on the sampled signal?
Yes or no?
Yes? You say YES
How many of you think NO
If you say YES, letĄŻs take a look
For example,
If we want to connect this dot
And this dot
How many ways we can do that?
We can draw a straight line and we
Can draw a slope
And also we can do some curve form
So thereĄŻs so many ways to achieve that
It means Not unique
But we know the original signal
Is the only form of a continuous signal
So we have to increase the sampling points
Step by step
And now we can see even though we choose
the line connection or
zero order holder
we can see the envelope
of the sampled signal
seems like a continuous signal
And we put the envelope in
We can see
Bingo
It is just the original
signal we talked about
From this illustration,
we find a very important thing
That is the sampling period,
different sampling period gives us
different results
If the sampling period is too big,
we canĄŻt reconstruct
a unique original signal
So how small will be the best
What is the optimal sampling period
Will be look like what?
That is the question we will discuss
So we need to do some
mathematical derivation
Here I list two signals
This is the continuous signal
and this is the discrete form
Based on the sampling definition
We know if we choose t=KT
We change the continuous form
to the discrete form
But if we want to reconstruct
the original signal
What can we do?
Who knows?
Anybody?
Yeath, it is very difficult
in time domain
to reconstruct the original signal
We have to borrow some
idea from previous knowledge,
the Fourier transform
we know the discrete form of
Fourier transform of x(k) is X( )
And this is the capital
dletter omega or we call it Greek letter
And =
For the continuous signal
We can say it is Fourier
transform is like this
In the previous lectures,
we talk about the continuous form
and discrete form
We say there is some
relationship between them
And they are uniquely related
If we can set up the
relationship between this one
And this one
And we can say x(t) can
be reconstructed by its discrete form
Now letĄŻs do the first part, the derivation
To do the derivation,
the first thing is to get the impulse train
In time domain, we say
the impulse train can be expressed
by an equation like this
this is the running
sum of impulse train
Who knows the frequency response of it?
The frequency response, spectrum of it,
Anybody, can you try
(Student answer)
N is from minus infinite
to positive infinite
Good sit down please
We have introduce these two
equations in Fourier transform
This is the impulse
train and its spectrum
Now letĄŻs take a look
at another one
The sampled signal
If we use x(t) to represent the sampled signal
It is equal to x(t) the
continuous signal times the impulse train
Right?
And do the analysis
in the time domain first
To distinguish, I choose the red chalk
We use Fourier transform on both sides
The Fourier transform on the left side
is equal to the Fourier transform on the right
and we can write
(skip the mathematical expressions on the blackboard)
And this one is the definition of it
This part is based on
the time domain analysis
Now letĄŻs look at what will happen in
the frequency domain
we choose another colorful chalk
the blue one
letĄŻs see
in the frequency domain
we want to know this result
(skip the mathematical expressions on the blackboard)
This is based on convolution property
(skip the mathematical expressions on the blackboard)
So we got the final result
And we know
As the slide show
There is a relationship between them
So here comes the important conclusion
Because the left part
is based on sampled signal
This one is equal to this one
(skip the mathematical expressions on the blackboard)
And we have complete the whole derivation
It looks quite complicated
I donĄŻt require you to
remember the whole process
but the bottom one
the most important
you have to keep in mind
and later we will explain on how to use it
To give you some vivid demonstration
I draw the signal frequency response
For example, this is
the frequency response of the input signal
And based on this expression,
What will be the sampled one?
What does it look like?
It will be shifted in the frequency domain
This is the sample signal spectrum shifted
to the left and right so on and so forth
But here we notice the sampling frequency
Half of it is here
and the maximum frequency is here
the maximum frequency of the signal
should be less than half
of the sample frequency
If the standard is violated
What will happen?
LetĄŻs look at this demonstration
On the top, the input signal
And the spectrum is at the bottom
When we decrease the sampling period
And reach some point
If it goes beyond this
boundary and we can see
Aliasing effect will occur
We canĄŻt recover the original signal
It is a bad thing, we have to avoid it
But how to avoid it
Later we will explain anti-aliasing filter
Here you have to remember
The sampling period should be big enough
Or at least two times of the sampled signal
Otherwise the aliasing effect will occur
Now letĄŻs summarize the sampling theorem
The sampling theorem talks about two things
First it should be band limited
Second we should uniquely recover
the original signal under
some condition like this
if this condition is not obeyed
we can not reconstruct the original signal
And this frequcny is called Nyquist rate
You may wonder why we
give the name Nyquist rate?
Why?
Yeath, that boy shakes his head
There is a history story behind it.
This guy is a popular scientist
He was born In Sweden and moved to US
And became a physical scientist
He developed or proposed the sampling theorem
Before him, another popular inventor
Called Mr. Miner developed a diagram like this
This is called TIME DIVISION MACHINE
In the early 1900s, people
just wonder is it possible
To share one telephone line
to allow multi users
to communicate without disturbance
because it will save lots of money
After years of experiments
Mr. Miner developed
the TIME DIVISION MACHINE
The invention or innovation
is here the switching board
He allows the switching board
rotates quite fast enough
So the communication will not be disturbed
And he gave the results
the switchboard should go faster than 3,000
and the optimal speed of
the switching board is 4,300
If going down to 1,000 or 2,000,
Communication will be interrupted by noise
But he had no idea why the frequency or
the rotating speed should be like that
After nearly 30 years, Mr. Nyquist proposed
the sampling theory and
proved the sampling theorem says
the sampling frequency should
be 2 times higher than
the communication speed.
So we can see in the scientific history
It always goes from practitioner to theorists
Some one proposed a prototype machine
But he has no idea why it works
Or the mathematical or physical meaning behind it
After years, some scientists will
prove or give us the mathematical analysis of it
Now letĄŻs look a simulation of sampling process
Here is the input signal, the sine signal.
The discrete form is the sampled
we can see when the sampling frequency goes down
and the sampled signal become
too many staircase effects
and if you look at this form,
the frequency response
we can say there are
many harmonic waves
compared with the original signal, the input
we say we canĄŻt recover
the original signal based on it
we have to increase the sampling frequency
and we got some staircase
if sampling frequency is too low
just now we talk about aliasing
IĄŻll give you a demonstration
about aliasing effect
Here I list four signals
We can see when the sampling frquency
changed, only two of them can be recovered
The other two generate aliasing effect
So it is quite important
to design anti-aliasing filter
Before you sample a signal
But does it mean aliasing has no merit?
In fact every cloud has a silver lining
The beautiful picture
was taken in the early 1900s
by a famous scientist and also an artist,
a MIT professor Dr. Edgerton
He used the aliasing effect
to take this picture
still displayed in
the Art Museum of America
When the bullet penetrates the apple,
at that momentthe flash light can
not go faster than the speed of bullet
He borrowed the idea of aliasing,
thishigh frequency will have
a counterpart in the low
frequency and took photo like this.
Next, this motion picture.
In fact it is a still image,
But based on aliasing effect and strobescope,
Dr. Edgerton gave us
the first motion picture
Not beautiful but quite meaningful
So we can say,
although aliasing effect
we should avoided
when we process signals
we can also benefit from it
to take beautiful pictures
and give us some animation results
But when you sample signals
We have to do one thing
That is to remove noise
The best way to remove noise
is to design low-pass filter,
low pass filter reminds us something
something we have learned before,
So who can tell us in what
course we learned low pass filter?
Or what kind of form it will be ?
(Student answers)
Right, he mentioned, sit down please
He mentioned the lowpass filter like this
That we have already learned
in analog circuit design
It can remove those unwanted
noise and give us the filtered results
But the problem is can
we achieve that in computers?
Or can we design a digitized low pass filter?
So that is the second question weĄŻll talk about
To solve that problem the first thing
We should do is called magnitude response
here is the magnitude
response of typical lowpass filter.
And we can see on the X direction
there are two parameters OMEGA_P and OMEGA_S
The first one is called passband edge frequency
The second one is named stopband edge frequency.
And these two parameters divide the whole
magnitude response into three parts:
one two three
from zero to OMEGA_P, we call it passband,
from OMEGA_S to infinite, we name it stopband.
And the middle part between
them is called transition band.
Is there any difference
between these three bands?
Of course, because in the passband
The magnitude is almost unity
with an error of DELTA_P
so we name DELTA_P passband ripple value
Now letĄŻs look at
the bottom, DELTA_S is called
stopband ripple value.
Because in the stopband,
the magnitude should be zero
with an error of DELTA_S
So this is the magnitude response
But in practical application,
we prefer a normalized form like this
we can see there are two
new parameters here and here
replace previous ones and we call them
minimum passband magnitude
and maximum stopband magnitude
In addition,
there are two important equations
transition ratio and
discrimination parameters.
So we have to remember this graph
with two important equations
and two important parameters
Now we know lowpass filter
can be represented by magnitude response
but how to design it,
thatĄŻs the algorith
here weĄŻll introduce a popular one
we call it, the third question
Butterworth approximation
Here we lists some equations,
involved in the Butterworth approximation
totally there are four
the first is magnitude square response,
the second and third are how it works
in the passband and stopband.
The last one at the bottom,
is the most important one
that is how to estimate filter order N.
But these four equations are too complicated
How to implement them?
So IĄŻll give you an
engineering question like this.
This is the ECG signal we can see
It has been heavily contaminated by noise,
To suppress those unwanted noise
we have to design a lowpass filter
and filter parameters are like these
in the passband
the passband parameters are here
1KHz means the passband frequency
1dB is passband ripple value
In the stopband, we got 40dB at 5KHz
Based on these four equations we presented
at the early slide
we can solve this problem
And the first step is to
calculate manimum passband magnitude
and maximum stopband magnitude,
or we write:
Calculate epsilon and A
The second step is to determine transition ratio
and discrimination parameter,
we can simply call it
Determine k and k1
The third step is to estimate filter order N,
Estimate filter order N
Now letĄŻs look at this result 3.2
Is it the answer we want?
How many of you think the answer is yes?
Will be the filter order 3.2?
Who thinks yes?
How do you think?
(Student answer)
Can you speak louder?
Not good enough
That is an answer
But not quite correct
Anybody else?
Ok, 3.2 is not an integer
We know the filter order should be an integer
So we can only choose from 3, 4 , 5.
One of them, but which one?
So here is a criterion of
the filter order selection
Filter order should be the smallest integer
greater than or equal to the estimated value
So in this case, we choose filter order N=4
Now we got the result,
Does it work?
To find out, we do some comparison
and we can see:
the original signal contaminated by noise
and the outcome, the filtered signal
comparing blue with green
those unwanted noise has
been effectively suppressed
So we can see, the fourth
order lowpass filter achieve our aim
Just now, we talk about
the question of the filter selection,
That is the most important
thing of filter design
But if we donĄŻt obey
the rule, what would happen?
LetĄŻs presume the filter N goes upŁŹ
and draw the magnitude response.
We can see as the filter order N goes up,
the transition band
becomes narrow and narrower.
That is quite good, right?
Because the ideal lowpass filter
should have the zero transition band
It violates our criterion,
the filter order selection criterion
Or does it mean the higher the filter order,
the better the performance?
To find out, we need to draw the zero-pole plot
we can see when the filter order increases
zeros and poles go beyond the unity circle
at that situation what will happen?
System becomes unstable
That is the thing we donĄŻt want
So it further proves we canĄŻt increase
the filter order N indefinitely
In fact, there are other algorithms
to implement low pass filter design
Here I list four popular ones:
butterworth, we have already introduced
chebshev type 1, chebshev type 2 and elliptic.
Using same filter parameters,
filter design parameters
We draw these four popular
filter design algorithm
in one magnitude response graph
can you see any difference?
It is very difficult because
the difference hides in the passband
and we zoom in and Ą°BingoĄ±
we can see only the Butterworth
has the flattest passband
and in fact there are other differences
between these four popular algorithms
I leave to you as todayĄŻs homework
to do some computer programming
and compare the difference between
these four popular algorithms
As we know, filters can be widely applied
for example: in the medical field
if you want to locate the boundary of this tumor
what can we do?
We can employ the EMD filter
And we can see the tumor,
the malignant part is located effectively
Though the kidney is moving,
We still respirator, we can still find it
So doctors can remove tumor and
help patients live a better and healthy life.
Next, if we want to draw the
silhouette of this deformable object
What can we do?
Because it is highly contaminated by noise,
So we can employ the active form filter
And we can see the boundary of this deformable object.
Last but not least, we want
to estimate the angles of vehicles
Because when cars collide with each other
We have to provide security
to passengers and drivers.
So it is quite important to
estimate the angles of vehicles
In that application,
we employ Gaussian kernel filter
And we can see all those red
angles have been effectively estimated
Based on these three illustrations,
we can see filters have wide applications
Now, letĄŻs take a look at
what we have already learned today:
First, we introduce the Sampling theorem
We give the derivation
Though the mathematical expressions are quite complicate
But we have to remember the conclusion
If you are not interested in the derivation process.
It means the sampling frequency
should be at least two times greater
than the maximum frequency of the original signal
And the sampled outcome in the frequency domain
will be the shifted spectrum of the original signal
In the frequency domain
Next we introduce lowpass filter
The way to represent a lowpass filter
is called magnitude response
and the method to design it
is called Butterworh Approximation
to design a low pass filter
we need to know passband edge frequency
stopband edge frequency, minimum passband magnitude
, maximum stopband magnitude
In addition, there are two important equations
transition ratio and discrimination parameter
To implement it, we list three steps:
First, calculate epsilon and A
Then determine transition ratio and discrimination parameter
The third step is the most important one
How to estimate filter order N,
We also give the criterion,
The filter order should be the smallest integer
greater than or equal to the estimated value.
You can find more information on the course website
And some homework are here
Ok, thank you very much
See you next time