Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
Signals, Instruments, and Systems – W4
An Introduction to Signal
Processing
),( 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
mplit
ude
Te
mpera
ture
[°
C]
Latitude [m]
Heig
ht
[m]
Longitude [
m]
)(tfT )(xfh ),( yxfh
x [Pixel]
y [
Pix
el]
Photo: Maurizio Polese
Continuous versus Discrete
Continuous Discrete
1 2 3 4 5 6
x
x1 2 3 4 5 6
x
Rx2,478956983748…
Analog versus Digital
Analog versus Digital
• An analog signal …
– is continuous in time
– has continuous values
• A digital signal …
– is discrete in time
– has discrete values
• Digital
– Discrete
– Digital world
• Analog
– Continuous
– Real world
Analog – Digital
0 100 200 300 400 500 600 700 800 900 1000-4
-2
0
2
4
6
8
10
Time
Sig
nal A
mplit
ude
Time0 100 200 300 400 500 600 700 800 900 1000
-4
-2
0
2
4
6
8
10
Sig
nal A
mplit
ude
Sensors
Continuous – Discrete
Continuous
(Analog)
Discrete
(Digital)
Time
Space
Amplitude
Continuous: amplitude, time
Thermometer
Barometer
Continuous: time and amplitude
BarographThermograph
Gramophone record
Continuous: space and amplitude
Discrete: time
Camera Reel camera
Discrete: time and amplitude
Digital WatchWeather station
Discrete: time, space and
amplitude
Digital camera Digital video camera
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
na
l Am
plit
ud
e
Time0 100 200 300 400 500 600 700 800 900 1000
-4
-2
0
2
4
6
8
10
Sig
na
l Am
plit
ud
e
Analog to Digital Conversion (ADC)
Digital to Analog Conversion (DAC)
y=x(t) y=x[n]
Analog-Digital conversion
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 ADCsTime
0 100 200 300 400 500 600 700 800 900 1000-4
-2
0
2
4
6
8
10
Sig
na
l Am
plit
ud
e
y[n]=0 0 -2 -4 -2 0 4 8 10 10
Examples of ADC applications
• Input line of a soundcard
• Sensor of digital camera
• Mobile phone
• Computer mouse
• …
Digital-Analog conversion
• Transforms a series of values into a continuous
signal
• DAC outputs piecewise
constant signal
• Additional filter stage to
smooth signal
Time0 100 200 300 400 500 600 700 800 900 1000
-4
-2
0
2
4
6
8
10
Sig
na
l Am
plit
ud
e
y[n]=0 0 -2 -4 -2 0 4 8 10 10
Digital-Analog Converter (DAC)
Examples of DAC applications
• Mobile phone
• MP3 player
• Monitor of digital camera
• Graphics card (with older monitors)
• Monitors (newer systems)
• DVB-T receiver
Waves
Waves“A wave is a disturbance that
propagates through space and
time, usually with transference
of energy.”
Wave function:
f
v
f
2
2
sin),(
k
tkxtxf
“wave number”
“angular frequency”
“wave length”
Electromagnetic spectrum
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
Signals
Random 1D Signal
)(tf
0 100 200 300 400 500 600 700 800 900 1000-4
-2
0
2
4
6
8
10
Time
Sig
nal A
mplit
ude
Standard waveforms
Sinusoid (Sine Wave)
)sin()( tAty
phase :
frequencyangular :
amplitude :
A
Dirac delta function
1)(
0,0
0,)(
dtt
x
xt
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0
0.2
0.4
0.6
0.8
1
Operators
Addition
=-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0
0.2
0.4
0.6
0.8
1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 20
0.2
0.4
0.6
0.8
1
1.2
1.4
+-2 -1.5 -1 -0.5 0 0.5 1 1.5 20
0.5
1
1.5
2
2.5
Remember, the signal is now a sequence of numbers
S1[n]=… 0 0 0 1 1 1 1 0 0 0 0 …
S2[n]=…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1.5 -1 -0.5 0 0.5 1 1.5 2
0.2
0.4
0.6
0.8
1
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
=
Properties
)()()(
tionmultiplicascalar ity with Associativ
)()()(
vityDistributi
)()(
ityAssociativ
ityCommutativ
agfgafgfa
hfgfhgf
hgfhgf
fggf
Fourier transform
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.
“Any periodic function …”
from: Robert W. Stewart, Daniel García-Alís, “Concise DSP Tutorial”
“…can be decomposed into a sum of sines and cosines”from: Robert W. Stewart, Daniel García-Alís, “Concise DSP Tutorial”
10
2sin
2cos)(
n nn nT
ntB
T
ntAtx
From Real to Complex Coefficients
1022
)(0000
n
tintin
n
tintin
ni
eeB
eeAAtf
Real Fourier coefficients:
Using the Euler relationships:
we can express sin and cos using
exponential functions
And substituting sin and cos
we get:
and then
We can now express our Fourier series with
complex coefficients
R,;2
sin2
cos)(10
nnn nn BAT
ntB
T
ntAAtf
i
eeee
iie
ie
iiii
i
i
2sin;
2cos
sincos)sin()cos(
sincos
1
1
000
22)(
n n
tinnntinnn eiBA
eiBA
Atf
C;)( 0
nn
tin
n CeCtf
Magnitude and Phasennn CCC
nC
nC
Examples
Sawtooth function approximated by the first five partial Fourier series
[Mathematica demo]
http://demonstrations.wolfram.com/
ApproximationOfDiscontinuousFunctionsByFourierSeries/
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]
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]
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]
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]
Common Fourier Transform
)()( 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]
Properties
)()()())(()(nConvolutio
)(1
)()()(Scaling
)()()()(Modulation
)()()()(nTranslatio
)()()(bg(x)af(x)h(x)Linearity
0
2
2
0
0
0
gfhxgfxh
af
ahaxfxh
fhxfexh
fehxxfxh
gbfah
ix
ix
Conclusion
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
• Convolution and its application to signal processing
• Fourier decomposition: every periodic signal can be decomposed into a sum of sines and cosines
• Fourier coefficients are the weights in this sum
Additional Literature – Week 4
Book
• McClellan J. , Schafer R., Yoder M. “DSP First: A
Multimedia Approach”, Prentice Hall, 1998