signals, instruments, and systems – w5 introduction to signal … · 2016. 3. 23. · a f g af g...
TRANSCRIPT
Signals, Instruments, and Systems – W5
Introduction to Signal Processing – Convolution, Sampling, Reconstruction
1
Motivation from Week 1 Lecture
2
Sensing
Processing Communication
Processing
Mobility
In-situ instrument
Visualization
Storing
Transportation channel Base station
Highlighted blocks are those mainly leveraging the content of this lecture.
Convolution
3
Convolution
dtgftgf )()()(
• For each value of t:1. Flip (reflect) g2. Shift g by t3. Multiply f and g4. Integrate over
• Note that the result does not depend on !
dtgf
tgftgg
gg
)()( 4)
)()( 3))()( 2)
)()( 1)
4
[Matlab demo “cconvdemo”]
http://users.ece.gatech.edu/mcclella/matlabGUIs/5
Examples
=-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
*-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
1.2
1.4
6
Examples
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
*-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
=
7
Examples
=-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
*-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
8
Examples
=-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
*-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
9
Examples
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
*-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
=
10
Convolution in Time and Frequency Domains
11
))(ˆˆ()(ˆ)()()(
)(ˆ)(ˆ)(ˆ))(()(
gfhtgtfth
gfhtgfth
Time domain Frequency domain
Ord
inar
yfr
eque
ncy
))((21)()()()(
)()()())(()(
GFHtgtfth
GFHtgfth
Ang
ular
freq
uenc
y
Convolution Properties
)()()(
)()()(
)()(
agfgafgfa
hfgfhgf
hgfhgf
fggf
tionmultiplica scalar ity withAssociativ
vityDistributi
ityAssociativ
ityCommutativ
12
Discrete Convolution
m
mngmfngf
dtgftgf
][][][
)()()(
Notes:• Similar to the continuous version• The integral becomes an infinite sum• Matlab, operating on a computer (i.e. a digital device) can only emulate
continuity and therefore use the discrete version with an adjustable discretization level (in time and amplitude) and finite bounds of the convolution window 13
[Matlab demo “dconvdemo”]
http://users.ece.gatech.edu/mcclella/matlabGUIs/14
Sampling
15
• Digital– Discrete– Digital world
Analog – Digital
• Analog– Continuous– Real world
0 100 200 300 400 500 600 700 800 900 1000-4
-2
0
2
4
6
8
10
Time
Sig
nal A
mpl
itude
Time0 100 200 300 400 500 600 700 800 900 1000
-4
-2
0
2
4
6
8
10
Sig
nal A
mpl
itude
16
Train of Dirac Impulses
17
n
nTttx )()(
Train of Dirac Impulses
18
n
T
T
tjk
n
Tk
TX
Tdtetx
Tatx
nTttx
22)(
1)(1)(
)()(
2/
2/
0
Time domain Frequency domain
F()
Sampling in Time Domain
19
nnp
n
nTtnTxnTttxtptxtx
nTttp
tx
)()()()()()()(
)()(
)(
Train of Dirac pulses
T = sampling periodf = 1/T = sampling
frequency
Sampling in Frequency Domain
20
kS
kSp
kS
p
p
kXT
kXT
X
kT
P
PXX
tptxtx
)(1
)(*)(1)(
)(2)(
)(*)(21)(
)()()(
Ts 2
Samplingfrequency
Convolution propertyTime domain
Frequency domain
Sampling a Band-Limited Signal
21
kS
p
kXT
PXX
)(1
)(*)(21)(
k
SkT
P )(2)(
X(ω) → spectrum of signal x(t) with highest frequency < ωm
Sampling frequency ωs > 2 ωm
Sampling a Band-Limited Signal
22
X(ξ) → spectrum of signal x(t) with highest frequency < 2 kHz
Sampling frequency: 5 kHz > 2 * 2 kHz
Sampling a Band-Limited Signal
23
X(ξ) → spectrum of signal x(t) with highest frequency < 3 kHz
Sampling frequency: 5 kHz < 2 * 3 kHz
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-1.5
-1
-0.5
0
0.5
1
1.5
Time [s]
Original Signal
)52sin(2.0)22sin(4.0)2sin()( ttttf 24
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-1.5
-1
-0.5
0
0.5
1
1.5
Time [s]
Too Few Samples (1Hz)
→ Data is lost25
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-1.5
-1
-0.5
0
0.5
1
1.5
Time [s]
Too Many Samples (100 Hz)
→Redundant data→Increase of data size
26
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-1.5
-1
-0.5
0
0.5
1
1.5
Time [s]
Minimal Possible Sampling (> 10 Hz)
27
Nyquist–Shannon Theorem• If a function x(t) contains no frequencies higher than
B Hz, it is completely determined by giving its coordinates at a series of points spaced 1/(2B) seconds apart.
• Sampling frequency must be at least two times greater than the maximal signal frequency
28
Sampling in Practice
• Sampling frequency two times greater than maximal frequency is the limit
• If possible, try to use a sampling frequency 10 times greater than the maximal frequency
• Audio CD, sampling at 44.1 kHzMaximal hearable frequency: 20 kHz
29
Signal Reconstruction
30
31
spectrum of original signal
spectrum of reconstructedsignal
)(tx x
n
nTttp )(
)(txr)(H
spectrum of sampled signalsampling frequency ωs > 2 ωm
filtering filter cut-off frequency ωm < ωc < (ωs –ωm)
If there is no overlap between the shifted spectra the signal xr(t) can beperfectly reconstructed from x(t)
)(txp
)()()( HXX pr
32
spectrum of original signal
spectrum of reconstructedsignal
)(tx x
n
nTttp )(
)(txr)(H
spectrum of sampled signalsampling frequency fs < 2 fm
filtering filter cut-off frequency fcfm < fc < (fs –fm)
If there is overlap between the shifted spectra the signal xr(t) cannot beperfectly reconstructed from x(t)
)(txp
)()()( HXX pr
)(tx x
n
nTttp )(
)(txr
Time Domain Interpretationof Signal Reconstruction
ωm < ωc < (ωs –ωm)
nTt
nTtTnTx
nTthnTx
thnTtnTx
thtxtx
c
n
n
n
pr
sin
)(*
)(*)()(
t
tTth c
sin)( with
F-1()
The lowpass filter interpolates the samples assuming x(t) contains no energy at frequencies > ωc(ωc =cutoff frequency)
33
34From Prof. A. S. Willsky, Signals and Systems course
Signal Reconstruction Methods
snss
s
s
ns
TtnTtnTxtx
TnTtnTxtx
sinc)()()(
sinc)()(
• Signal has to be band limited (i.e. Fourier transform for frequencies greater than B equal 0)
• The sampling rate must exceed twice the bandwidth, 2B
BTs 2
1
35
Bfs 2or
1. Zero-order hold2. First-order hold – linear interpolation 3. Whittaker-Shannon interpolation (bandlimited interpolation):
(Alternative equivalent formulation)
36From Prof. A. S. Willsky, Signals and Systems course
Aliasing
37
No Problems in Reconstruction
38
Reconstruction Problems
Alias
Overlapping
39
Harmonics
Fundamental Frequency
40
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5-1
-0.5
0
0.5
1
Time [s]
1Hz2Hz3Hz4Hz
Harmonics
41
La-Tone (440 Hz) sampled at 44.1 kHz (CD standard)
42
La-Tone (440 Hz) sampled at 2 kHz without filtering
43
La-Tone (440Hz) sampled at 2 kHz filtered at 1 kHz
44
Aliasing Audio Examples
Original sound Aliases 4 kHz Correct sampling 4 kHz
45
Moiré Pattern
46
47
Aliasing Video Examples
http://www.youtube.com/watch?v=jHS9JGkEOmA
https://www.youtube.com/watch?v=R-IVw8OKjvQ
Conclusion
48
Take Home Messages
When you sample a signal …
1. Make sure you know what the maximum frequency fmax is or enforce it through a low-pass filter
2. Make sure you sample at fs > 2 fmax(Nyquist rule)
49
Books:• Ronald W. Schafer and James H. McClellan
“DSP First: A Multimedia Approach”, 1998• A. Oppenheim and A. S. Willsky with S. Hamid,
“Signals and Systems”, Prentice Hall, 1996.
50
Additional Literature – Week 5