51
BME 310 Biomedical Computing - J.Schesser 18 Sinusoids Lecture #2 Chapter 2

Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

18

Sinusoids

Lecture #2Chapter 2

Page 2: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

19

What Is this Course All About ?

• To Gain an Appreciation of the Various Types of Signals and Systems

• To Analyze The Various Types of Systems

• To Learn the Skills and Tools needed to Perform These Analyses.

• To Understand How Computers Process Signals and Systems

Page 3: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

20

Sinusoidal Signal• Sinusoidal Signals are periodic functions which are based on the sine or

cosine function from trigonometry.• The general form of a Sinusoidal Signal

x(t)=A cos(ωot +ϕ)Or

x(t)=A cos(2πfot +ϕ)

– where cos (∙) represent the cosine function• We can also use sin(∙), the sine function

– ωot +ϕ or 2πfot +ϕ is angle (in radians) of the cosine function • Since the angle depends on time, it makes x(t) a signal

– ωo is the radian frequency of the sinusoidal signal• fo is called the cyclical frequency of the sinusoidal signal

– ϕ is the phase shift or phase angle– A is the amplitude of the signal

Page 4: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

21

Examplex(t)=10 cos(2π(440)t -0.4π)

One cycle takes 1/440 = .00227 secondsThis is called the period, T, of the sinusoid and is

equal to the inverse of the frequency, f

-15

-10

-5

0

5

10

15

0 0.005 0.01 0.015 0.02

Page 5: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

22

Sine and Cosine Functions• Definition of sine and cosine

• Depending upon the quadrant of θ the sine and cosine function changes– As the θ increases from 0 to π/2, the cosine decreases from 1 to 0 and the sine

increases from 0 to 1– As the θ increases beyond π/2 to π, the cosine decreases from 0 to -1 and the

sine decreases from 1 to 0 – As the θ increases beyond π to 3π/2, the cosine increases from -1 to 0 and the

sine decreases from 0 to -1 – As the θ increases beyond 3π/2 to 2π, the cosine increases from 0 to 1 and the

sine increases from -1 to 0

θ

r

x

y

cos

cos

sin

sin

rxrx

ryry

Page 6: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

23

Properties of Sinusoids

Property Equation

Equivalence sin θ = cos (θ – π / 2) or cos θ = sin (θ + π/2)

Periodicity cos (θ + 2πk)=cos θ or sin (θ +2πk)=sin θ where k is an integer

Evenness of cosine cos θ = cos (-θ )

Oddness of sine sin θ = -sin (-θ )

Zeros of sine sin πk = 0, when k is an integer

Zeros of cosine cos [π(k+1)/2] = 0, when k is an even integer; odd multiples of π/2

Ones of the cosine cos 2πk = 1, when k is an integer; even multiples of π

Ones of the sine sin [π(k+1/2)] = 1, when k is an even integer; alternate odd multiples of π/2

Negative ones of the cosine cos [2π(k +1)/2]= -1, when k is an integer; odd multiples of π

Negative ones of the sine sin [π(k +1/2)]= -1, when k is an odd integer; alternate odd multiples of 3π/2

-1

-0.5

0

0.5

1

-9.42 -6.28 -3.14 0 3.14 6.28 9.42

cosine

-1

-0.5

0

0.5

1

-9.42 -6.28 -3.14 0 3.14 6.28 9.42

sine

-1

-0.5

0

0.5

1

-9.42 -6.28 -3.14 0 3.14 6.28 9.42

sine

cosine

Page 7: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

Properties of Sinusoids

BME 310 Biomedical Computing -J.Schesser

24

K (K+1)/2 X pi() cosine K K+1/2 X pi() sine0 0.5 1.571 0 0 0.5 1.571 11 1 3.142 -1 1 1.5 4.712 -12 1.5 4.712 0 2 2.5 7.854 13 2 6.283 1 3 3.5 10.996 -14 2.5 7.854 0 4 4.5 14.137 15 3 9.425 -1 5 5.5 17.279 -16 3.5 10.996 0 6 6.5 20.420 17 4 12.566 1 7 7.5 23.562 -18 4.5 14.137 0 8 8.5 26.704 1

Page 8: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

Number Equation

1 sin2θ +cos2θ = 1

2 cos 2θ = cos2θ – sin2θ

3 sin 2θ = 2 sin θ cos θ

4 sin (a ± b) = sin a cos b ± cos a sin b

5 cos (a ± b) = cos a cos b sin a sin b

6 cos a cos b = [cos (a + b) + cos (a - b)]/2

7 sin a sin b = [cos (a - b) - cos (a + b)]/2

8 cos2θ = [1 + cos 2θ]/2

9 sin2θ = [1 - cos 2θ]/2

10 d sin θ / dθ = cos θ

11 d cos θ / dθ = -sin θ

BME 310 Biomedical Computing -J.Schesser

25

Identities and Derivatives

Page 9: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

26

Sinusoidal Signal• The general form of a Sinusoidal Signal

x(t)=A cos(ωot +θ) = A cos(2πfot + θ)

– ωo = 2πfo is the radian frequency of the sinusoidal signal • Since ωot has units of radians which is dimensionless, ωo has units of rad/sec

– fo is called the cyclical frequency of the sinusoidal signal • Has units of sec-1 or Hz (formerly, cycles per second)

– θ is the phase shift or phase angle• Has units of radians

– A is the amplitude of the signal and is the scaling factor that determines how large the signal will be.

• Since the cosine function varies from -1 to +1 then our signal will vary from –A to +A.

• A is sometimes called the peak of the signal and 2A is called the peak-to-peak value

Page 10: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

27

Sinusoid Signalsx(t)=20 cos(2π(40)t -0.4π)

A = 20, ωo = 2π(40), fo= 40, θ = - 0.4π-20

-15

-10

-5

0

5

10

15

20

-0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04

Maxima at 2π(40)t-0.4π =2πk or when t = …, -0.02, 0.005, 0.03,…Minima at 2π(40)t-0.4π =2π(k+1)0.5 or when t = … -0.0075, 0.0175

Time Period (1/fo) between = 0.005- (-0.02) =0.025 sec

Page 11: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

28

Relation of Period to Frequency• Period of a sinusoid, To, is the length of one cycle and

To = 1/fo

• The following relationship must be true for all Signals which are periodic (not just sinusoids)

x(t + To) = x(t)• So

A cos(ωo(t + To) + θ) = A cos(ωot + θ) A cos(ωot + ωoTo + θ) = A cos(ωot + θ)

Page 12: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

29

Relation of Period to Frequency Continued

• Since a sinusoid is periodic in 2π, this means:since To = 1/fo

Then ωoTo = 2πfoTo

ωoTo = 2πtherefore, To = 2π/ωo

A cos(ωot + ωoTo + θ) = A cos(ωot + θ)A cos(ωot + 2π + θ) = A cos(ωot + θ)

• The period is in units of seconds• The frequency is in units of sec-1 or Hz (formerly,

cycles per second)

Page 13: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

30

Frequencies

A cos(2πfot + θ) for 200 Hz, 100 Hz, 0 Hz

200 Hz

-5

5

-0.015 -0.01 -0.005 0 0.005 0.01 0.015 0.02

0 Hz

-5

5

-0.015 -0.01 -0.005 0 0.005 0.01 0.015 0.02

100 Hz

-5

5

-0.015 -0.01 -0.005 0 0.005 0.01 0.015 0.02

Page 14: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

31

Phase Shift and Time Shift

• The phase shift parameter θ (with frequency) determines the time locations of the maxima and minima of the sinusoid.

• When θ = 0, then for positive peak at t = 0.• When θ ≠ 0, then the phase shift determines

how much the maximum is shifted from t = 0.• However, delaying a signal by t1 seconds, also

shifts its waveform.

Page 15: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

32

Time Shifting• Look at the following waveform:

elsewhere 0

221 )24(

31)(

210 2

t tts

t t

-0.2

0

0.2

0.4

0.6

0.8

1

1.2

-1 0 1 2 3 4

Page 16: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

33

Time Shifting Continued

• Now let’s time shifted it by 2 seconds (delay),x(t)=s(t - 2)

elsewhere 0

42122)2(

21 )28(

31))2(24(

31)(

2122

21)2(0 4- 2 2)- (2

tttttx

tttt

-0.2

0

0.2

0.4

0.6

0.8

1

1.2

-1 0 1 2 3 4

Page 17: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

34

Time Shifting Continued

• Now let’s time shifted it by -1 seconds (advance), x(t)=s(t + 1)

elsewhere 0

1212)1(

21 )22(

31))1(24(

31)(

211

21)1(0 2 2 1) (2

tttttx

tttt

-0.2

0

0.2

0.4

0.6

0.8

1

1.2

-1 0 1 2 3 4

Page 18: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

35

Time Shifting

-0.2

0

0.2

0.4

0.6

0.8

1

1.2

-1 0 1 2 3 4-0.2

0

0.2

0.4

0.6

0.8

1

1.2

-1 0 1 2 3 4-0.2

0

0.2

0.4

0.6

0.8

1

1.2

-1 0 1 2 3 4-0.2

0

0.2

0.4

0.6

0.8

1

1.2

-1 0 1 2 3 4-0.2

0

0.2

0.4

0.6

0.8

1

1.2

-1 0 1 2 3 4

Page 19: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

36

Phase shift and Time Shift

-1.5

-1

-0.5

0

0.5

1

1.5

-6.28 -4.71 -3.14 -1.57 0 1.57 3.14 4.71 6.28

Radians-1.5

-1

-0.5

0

0.5

1

1.5-0.025 -0.01875 -0.0125 -0.00625 0 0.00625 0.0125 0.01875 0.025

Time (seconds) ( ) cos(2 40 )2

40 ;1 0.025 sec40

phase shift:

2time shift:

12 0.00625 sec 2 40 160

( ) cos(2 40( 0.00625))

s

x t t

f Hz

T

t

x t t

Time shift = 0.00625 s

Phase shift = π / 2 radians

Page 20: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

37

Phase and Time Shiftx(t-t1) = A cos(ωo(t-t1)) = A cos(ωot + θ)

A cos(ωot-ωot1) = A cos(ωot + θ)ωot-ωot1 = ωot +ϕ

-ωot1 = θt1 = - θ / ωo = -ϕ / 2πfo

θ= - 2πfot1=-2π(t1/ To)

• Note that a positive (negative) value of t1 equates to a delay (advance)

• And a a positive (negative) value of θ equates to an advance (delay)

Page 21: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

38

Phase and Time Shift• Note that a positive (negative) value of t1 equates to a delay

(advance)• And a a positive (negative) value of θ equates to an advance

(delay)

x(t) =5 cos(2π 50t + θ)θ = π / 2; -π / 2

t1 = - π / 2 / (2π 50) = -.005 sec; +.005 sec

-5

5

-0.015 -0.01 -0.005 0 0.005 0.01 0.015 0.02

-5

5

-0.015 -0.01 -0.005 0 0.005 0.01 0.015 0.02

-5

5

-0.015 -0.01 -0.005 0 0.005 0.01 0.015 0.02

Page 22: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

39

Time shifting

-1.5

-1

-0.5

0

0.5

1

1.5

-1 0 1 2 3 4

-1.5

-1

-0.5

0

0.5

1

1.5

-1 0 1 2 3 4

-1.5

-1

-0.5

0

0.5

1

1.5

-1 0 1 2 3 4

-1.5

-1

-0.5

0

0.5

1

1.5

-1 0 1 2 3 4

-1.5

-1

-0.5

0

0.5

1

1.5

-1 0 1 2 3 4

Shift = 0.25 secondsShift = 0.5 secondsShift = 0.75 secondsShift = 1.0 seconds

Page 23: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

40

Periodicity of Sinusoids

What happens when θ = 2π ? • When θ = 2 π, then the sinusoidal waveform

does not change since sinusoids are periodic in 2π

• Therefore, adding or subtracting multiple of 2πdoes not change the waveform

• This is called modulo 2π

Page 24: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

41

Plotting Sinusoid Signals Case #1: Delay

nsCalculatio Basic4.0,40,20 )4.0)40(2cos(20)( HzfAttx o

3) Phase angle/shift 0.4 1.25664Calculation of the time shift 2 02 (40) 0.4 0

.4 0.005sec 5 sec delay2 (40)

5 secNote that 0.2

25 secphase angle 0.4

which also equals 2 2

s

s

s

s

o

radiansft

t

t m

mtT m

0.2

sec25sec025.0 4011

Period theofn Calculatio40 Frequency 2)20 is e1)Amplitud

mf

T

Hz

oo

Page 25: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

42

Plotting Sinusoid Signals

-30

-20

-10

0

10

20

30

-0.02 -0.01 0 0.01 0.02 0.03 0.04

1 cycle is the Period = 0.03-

0.005 = 0.025 secTime to the first (in positive time - delay) maximum is Time Shift = 0.005 sec => Negative Phase shift

θ = -0.005*2πf = -0.4π

t 2 ft+ 20 cos (2 ft+ )-0.0250 -7.54 6.18-0.0225 -6.91 16.18-0.0200 -6.28 20.00-0.0175 -5.65 16.18-0.0150 -5.03 6.18-0.0125 -4.40 -6.18-0.0100 -3.77 -16.18-0.0075 -3.14 -20.00-0.0050 -2.51 -16.18-0.0025 -1.88 -6.180.0000 -1.26 6.180.0025 -0.63 16.180.0050 0.00 20.000.0075 0.63 16.180.0100 1.26 6.180.0125 1.88 -6.180.0150 2.51 -16.180.0175 3.14 -20.000.0200 3.77 -16.180.0225 4.40 -6.180.0250 5.03 6.180.0275 5.65 16.180.0300 6.28 20.000.0325 6.91 16.180.0350 7.54 6.180.0375 8.17 -6.180.0400 8.80 -16.180.0425 9.42 -20.000.0450 10.05 -16.180.0475 10.68 -6.180.0500 11.31 6.18

Since the period is 0.025, chose to plot the graph with 10 points per cycle or a Δ t of 0.0025 seconds.

Page 26: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

43

Plotting Sinusoid Signals Case #1: No Delay

nsCalculatio Basic0,40,20 ))40(2cos(20)( HzfAttx o

3) Phase angle/shift 0 radiansCalculation of the time shift 2 fts 02 (40)ts 0 0

ts 0

2 (40) 0sec

sec25sec025.0 4011

Period theofn Calculatio40 Frequency 2)20 is e1)Amplitud

mf

T

Hz

oo

Page 27: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

44

-30.00

-20.00

-10.00

0.00

10.00

20.00

30.00

-0.0200 -0.0100 0.0000 0.0100 0.0200 0.0300 0.0400

Plotting Sinusoid Signals

1 cycle is the Period = 0.025 sec

Time to the first maximum is Time Shift = 0 sec =>

Phase shift of θ = 0

Since the period is 0.025, chose to plot the graph with 10 points per cycle or a Δ t of 0.0025 seconds.

t 2 ft+ 20 cos (2 ft+ )-0.0250 -6.28 20.00-0.0225 -5.65 16.18-0.0200 -5.03 6.18-0.0175 -4.40 -6.18-0.0150 -3.77 -16.18-0.0125 -3.14 -20.00-0.0100 -2.51 -16.18-0.0075 -1.88 -6.18-0.0050 -1.26 6.18-0.0025 -0.63 16.180.0000 0.00 20.000.0025 0.63 16.180.0050 1.26 6.180.0075 1.88 -6.180.0100 2.51 -16.180.0125 3.14 -20.000.0150 3.77 -16.180.0175 4.40 -6.180.0200 5.03 6.180.0225 5.65 16.180.0250 6.28 20.000.0275 6.91 16.180.0300 7.54 6.180.0325 8.17 -6.180.0350 8.80 -16.180.0375 9.42 -20.000.0400 10.05 -16.180.0425 10.68 -6.180.0450 11.31 6.180.0475 11.94 16.180.0500 12.57 20.00

Page 28: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

45

Plotting Sinusoid Signals Case #1: Advance

( ) 20cos(2 (40) 0.6 ) 20, 40 , 0.6Basic Calculations

ox t t A f Hz

sec25sec025.0 4011

Period theofn Calculatio40 Frequency 2)20 is e1)Amplitud

mf

T

Hz

oo

3) Phase angle/shift 0.6 1.885Calculation of the time shift 2 02 (40) 0.6 0

.6 0.0075sec 7.5 sec advance2 (40)

7.5 secNote that 0.3

25 secphase angle

which also equals 2

s

s

s

s

o

radiansft

t

t m

mtT m

0.60.3

2

Page 29: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

46

-30.00

-20.00

-10.00

0.00

10.00

20.00

30.00

-0.0200 -0.0100 0.0000 0.0100 0.0200 0.0300 0.0400

Plotting Sinusoid Signals

1 cycle is the Period = 0.03-0.005 = 0.025 sec

Time to the first maximum (in negativetime - advance) is Time Shift = -0.0075 sec => Positive Phase Shift

θ = 0.0075*2πf = +0.6π

Since the period is 0.025, chose to plot the graph with 10 points per cycle or a Δ t of 0.0025 seconds.

Time to the first maximum (in positive time -delay) is Time Shift = +0.0175 sec =>

Negative Phase Shift θ = 0.0075*2πf = -1.4

t 2 ft + 20 cos (2 ft+ )-0.0250 -4.40 -6.18-0.0225 -3.77 -16.18-0.0200 -3.14 -20.00-0.0175 -2.51 -16.18-0.0150 -1.88 -6.18-0.0125 -1.26 6.18-0.0100 -0.63 16.18-0.0075 0.00 20.00-0.0050 0.63 16.18-0.0025 1.26 6.180.0000 1.88 -6.180.0025 2.51 -16.180.0050 3.14 -20.000.0075 3.77 -16.180.0100 4.40 -6.180.0125 5.03 6.180.0150 5.65 16.180.0175 6.28 20.000.0200 6.91 16.180.0225 7.54 6.180.0250 8.17 -6.180.0275 8.80 -16.180.0300 9.42 -20.000.0325 10.05 -16.180.0350 10.68 -6.180.0375 11.31 6.180.0400 11.94 16.180.0425 12.57 20.000.0450 13.19 16.180.0475 13.82 6.180.0500 14.45 -6.18

Page 30: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

47

Matlab Program to Plot Sinusoidsfunction cosineplotphase(Frequency,Amplitude,Phase,Points,Timestart,Timeend);omega=2*pi*Frequency;Period=1/Frequency;phase=Phase;Timedelta=Period/Points;time = (Timestart:Timedelta:Timeend);y=Amplitude*cos(omega*time+phase);plot(time,y,'r');title('Sinusoidal Plot');xlabel('Seconds');axis([ Timestart Timeend -1.1*Amplitude +1.1*Amplitude]);

Page 31: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

48

What’s so important about Sinusoids and periodic signals?

• Are signals is nature periodic?• Name some:

– Vibrations– Voice– Electromagnetic– Biomedical

• So are signals is nature periodic?– Not always but we may be able to model them with period signals

• Biomedical Research Summer Institute Examples:– Measure blood viscosity– Measure cell mass

Page 32: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

49

Complex Numbers

• Complex numbers: What are they?• What is the solution to this equation?

ax2+bx+c=0• This is a second order equation whose solution

is:2

1,24

2b b acx

a

Page 33: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

50

What is the solution to?

1. x2+4x+3=0

3,1224

244

212164

23444 2

2,1

x

Page 34: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

51

What is the solution to?

2. x2+4x+5=0

????? 244

220164

25444 2

2,1

x

Page 35: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

52

What is the Square Root of a Negative Number?

• We define the square root of a negative number as an imaginary number

• We define

• Then our solution becomes:ans)mathematicfor ( engineersfor 1 i j

12,122

242

44 2

442

201642

5444 2

2,1

jjjj

x

Page 36: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

53

The Complex Plane• z = x+jy is a complex number where:

x = Re{z} is the real part of zy = Im{z} is the imaginary part of z

• We can define the complex plane and we can define 2 representations for a complex number:

Re{z}

Im{z}

x

y

z = x+jy

(x,y)

Page 37: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

54

Rectangular Form• Rectangular (or cartesian) form of a complex

number is given asz = x+jyx = Re{z} is the real part of zy = Im{z} is the imaginary part of z

Re{z}

Im{z}

Rectangular or Cartesian

x

y

z = x+jy

(x,y)

Page 38: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

• z = r e jθ = r θ is a complex number where:• r is the magnitude of z• θ is the angle or argument of z (arg z)

BME 310 Biomedical Computing -J.Schesser

55

Polar Form

Re{z}

Im{z}

Polar

x

y

z = r e jθ

(r,)

r

Page 39: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

56

Relationships between the Polar and Rectangular Forms

z = x + jy = r e jθ

• Relationship of Polar to the Rectangular Form:x = Re{z} = r cos θy = Im{z} = r sin θ

• Relationship of Rectangular to Polar Form:

)arctan( and 22

xyyxr

Page 40: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

57

Addition of 2 complex numbers• When two complex numbers are added, it is best to use

the rectangular form.• The real part of the sum is the sum of the real parts and

imaginary part of the sum is the sum of the imaginary parts.

• Example: z3 = z1 + z2

)()(

;

2121

2121

2211213

222111

yyjxxjyjyxx

jyxjyxzzzjyxzjyxz

Re

Im

z

z

x

yy

xxx2

yy2

z

Page 41: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

58

Multiplication of 2 complex numbers• When two complex numbers are multiplied, it is best

to use the polar form:• Example: z3 = z1 x z2

• We multiply the magnitudes and add the phase angles

)(21

)()(21

)(2

)(1213

)(22

)(11

2121

21

21 ;

jjj

jj

jj

erreerrererzzz

erzerz

Re

Im

θ1

r

θ2rr3 = r1 r2

θ3= θ1 + θ2

Page 42: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

59

Some examples51505)

2sin(5)

2cos(55 2 jjje j

50515)sin(5)cos(55 jje j

43)1(tan222 251)1(5)1(55555

1 jjjj eejjee

Re

Im

50515)sin(5)cos(5)sin(5)cos(55 jjje j

Page 43: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

60

Some examples24 55

jj ee )

2sin(5)

2cos(5)

4sin(5)

4cos(555 24

jjee jj

52

502

5 jj

18.141.2tan

)41.2(tan)536.3536.8(tan22

24.9367.84

86.725.12536.8536.3

536.8536.3

1

11

jj

jj

ee

ee

j

707.152

5 j

Page 44: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

61

Some examples

)2

sin(5)2

cos(5)4

sin(5)4

cos(555 24

jjee jj

707.15707.05707.152

5

52

502

5

jj

jj

18.118.118.1

)41.2(tan)707.707.1(tan22

24.985.1541.35

91.25.05707.1707.0511

jjj

jj

eee

ee

OR

Page 45: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

62

Some examples18.1

24 24.955 jjj eee

Re

Im

Page 46: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

63

Euler’s Formulae jθ = cos θ + j sin θ

• We can use Euler’s Formula to define complex numbers

z = r e jθ= r cos θ + j r sin θ= x + j y

Re{z}

Im{z}

θ

Page 47: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

64

Complex Exponential Signals• A complex exponential signal is define as:

• Note that it is defined in polar form where– the magnitude of z(t) is |z(t)| = A – the angle (or argument, arg z(t) ) of z(t) = (ωot + θ)

• Where ωo is called the radian frequency and θ is the phase angle (phase shift)

( )( ) oj tz t Ae

Page 48: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

65

Complex Exponential Signals• Note that by using Euler’s formula, we can rewrite the

complex exponential signal in rectangular form as:

• Therefore real part is the cosine signal and imaginary part is a sine signal both of radial frequency ωo and phase angle of θ

( )( )cos( ) sin( )

oj t

o o

z t AeA t jA t

Page 49: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

66

Plotting the waveform of a complex exponential signal

• For an complex signal, we plot the real part and the imaginary part separately.

• Example: z(t) = 20e j(2π(40)t-0.4π) = 20e j(80πt-0.4π)

= 20 cos(80πt-0.4π) + j20 sin(80πt-0.4π)

-20

-15

-10

-5

0

5

10

15

20

-0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04

real part

-20

-15

-10

-5

0

5

10

15

20

-0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04

imaginary part

Page 50: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

67

NOTE!!!!• The reason why we prefer the complex

exponential representation of the real cosine signal:

• In solving equations and making other calculations, it easier to use the complex exponential form and then take the Real Part.

( )( ) { ( )} { }cos( )

oj t

o

x t e z t e AeA t

Page 51: Sinusoids - web.njit.edujoelsd/Fundamentals/coursework/BME310comp… · BME 310 Biomedical Computing - J.Schesser 23 Properties of Sinusoids Property Equation Equivalence sin θ=

BME 310 Biomedical Computing -J.Schesser

68

Homework• Exercises:

– 2.1 – 2.5

• Problems:

- 2.1 Instead plot x(t) 5cos(225

t 10

) for 25 t 50

Plot x(t) using Matlab; as part of your answer provide your code- 2.2- 2.3a, 2.3b =0.4 , Plot these functions using Matlab; as part of your answer provide your code- 2.4