Sinusoids: XT A T A
Sinusoids: XT A T A
Sinusoids
• A general class of signals used for modeling the inter-
action of signals in systems, are based on the trigono-
2
metric functions sine and cosine
• The general mathematical form of a single sinusoidal signal
is
x t = A cos Z 0 t + I (2.1)
where A denotes the amplitude, Z 0 is the frequency in radi-
ans/s (radian frequency), and I is the phase in radians
– The arguments of cos and sin are in radians
• We will spend considerable time working with sinusoidal sig-
nals, and hopefully the various modeling applications pre-
sented in this course will make their usefulness clear
Example: x t = 10 cos > 2S 440 t – 0.4S @
– The function plots are identical in shape, with the sine plot
shifted to the right relative to the cosine plot by S e 2
– This is expected since a well known trig identity states that
sin T = cos T – S e 2 (2.3)
– We also observe that both waveforms repeat every 2S radi-
ans; read period = 2S
– Additionally the amplitude of each ranges from -1 and 1
• A few key function properties and trigonometric identities
Property Equation
Equivalence sin T = cos T – S e 2 or
cos T = sin T + S e 2
Periodicity cos T – 2Sk = cos T , when k is an
integer; holds for sine also
Evenness of cosine cos – T = cos T
Oddness of sine sin – T = – sin T
Table 2.2: Some trigonometric identities
Number Equation
1 2 2
sin T + cos T = 1
2 2 2
cos 2T = cos T – sin T
3 sin 2T = 2 sin T cos T
4 sin D r E = sin D cos E r cos D sin E
5 cos D r E = cos D cos E
sin D sin E
6 2 1
cos T = --- 1 + cos 2T
2
7 2 1
sin T = --- 1 – cos 2T
2
Example:: z = 2 + j5 , z = 4 – j3 , z = – 5 + j0 , z = – 3 – j3
2 2
z1 = x 1 + y 1 (magnitude)
–1
z 1 = tan y 1 e x 1 (angle)
z *1 = x 1 – jy 1 (complex conjugate)
– MATLAB is also consistent with all of the above, starting
with the fact that i and j are predefined to be – 1
rectangular
polar
z1 = 2.0000e+00 + 5.0000e+00i
• Consider z 2 = 2 45q
– In MATLAB we simply enter the numbers directly as a
complex exponential
>> z2 = 2*exp(j*45*pi/180)
z2 = 1.4142e+00 + 1.4142e+00i
– Using the TI-89 we can directly enter the polar form using
the angle notation or using a complex exponential
• Find z 1 z 2
>> z1*z2
• Find z 1 e z 2
>> z1/z2
TI-89
Results
Sinusoidal Signals
• A general sinusoidal function of time is written as
x t = A cos Z 0 t + I = A cos 2Sf 0 t + I (2.29)
where in the second form Z 0 = 2Sf 0
• Since cos T d 1 it follows that x t swings between r A , so
the amplitude of x t is A
• The phase shift in radians is I , so if we are given a sine sig-
nal (instead of the cosine version), we see via the equivalence
property that
x t = A sin Z 0 t + Ic = A cos Z 0 t + Ic – S e 2 (2.30)
which implies that I = Ic – S e 2
• Engineers often prefer the second form of (2.8) where f 0 is
the oscillation frequency in cycles/s; why?
Z 0 § rad/s· –1
------ ----------- = f 0 sec
2S © rad ¹
2S
Z 0 T 0 = 2S T 0 = ------
Z0
(2.33)
1-
or 2Sf 0 T 0 T 0 = ---
f0
• So we see that T 0 and f 0 are reciprocals, with the units of T 0
being time and the units of f 0 inverse time or cycles per sec-
ond, as stated earlier
– In honor of Heinrich Hertz, who first demonstrated the
existence of radio waves, cycles per second is replaced
with Hertz (Hz)
Period doubles as
frequency halves
A constant signal
as the oscillation
frequency is zero
° 2t, 0dtd1e2
° 1---
st = ® 4 – 2t , 1 e 2 d t d 2 (2.34)
° 3
° 0, otherwise
¯
st
1
1
2t --- 4 – 2t
3
1--- t
-1 0 2 1 2 3
° 2 t – 2 , 0 d t – 2 d 1 e 2
° 1---
x1 t = ® 4 – 2 t – 2 , 1 e 2 d t – 2 d 2
° 3
° 0, otherwise
¯
(2.36)
° 2t – 4, 2dtd5e2
° 1---
= ® 8 – 2t , 5 e 2 d t d 4
° 3
° 0, otherwise
¯
x1 t = s t – 2
1
1
2t – 2 --- 8 – 2t
3
t
0 1 2 5--- 3 4
2
1 t
-1 – ---
2 0 1 2 3
° 2 t + 1 , 0 d t + 1 d 1 e 2
° 1---
st + 1 = ® 4 – 2 t + 1 , 1 e 2 d t + 1 d 2
° 3
° 0, otherwise
¯
(2.38)
° 2t + 2, –1 d t d –1 e 2
° 1---
= ® 2 – 2t , – 1 e 2 d t d 1
° 3
° 0, otherwise
¯
x 0 t – t 1 = A cos > Z 0 t – t 1 @
(2.40)
= A cos > Z 0 t – Z 0 t 1 @
which implies that in terms of phase shift we have
I = –Z0 t1
• For a given phase shift we can turn the above analysis around
and solve for the time delay via
I I
t 1 = – ------ = – ----------- (2.41)
Z0 2Sf 0
• Since T 0 = 1 e f 0 , we can also write the phase shift in terms
of the period
§ t1 ·
I = – 2Sf 0 t 1 = – 2S ----- (2.42)
© T 0¹
20 20 + 18 2
I = – ------ S + 6S = – ------------------ S = – --- S = – 0.6667S (2.44)
3 3 3
• Does this result make sense?
• A time delay of 10 ms with a period of 3 ms means that we
have delayed the sinusoid three full periods plus 1 ms
• A 1 ms delay is 1/3 of a period, with half of a period corre-
sponding to S rad, so a delay of 1/3 period is a phase shift of
– 2 e 3 S = – 0.6667S ; agrees with the above analysis
Modulo the period Actual Delay of 10 ms
delay of 1 ms
t (ms)
Blue = no delay
Red = 10 ms Delay
of
x t = A cos 2Sf 0 t + I
may be generated and plotted
• This fact holds true whether we are using MATLAB, C, Math-
ematica, Excel, or any other computational tool
• When t o nT s we need to realize that sample spacing needs
to be small enough relative to the frequency f 0 such that
when plotted by connecting the dots (linear interpolation),
the waveform picture is not too distorted
– In Chapter 4 we will discuss sampling theory, which will
tell us the maximum sample spacing (minimum sampling
rate which is 1 e T s ), such that the sequence
x > n @ = x nT s can be used to perfectly reconstruct x t
from x > n @
• For now we are more concerned with having a good plot
appearance relative to the expected sinusoidal shape
• A reasonable plot can be created with about 10 samples per
period, that is with T s | 1 e 10f 0 = T 0 e 10
• We will now consider several MATLAB example plots
>> t = 0:1/(5*3):1; x = 15*cos(2*pi*3*t-.5*pi);
>> subplot(311)
>> plot(t,x,'.-'); grid
>> xlabel('Time in seconds')
>> ylabel('Amplitude')
>> t = 0:1/(10*3):1; x = 15*cos(2*pi*3*t-.5*pi);
>> subplot(312)
0
5 Samples
−10 per period
−20
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time in seconds
20
1T
10
T s = --------0-
10
Amplitude
0
10 Samples
−10
per period
−20
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time in seconds
20
T
T s = -----0-
10 50
Amplitude
−10 50 Samples
per period
−20
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Time in seconds
)!)(3456(7,8*-%.(-*/(79.+&#. 3:3;
!"#$%&'()'$"*&*+,-%.(-*/(01-."2.
!/ !0
)!)(3456(7,8*-%.(-*/(79.+&#. 3:3<
!"#$%&'()'$"*&*+,-%.(-*/(01-."2.
we can write
%I %Z ! " %Z ! "
! " = #$ $ = ($ (2.50)
%I
where ( = #$
• The complex amplitude ( is called the phasor, as it is the
gain and phase value applied to the time varying component
%Z "
$ ! to form ! "
– This is common terminology is electrical engineering cir-
cuit theory
%Z "
• The time varying term $ ! has unit magnitude and rotates
counter clockwise in the complex plane at a rate of Z ! rad/s
( ) ! rotations/s)
– The time duration for one rotation is the period * ! = / e ) !
%Z ! "
• The combination (product) of the fixed phasor ( and $
results in a rotating phasor
– For positive frequency Z ! the rotation is counter clock-
wise, and for negative frequency the rotation is clockwise
#$
%&'()(*" 2"34)(*"
+,"-."/01 +,"-."/01
T" T"
!" !"
T " = Z! " + I
!"#$#%&'()*$+",+
)!)(3456(7,8*-%.(-*/(79.+&#. 3:34
!"#$%&'()'$"*&*+,-%.(-*/(01-."2.
)!)(3456(7,8*-%.(-*/(79.+&#. 3:3=
!"#$%&'()'$"*&*+,-%.(-*/(01-."2.
0 –% S e 1 0 %!
$ $
−1 −1
−2 −1 0 1 2 −2 −1 0 1 2
−1 −1
−2 0 2 −2 0 2
0 0
−1 −1
−2 0 2 −2 0 2
0 0
−1 −1
−2 0 2 −2 0 2
)!)(3456(7,8*-%.(-*/(79.+&#. 3:3>
01-."2(?//,+,"*
Phasor Addition
We often have to deal with multiple sinusoids. When the sinu-
soids are at the same frequency, we can derive a formula of the
form
-
)!)(3456(7,8*-%.(-*/(79.+&#. 3:3@
01-."2(?//,+,"*
- -
I, %I
¦ #, $ = ¦ ( , { ( = #$ (2.53)
,=/ ,=/
• The above is valid since the real and imaginary parts add
independently, that is
- -
½
*+ ®
¯
¦ (, ¾ =
¿
¦ *+ ^ (, ` (2.54)
,=/ ,=/
Proof:
- - % Z! " + I,
¦ # , %&' Z ! " + I , = ¦ *+ ^ # , $ `
,=/ ,=/
§ - %I ,· %Z ! " ½
+&55&6'78,&$79:;<=> = *+ ® ¨
¯©, = /
¦
#, $ ¸ $ ¾
¹ ¿
%I %Z ! "
= *+ ^ #$ $ `
% Z! " + I
= *+ ^ #$ `
= # %&' Z ! " + I
)!)(3456(7,8*-%.(-*/(79.+&#. 3:A6
01-."2(?//,+,"*
(
I8()8#":(")'
so
( = ( / + ( 0 = 15;.<16 + %;5<9/9/
(2.59)
%<05;<!0S e /7!
= /!57679$
)!)(3456(7,8*-%.(-*/(79.+&#. 3:A5
01-."2(?//,+,"*
• Finally,
& " = /!57< %&' .!S" + <05;<!0S e /7! (2.60)
• We can check this by directly plotting the waveform in MAT-
LAB
XX#*#D#:K?"AY:N?YBK:@9C
XX#Q?#D#F@YN&.%AZ:N)(N*MZYN)("?H:BC
XX#Q9#D#[@9N&.%AZ:N)(N*MH:N)("?H:BC
XX#Q#D#Q?MQ9C#!),.*#3%(0/#4.,=#10=#,(0-#%*\,-%
?@;A:: x1(t)
10 x2(t)
&"
x(t)
&/ "
Amplitude
B??;CD7$'
−5
&0 "
−10
)!)(3456(7,8*-%.(-*/(79.+&#. 3:A3
01-."2(?//,+,"*
Example:
S S
% § 0S) ! " + ---· % § 0S) ! " – ---·
© 0¹ © 1¹ %0S) ! " ½
& " = *+ ® .$ + 6$ + . + %0 $ ¾
¯ ¿
• Find ( = ( / + ( 0 + ( .
• From the given & " we observe that
S S
% --- – % ---
0 1
( / = .$ ( 0 = 6$ ( . = . + %0
)!)(3456(7,8*-%.(-*/(79.+&#. 3:AA
019.,B.("C(+1&(DE*,*8(F"2G
)!)(3456(7,8*-%.(-*/(79.+&#. 3:A;
019.,B.("C(+1&(DE*,*8(F"2G
• When struck the vibration of the metal tine moves air mole-
cules to produce a sound wave
• Hooke’s law from physics (springs, etc.) says that the force to
restore the tine back to its original & = ! position is the same
as the original deformation (striking force), except for a sign
change,
. = – ,& (2.64)
where k is the material stiffness constant
• The acceleration produced by the restoring force (Newton’s
second law) is
)!)(3456(7,8*-%.(-*/(79.+&#. 3:A<
019.,B.("C(+1&(DE*,*8(F"2G
0
1 &
. = /0 = / -------0- (2.65)
1"
• To balance the two forces (sum is zero), we must have
0
1 &
/ -------0- = – ,& " (2.66)
1"
)!)(3456(7,8*-%.(-*/(79.+&#. 3:A4
019.,B.("C(+1&(DE*,*8(F"2G
0.5
Amplitude
−0.5
−1
0 1 2 3 4 5 6 7 8 9 10
Time in seconds
H&&$7IJKJ;@:L7'
1
0.5
Amplitude
−0.5
−1
4 4.002 4.004 4.006 4.008 4.01 4.012 4.014 4.016 4.018 4.02
Time in seconds
)!)(3456(7,8*-%.(-*/(79.+&#. 3:A=
019.,B.("C(+1&(DE*,*8(F"2G
JJ@7MN78./O4$"/)457)./(/378&,G7P()0F
20
AA@7MN7'"0&/O7F4,$&/(0
Power Spectrum Magnitude (dB)
Q)F",7F4,$&/(0'
−20
−40
−60
R."7)&7')4,)B.P7),4/'("/)
−80
0 500 1000 1500 2000 2500 3000 3500 4000
Frequency (Hz)
)!)(3456(7,8*-%.(-*/(79.+&#. 3:A>
019.,B.("C(+1&(DE*,*8(F"2G
EF"7F(3F",7F4,$&/(0'784O"7(/7)($"
Listening to Tones
• To play the tuning fork sound on the PC speakers using Mat-
lab we type
XX#%.30=AQ8H:::B
where the second argument sets the sampling frequency for
playback
)!)(3456(7,8*-%.(-*/(79.+&#. 3:A@
D,#&(7,8*-%.H(I"2&(D1-*(F"2#E%-.
)!)(3456(7,8*-%.(-*/(79.+&#. 3:;6