signals, instruments, and systems w4 an introduction to ......signal • dac outputs piecewise...

58
Signals, Instruments, and Systems W4 An Introduction to Signal Processing

Upload: others

Post on 01-Jan-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Signals, Instruments, and Systems – W4

An Introduction to Signal

Processing

Page 2: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

),( 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

Page 3: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Continuous versus Discrete

Page 4: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Continuous Discrete

1 2 3 4 5 6

x

x1 2 3 4 5 6

x

Rx2,478956983748…

Page 5: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Analog versus Digital

Page 6: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Analog versus Digital

• An analog signal …

– is continuous in time

– has continuous values

• A digital signal …

– is discrete in time

– has discrete values

Page 7: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

• 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

Page 8: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Sensors

Continuous – Discrete

Continuous

(Analog)

Discrete

(Digital)

Time

Space

Amplitude

Page 9: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Continuous: amplitude, time

Thermometer

Barometer

Page 10: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Continuous: time and amplitude

BarographThermograph

Gramophone record

Page 11: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Continuous: space and amplitude

Discrete: time

Camera Reel camera

Page 12: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Discrete: time and amplitude

Digital WatchWeather station

Page 13: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Discrete: time, space and

amplitude

Digital camera Digital video camera

Page 14: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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]

Page 15: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Analog-Digital conversion

Page 16: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

Page 17: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Examples of ADC applications

• Input line of a soundcard

• Sensor of digital camera

• Mobile phone

• Computer mouse

• …

Page 18: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Digital-Analog conversion

Page 19: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

• 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)

Page 20: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Examples of DAC applications

• Mobile phone

• MP3 player

• Monitor of digital camera

• Graphics card (with older monitors)

• Monitors (newer systems)

• DVB-T receiver

Page 21: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Waves

Page 22: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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”

Page 23: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Electromagnetic spectrum

Page 24: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

Page 25: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Signals

Page 26: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

Page 27: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Standard waveforms

Page 28: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Sinusoid (Sine Wave)

)sin()( tAty

phase :

frequencyangular :

amplitude :

A

Page 29: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

Page 30: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Operators

Page 31: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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]=… 0 0 0,4 0,6 0,8 1 0,6 0,4 0 0 0 …

S3[n]=S1[n]+S2[n]

Page 32: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Subtraction

- =-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

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2-0.5

-0.4

-0.3

-0.2

-0.1

0

0.1

0.2

0.3

0.4

0.5

Page 33: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Multiplication

=-2 -1.5 -1 -0.5 0 0.5 1 1.5 20

0.2

0.4

0.6

0.8

1

x-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

-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

Page 34: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Convolution

dtgftgf )()()(

Page 35: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

[Matlab demo]

http://users.ece.gatech.edu/mcclella/matlabGUIs/

Page 36: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

Page 37: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

=

Page 38: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

Page 39: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

Page 40: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

=

Page 41: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Properties

)()()(

tionmultiplicascalar ity with Associativ

)()()(

vityDistributi

)()(

ityAssociativ

ityCommutativ

agfgafgfa

hfgfhgf

hgfhgf

fggf

Page 42: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Fourier transform

Page 43: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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.

Page 44: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

“Any periodic function …”

from: Robert W. Stewart, Daniel García-Alís, “Concise DSP Tutorial”

Page 45: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

“…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

Page 46: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

Page 47: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Magnitude and Phasennn CCC

nC

nC

Page 48: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Examples

Sawtooth function approximated by the first five partial Fourier series

Page 49: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

[Mathematica demo]

http://demonstrations.wolfram.com/

ApproximationOfDiscontinuousFunctionsByFourierSeries/

Page 50: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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]

Page 51: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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]

Page 52: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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]

Page 53: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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]

Page 54: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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]

Page 55: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

Page 56: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Conclusion

Page 57: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

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

Page 58: Signals, Instruments, and Systems W4 An Introduction to ......signal • DAC outputs piecewise constant signal • Additional filter stage to smooth signal Time 0 100 200 300 400 500

Additional Literature – Week 4

Book

• McClellan J. , Schafer R., Yoder M. “DSP First: A

Multimedia Approach”, Prentice Hall, 1998