58
Signal Processing First Chapter 2 Sinusoids

Signal Processing First Chapter 2 Sinusoids - Konkukkonkuk.ac.kr/~cyim/dsp/Chapter2.pdfAppendix A: Complex Numbers Appendix B: MATLAB Chapter 1: Introduction. 2/28/2018 2003 rws/jMc

  • Upload
    lethien

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

Signal Processing First

Chapter 2Sinusoids

2/28/2018 2003 rws/jMc 2

License Info for SPFirst Slides

This work released under a Creative Commons Licensewith the following terms:

Attribution The licensor permits others to copy, distribute, display, and perform

the work. In return, licensees must give the original authors credit.

Non-Commercial The licensor permits others to copy, distribute, display, and perform

the work. In return, licensees may not use the work for commercial purposes—unless they get the licensor's permission.

Share Alike The licensor permits others to distribute derivative works only under

a license identical to the one that governs the licensor's work. Full Text of the License This (hidden) page should be kept with the presentation

2/28/2018 2003 rws/jMc 3

READING ASSIGNMENTS

This Lecture: Chapter 2

Appendix A: Complex Numbers Appendix B: MATLAB Chapter 1: Introduction

2/28/2018 2003 rws/jMc 4

CONVERGING FIELDS

EECmpE

Math

Applications

Physics

ComputerScience

2/28/2018 2003 rws/jMc 5

COURSE OBJECTIVE

Students will be able to: Understand mathematical descriptions of

signal processing algorithms and express those algorithms as computer implementations (MATLAB)

What are your objectives?

2/28/2018 2003 rws/jMc 6

WHY USE DSP ?

Mathematical abstractions lead to generalization and discovery of new processing techniques

Computer implementations are flexible

Applications provide a physical context

2/28/2018 2003 rws/jMc 7

Fourier Everywhere

Sound & Music (Audio processing) Image processing Video processing Telecommunications Fourier Optics

2/28/2018 2003 rws/jMc 8

LECTURE OBJECTIVES

Write general formula for a “sinusoidal”waveform, or signal From the formula, plot the sinusoid versus

time

What’s a signal? It’s a function of time, x(t)

in the mathematical sense

2/28/2018 2003 rws/jMc 9

4-1 Tuning Fork Example

CD-ROM demo “A” is at 440 Hertz (Hz) Waveform is a SINUSOIDAL SIGNAL Computer plot looks like a sine wave This should be the mathematical formula:

))440(2cos( tA

2/28/2018 2003 rws/jMc 10

TUNING FORK A-440 Waveform

ms 3.285.515.8

T

Hz4353.2/1000

/1

Tf

Time (sec)

2/28/2018 2003 rws/jMc 11

SPEECH EXAMPLE

More complicated signal (BAT.WAV) Waveform x(t) is NOT a Sinusoid Theory will tell us x(t) is approximately a sum of sinusoids FOURIER ANALYSIS Break x(t) into its sinusoidal components

Called the FREQUENCY SPECTRUM

2/28/2018 2003 rws/jMc 12

Speech Signal: BAT

Nearly Periodic in Vowel Region Period is (Approximately) T = 0.0065 sec

2/28/2018 2003 rws/jMc 13

DIGITIZE the WAVEFORM

x[n] is a SAMPLED SINUSOID A list of numbers stored in memory

Sample at 11,025 samples per second Called the SAMPLING RATE of the A/D Time between samples is 1/11025 = 90.7 microsec

Output via D/A hardware

2/28/2018 2003 rws/jMc 14

STORING DIGITAL SOUND

x[n] is a SAMPLED SINUSOID A list of numbers stored in memory

CD rate is 44,100 samples per second 16-bit samples Stereo uses 2 channels Number of bytes for 1 minute is 2 X (16/8) X 60 X 44100 = 10.584 Mbytes

2/28/2018 2003 rws/jMc 15

Always use the COSINE FORM

Sine is a special case:

))440(2cos( tA

2-2 Sine and Cosine Functions

)cos()sin( 2 tt

2/28/2018 2003 rws/jMc 16

2-3 Sinusoidal Signal

FREQUENCY Radians/sec Hertz (cycles/sec)

PERIOD (in sec)

AMPLITUDE Magnitude

PHASE

A tcos( ) A

( )2 f

Tf

1 2

2/28/2018 2003 rws/jMc 17

EXAMPLE of SINUSOID

Given the Formula

Make a plot)2.13.0cos(5 t

2/28/2018 2003 rws/jMc 18

PLOT COSINE SIGNAL

Formula defines A, , and 5 0 3 12cos( . . ) t

A 5 0.3 1.2

2/28/2018 2003 rws/jMc 19

PLOTTING COSINE SIGNAL from the FORMULA

Determine period:

Determine a peak location by solving

Zero crossing is T/4 before or after

Positive & Negative peaks spaced by T/2

)2.13.0cos(5 t

3/203.0/2/2 T

0)2.13.0(0)( tt

2/28/2018 2003 rws/jMc 20

PLOT the SINUSOID

Use T=20/3 and the peak location at t=-4

)2.13.0cos(5 t

320

2/28/2018 © 2003, JH McClellan & RW Schafer 21

SINUSOIDAL SIGNAL

FREQUENCY Radians/sec or, Hertz (cycles/sec)

PERIOD (in sec)

AMPLITUDE Magnitude

PHASE

)cos( tA

f)2(

21

f

T

A

2/28/2018 © 2003, JH McClellan & RW Schafer 22

PLOTTING COSINE SIGNAL from the FORMULA

Determine period:

Determine a peak location by solving

Peak at t=-4

)2.13.0cos(5 t

0)( t

3/203.0/2/2 T

2/28/2018 © 2003, JH McClellan & RW Schafer 23

ANSWER for the PLOT

Use T=20/3 and the peak location at t=-4

)2.13.0cos(5 t

320

2/28/2018 © 2003, JH McClellan & RW Schafer 24

TIME-SHIFT

In a mathematical formula we can replace t with t-tm

Then the t=0 point moves to t=tm

Peak value of cos((t-tm)) is now at t=tm

))(cos()( mm ttAttx

2/28/2018 © 2003, JH McClellan & RW Schafer 25

TIME-SHIFTED SINUSOID

))4((3.0cos(5))4(3.0cos(5)4( tttx

2/28/2018 © 2003, JH McClellan & RW Schafer 26

PHASE <--> TIME-SHIFT

Equate the formulas:

and we obtain:

or,

)cos())(cos( tAttA m

mt

mt

2/28/2018 © 2003, JH McClellan & RW Schafer 27

SINUSOID from a PLOT

Measure the period, T Between peaks or zero crossings

Compute frequency: = 2/T

Measure time of a peak: tm

Compute phase: = -tm

Measure height of positive peak: A

3 steps

2/28/2018 © 2003, JH McClellan & RW Schafer 28

(A, , ) from a PLOT

25.0))(200( mm tt

20001.022 T100

1period1

sec01.0 T

sec00125.0mt

2/28/2018 © 2003, JH McClellan & RW Schafer 29

Ttt

t

mm

m

2)2(2

then, if

PHASE is AMBIGUOUS

The cosine signal is periodic Period is 2

Thus adding any multiple of 2 leaves x(t) unchanged

)cos()2cos( tAtA

2/28/2018 © 2003, JH McClellan & RW Schafer 30

2-5 Complex Exponentials

tjXetz )(

Introduce an ABSTRACTION:Complex Numbers represent SinusoidsComplex Exponential Signal

2/28/2018 © 2003, JH McClellan & RW Schafer 31

Complex Numbers

To solve: z2 = -1 z = j Math and Physics use z = i

Complex number: z = x + j y

x

y zCartesiancoordinatesystem

2/28/2018 © 2003, JH McClellan & RW Schafer 32

PLOT COMPLEX NUMBERS

2/28/2018 © 2003, JH McClellan & RW Schafer 33

COMPLEX ADDITION = VECTOR Addition

26)53()24()52()34(

213

jj

jjzzz

2/28/2018 © 2003, JH McClellan & RW Schafer 34

*** POLAR FORM ***

Vector Form Length =1 Angle =

Common Values j has angle of 0.5 1 has angle of j has angle of 1.5 also, angle of j could be 0.51.52 because the PHASE is AMBIGUOUS

2/28/2018 © 2003, JH McClellan & RW Schafer 35

POLAR <--> RECTANGULAR

Relate (x,y) to (r,) r

x

y

Need a notation for POLAR FORM

xy

yxr1

222

Tan

sincos

ryrx

Most calculators doPolar-Rectangular

2/28/2018 © 2003, JH McClellan & RW Schafer 36

Euler’s FORMULA

Complex Exponential Real part is cosine Imaginary part is sine Magnitude is one

)sin()cos( jrrre j

)sin()cos( je j

2/28/2018 © 2003, JH McClellan & RW Schafer 37

COMPLEX EXPONENTIAL

Interpret this as a Rotating Vector t Angle changes vs. time ex: rad/s Rotates in 0.01 secs

)sin()cos( tjte tj

)sin()cos( je j

2/28/2018 © 2003, JH McClellan & RW Schafer 38

cos = REAL PART

Real Part of Euler’s}{)cos( tjeet

General Sinusoid )cos()( tAtx

So,

}{}{)cos( )(

tjj

tj

eAeeAeetA

2/28/2018 © 2003, JH McClellan & RW Schafer 39

REAL PART EXAMPLE

Answer:

Evaluate:

tjj eAeetA )cos(

tjjeetx 3)(

)5.0cos(33

)3()(5.0

teee

ejetxtjj

tj

2/28/2018 © 2003, JH McClellan & RW Schafer 40

COMPLEX AMPLITUDE

Then, any Sinusoid = REAL PART of Xejt

tjjtj eAeeXeetx )(

General Sinusoid

tjj eAeetAtx )cos()(Complex AMPLITUDE = X

jtj AeXXetz )(

2/28/2018 © 2003, JH McClellan & RW Schafer 41

2-6 Phasor Addition

Phasors = Complex Amplitude Complex Numbers represent Sinusoids

Develop the ABSTRACTION: Adding Sinusoids = Complex Addition PHASOR ADDITION THEOREM

tjjtj eAeXetz )()(

2/28/2018 © 2003, JH McClellan & RW Schafer 42

AVOID Trigonometry

Algebra, even complex, is EASIER !!! Can you recall cos(1+2) ?

Use: real part of ej12= cos(1+2)

2121 )( jjj eee

)sin)(cossin(cos 2211 jj

(...))sinsincos(cos 2121 j

2/28/2018 © 2003, JH McClellan & RW Schafer 43

Euler’s FORMULA

Complex Exponential Real part is cosine Imaginary part is sine Magnitude is one

)sin()cos( tjte tj

)sin()cos( je j

2/28/2018 © 2003, JH McClellan & RW Schafer 44

Real & Imaginary Part Plots

PHASE DIFFERENCE = /2

2/28/2018 © 2003, JH McClellan & RW Schafer 45

COMPLEX EXPONENTIAL

Interpret this as a Rotating Vector t Angle changes vs. time ex: rad/s Rotates in 0.01 secs

e jj cos( ) sin( )

)sin()cos( tjte tj

2/28/2018 © 2003, JH McClellan & RW Schafer 46

Cos = REAL PART

cos(t) e e j t Real Part of Euler’s

x(t) Acos(t )General Sinusoid

A cos( t ) e Ae j ( t ) e Ae je j t

So,

2/28/2018 © 2003, JH McClellan & RW Schafer 47

COMPLEX AMPLITUDE

x(t) Acos(t ) e Ae jej t General Sinusoid

z(t) Xe jt X Ae j

Complex AMPLITUDE = X

x(t) e Xe j t e z(t) Sinusoid = REAL PART of (Aej)ejt

2/28/2018 © 2003, JH McClellan & RW Schafer 48

POP QUIZ: Complex Amp Find the COMPLEX AMPLITUDE for:

Use EULER’s FORMULA:

5.03 jeX

)5.077cos(3)( ttx

tjj

tj

eee

eetx

775.0

)5.077(

3

3)(

2/28/2018 © 2003, JH McClellan & RW Schafer 49

WANT to ADD SINUSOIDS

ALL SINUSOIDS have SAME FREQUENCY HOW to GET {Amp,Phase} of RESULT ?

2/28/2018 © 2003, JH McClellan & RW Schafer 50

ADD SINUSOIDS

Sum Sinusoid has SAME Frequency

2/28/2018 © 2003, JH McClellan & RW Schafer 51

PHASOR ADDITION RULE

Get the new complex amplitude by complex addition

2/28/2018 © 2003, JH McClellan & RW Schafer 52

Phasor Addition Proof

2/28/2018 © 2003, JH McClellan & RW Schafer 53

POP QUIZ: Add Sinusoids

ADD THESE 2 SINUSOIDS:

COMPLEX ADDITION:

5.00 31 jj ee

)5.077cos(3)(

)77cos()(

2

1

ttx

ttx

2/28/2018 © 2003, JH McClellan & RW Schafer 54

POP QUIZ (answer)

COMPLEX ADDITION:

CONVERT back to cosine form:

j 3 3e j 0.5

1

31 j 3/231 jej

)77cos(2)( 33 ttx

2/28/2018 © 2003, JH McClellan & RW Schafer 55

ADD SINUSOIDS EXAMPLE

tm1

tm2

tm3

)()()( 213 txtxtx

)(1 tx

)(2 tx

2/28/2018 © 2003, JH McClellan & RW Schafer 56

Convert Time-Shift to Phase

Measure peak times: tm1=-0.0194, tm2=-0.0556, tm3=-0.0394

Convert to phase (T=0.1) 1=-tm1 = -2(tm1 /T) = 70/180, 2= 200/180

Amplitudes A1=1.7, A2=1.9, A3=1.532

2/28/2018 © 2003, JH McClellan & RW Schafer 57

Phasor Add: Numerical

Convert Polar to Cartesian X1 = 0.5814 + j1.597 X2 = -1.785 - j0.6498 sum = X3 = -1.204 + j0.9476

Convert back to Polar X3 = 1.532 at angle 141.79/180 This is the sum

2/28/2018 © 2003, JH McClellan & RW Schafer 58

ADD SINUSOIDS

VECTOR(PHASOR)ADD

X1

X2

X3