signals, instruments, and systems – w4 an introduction to ......digital camera digital video...
TRANSCRIPT
Signals, Instruments, and Systems – W4An Introduction to Signal
Processing – Signals, Series, Transforms
1
),( yxfI =
Signal – Definition“A signal is any time-varying or spatial-varying
quantity”
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
Tem
pera
ture
[°C
]
Latitude [m]
Hei
ght [
m]
Lo
ngitu
de [m
]
)(tfT = )(xfh = ),( yxfh =
x [Pixel]
y [P
ixel
]
Photo: Maurizio Polese
2
Continuous versus Discrete
3
Continuous Discrete
1 2 3 4 5 6x
Ν∈x1 2 3 4 5 6x
R∈x2,478956983748… 4
Analog versus Digital
5
Analog versus Digital
• An analog signal …– is continuous in time – has continuous values
• A digital signal …– is discrete in time – has discrete values
6
• 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
7
Sensors ClassificationContinuous – Discrete
Continuous DiscreteTimeSpace
Amplitude
8
Continuous: Amplitude and Time
Thermometer
Barometer
9
Continuous: Time and Amplitude
BarographThermograph
Gramophone record
10
Continuous: Space and AmplitudeDiscrete: Time
Camera Reel camera11
Discrete: Time and Amplitude
Digital WatchWeather station 12
Discrete: Time, Space and Amplitude
Digital camera Digital video camera13
Analog-Digital-Analog Conversion
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
Analog to Digital Conversion (ADC)
Digital to Analog Conversion (DAC)
y=x(t) y=x[n]14
Analog-Digital Conversion
15
Analog-Digital Converter (ADC)
• Transforms continuous analog signal into series of values
• Two key elements– Sampling (in time)– Quantization (of values)
• Two types of converters– Linear ADCs– Non-linear ADCs
Time0 100 200 300 400 500 600 700 800 900 1000-4
-2
0
2
4
6
8
10
Sig
nal A
mpl
itude
y[n]=0 0 -2 -4 -2 0 4 8 10 10
16
Examples of ADC Applications
• Input line of a soundcard• Sensor of digital camera• Mobile phone• Computer mouse• …
17
18
An Example from your Course Tools
- From datasheet dsPIC on e-puck: ADC 16 channels, 12 bits, 200 ksps- 212 -1 discrete levels of resolution per channel- Max 200k Hz sampling frequency on 1 channel -> e.g., 10 channels: 20k Hz
Digital-Analog Conversion
19
• Transforms a series of values into a continuous signal
• DAC outputs piecewiseconstant signal
• Additional filter stage tosmooth signal (often carriedout by the properties of the transducer/actuator itself) Time
0 100 200 300 400 500 600 700 800 900 1000-4
-2
0
2
4
6
8
10
Sig
nal A
mpl
itude
y[n]=0 0 -2 -4 -2 0 4 8 10 10
Digital-Analog Converter (DAC)
20
Examples of DAC Applications
• Mobile phone• MP3 player• Graphics card (with older monitors)• Monitors (newer systems)
21
Typical Waves and Signals
22
Waves“A wave is a disturbance that propagates through space and time, usually with transference of energy.”
Wave function:
( )
fv2
2sin),(
=
=
=
−=
λ
πωλπ
ωγ
f
k
tkxtxf
“wave number”
“angular frequency”
“wave length”v = speed in x direction
23
Electromagnetic Spectrum
24
Common Frequencies
• Car motor: ~50 Hz (3000 rpm)• Power lines: 50 Hz• Ear: 20 Hz – 20 kHz• Ultrasound: 20 kHz – 200 MHz• Watch quartz: 32 kHz• Medical Sonograph: ~2-18 MHz• CPU: 2-3 GHz• GSM: 0.9/1.8 GHz
25
Standard waveformsSine
Square
Triangle
Sawtooth
26
Sinusoid (Sine Wave) in Time
)sin()( θω +⋅= tAty
phase :frequencyangular :
amplitude :
θωA
27
Dirac Delta Function
∫∞+
∞−
=
≠=∞+
=
1)(
0,00,
)(
dtt
tt
t
δ
δ
-2 -1.5 -1 -0.5 0 0.5 1 1.5 20
0.2
0.4
0.6
0.8
1
28
Fourier Series
29
Fourier Series
• Joseph Fourier (1768-1830) proposed that any periodic function can be decomposed into a sum of simple oscillating functions, namely sines and cosines.
30
“Any periodic function …”
from: Robert W. Stewart, Daniel García-Alís, “Concise DSP Tutorial” 31
“…can be decomposed into a sum of sines and cosines”from: Robert W. Stewart, Daniel García-Alís, “Concise DSP Tutorial”
∑∑ ∞
=
∞
=
+
=
10
2sin2cos)(n nn n T
ntBTntAtx ππ
32
• Suppose a 2π periodic function f(t) integrable on [−π, π]
• The Fourier coefficients of x are:
1,)sin()(1
0,)cos()(1
≥=
≥=
∫
∫
−
−
ndtnttfB
ndtnttfA
n
n
π
π
π
π
π
π
∑∑ ∞
=
∞
=
+
=
10
2sin2cos)(n nn n T
ntBTntAtf ππ
Fourier Series
33
Complex Numbers Review
ϕ
ϕϕ
ϕϕϕ
ϕ
sin)Im(
cos)Re(:Phase
:Magnitude
:formPolar sincos :formula sEuler'
)Im()Re( :formr Rectangula
nn
nn
n
inn
innn
CC
CC
C
eCCie
CiCC
=
=
=
+=
+=
nC
nC∠
34
From Real to Complex Coefficients
∑∞
=
−−
−+
++=
10 22)(
0000
n
tintin
n
tintin
n ieeBeeAAtf
ωωωω
Real Fourier coefficients:
Using the Euler relationships:
we can express sin and cos usingexponential functions
And substituting sin and coswe get (ω0= 2π/T ):
and then
We can now express our Fourier series with complex coefficients
R,;2sin2cos)(10 ∈
+
+= ∑∞
= nnn nn BATntB
TntAAtf ππ
ieeee
iieie
iiii
i
i
2sin;
2cos
sincos)sin()cos(sincos
ωωωω
ω
ω
ωω
ωωωω
ωω
−−
−
−=
+=⇒
−=−+−=
+=
∑ ∑∞
=
−
−∞=
+
+
−
+=1
10
00
22)(
n ntinnntinnn eiBAeiBAAtf ωω
C;)( 0 ∈= ∑∞
−∞= nntin
n CeCtf ω
35
Complex Fourier Coefficients
∫
∑
−
−
∞
−∞=
=
=
π
π
ω
ω
πdtetfC
eCtf
tinn
n
tinn
0
0
)(21tscoefficienFourier
)(seriesFourier
36
[Matlab demo]
Examples
http://users.ece.gatech.edu/mcclella/matlabGUIs/37
Fourier Transform
38
From Fourier Series to Transform• f(t)
- an aperiodic signal- view it as the limit of a periodic signal as T→ ∞- is an integrable or even a square-integrable function
• For a periodic signal, the harmonic components are spaced ω0= 2π/Tapart
• As T→ ∞, ω0→0, and harmonic components are spaced closer and closer in frequency forming a continuous spectrum
39
Fourier Transform
2
2
( ) ( )
( ) ( )
i t
i t
f f t e dt
f t f e d
π ξ
π ξ
ξ
ξ ξ
∞∧−
−∞
∞ ∧
−∞
= ⋅
= ⋅
∫
∫
Fourier Transform
Inverse FourierTransform
Notation notes: ••Expression in angular frequency ω = 2πξ are also used (see tables at the end)
• In EE i is substituted by j (“i” booked for current)• transform also called “analysis equation”; inverse transform “synthesis equation”
)F(by replacedoften is )(f̂ ⋅⋅
40
Common Fourier Transform
)()( ttf δ= 1)( =∧
ξf
-50 -40 -30 -20 -10 0 10 20 30 40 50
0.2
0.4
0.6
0.8
1
Time [s]-50 -40 -30 -20 -10 0 10 20 30 40 50
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
Frequency [Hz]
41
FT of a Dirac Impulse
42
From Prof. A. S. Wilsky, Signals and Systems course, to be replaced with our notation
Common Fourier Transform
1)( =tf )()( ξδξ =∧
f
-40 -30 -20 -10 0 10 20 30 40 50
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
Time [s]-50 -40 -30 -20 -10 0 10 20 30 40 50
0
0.2
0.4
0.6
0.8
1
Frequency [Hz]
43
Common Fourier Transform
)2cos()( tatf π= ( ) ( )2
)( aaf ++−=
∧ ξδξδξ
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
-10 -8 -6 -4 -2 0 2 4 6 8 10
0.2
0.4
0.6
0.8
1
Frequency [Hz]Time [s]
44
Common Fourier Transform
)()( trecttf = )(sinc)( ξξ =∧
f
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
-10 -8 -6 -4 -2 0 2 4 6 8 10-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Frequency [Hz]Time [s]
45
Properties
)()()())(()(nConvolutio
)(1)()()(Scaling
)()()()(Modulation
)()()()(nTranslatio
)()()(bg(x)af(x)h(x)Linearity
02
20
0
0
ξξξ
ξξ
ξξξ
ξξ
ξξξ
ξπ
ξπ
∧∧∧
∧∧
∧∧−
∧−
∧
∧∧∧
⋅=⇒∗=
=⇒=
−=⇒=
=⇒−=
+=⇒+=
gfhxgfxh
af
ahaxfxh
fhxfexh
fehxxfxh
gbfah
ix
ix
See next lecture46
Discrete Fourier Transform
• Input and output sequences are both finite (the integral becomes a finite sum) • Matlab, operating on a computer (i.e. a digital device) can only emulate
continuity/infinity and therefore use this discrete version with an adjustable discretization level (in time, frequency, and amplitude) and finite bounds
1,,0,][X[k]
)()()(ˆ
1
0
2
2
−=⋅=
⋅==
∑
∫
−
=
−
∞
∞−
−
Nkenx
dtetfFf
N
n
knN
i
ti
π
ξπξξ
47
Discrete Fourier Transform
• Different from the Discrete-Time Fourier Transform (DTFT)• Efficient implementation is done using Fast Fourier Algorithms (FFT)• Clear correspondence with the Fourier series (see slide 36)
1,,0,][1x[n]
1,,0,][X[k]
1
0
2
1
0
2
−=⋅=
−=⋅=
∑
∑
−
=
−
=
−
NkekXN
Nkenx
N
k
knN
i
N
n
knN
i
π
π DFT
Inverse DFT
48
Fourier Tables
49
Fourier Transforms Table
50
Fourier Properties Table
51
Simple Example
)()( ttriantf = )(sinc)( 2 ξξ =∧
f
-10 -8 -6 -4 -2 0 2 4 6 8 10
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
Frequency [Hz]-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
Time [s]
52
Combined Example
53
Various Transforms
54
Motivation for More Transforms
From Prof. A. S. Wilsky, Signals and Systems course, to be re-elaborated 55
Transforms for Causal Systems
From Prof. A. S. Wilsky, Signals and Systems course, to be re-elaborated 56
Laplace Transform
{ }
ωσ is
dttfef(t)sF st
+=
== ∫∞
−
− )()(0
L
57
Fourier - Laplace
dttfesF
tftfFF
tiis
is
)(|)(
|)}({)}({)(
∫∞
∞−
−=
=
==
==
ωω
ωω L
The Fourier Transform is a special case of Laplace TransformFourier: frequency response (especially in signal processing)Laplace: impulse response (especially in control)
58
Discrete-Time Fourier Transform
• Corresponds to the Fourier Transform for discrete-time signals (different from the Discrete Fourier Transform, a finite, bounded approximation of the Fourier Transform for digital devices)
• Transform discrete-time signals from time-domain to frequency domain
∑∞
−∞=
−⋅=n
nienx ωω ][]X[
59
Z Transform• Corresponds to Laplace transform for time-
discrete signals• Transform signals from time-domain to frequency
domain• The Discrete-Time Fourier Transform is a special
case of the Z Transform
)sin(cosor
][]}[{)(
ϕϕϕ jAzAez
znxnxzX
jn
n
+==
== ∑∞
−∞=
−Z
60
Transform Overview
Discrete signalTime domain
Discrete signalFrequency domain
Continuous signalFrequency domain
Continuous signalTime domain
Fourier/Laplace
Inverse Fourier/Laplace
Z/DTFT
Inverse Z/DTFT
DA
C
AD
C
61
Conclusion
62
Take Home Messages• A signal can be a varying quantity in time and/or space• Signal classification: continuous vs. discrete in time,
space and amplitude• Fourier decomposition: every periodic signal can be
decomposed into a sum of sines and cosines• Fourier coefficients are the weights in this sum• Fourier transform for aperiodic signals• Causal, potentially unstable systems requires Laplace
transform (in continuous time) and Z transform (in discrete time) to analyze their response in frequency domain
63
Additional Literature – Week 7Book• McClellan J. , Schafer R., Yoder M. “DSP First: A
Multimedia Approach”, Prentice Hall, 1998
64