You are on page 1of 8

"""#

"#$%"


IV. Examine if the following signals are periodic and if so, determine their
respective periods.
(a). x(t)= sin 5t + 2sin 10t
(b). x(t)= 3sin (12t) + 2cos(21t)
(c). x(t)=cos 2t +2 sin(t+)













V. Use Matlab to plot above functions (a) and (c) and verify your answers to
question IV (plot functions in (a) and (b) for 0<t<10 with increment of 0.1, and
plot function in (c) for 0<t<30 with increment of 0.1).

&# t=0:0.1:10
x1= sin(5*t);
x2=2*sin(10*t);
subplot(3,1,1)
plot(t,x1);
xlabel('t-->')
ylabel('Amplitude--->')
title('input x1')
subplot(3,1,2)
plot(t,x2);
xlabel('t-->')
ylabel('Amplitude--->')
title('input x2')
y=x1+x2;
subplot(3,1,3)
plot(t,y)
xlabel('t-->')
ylabel('Amplitude--->')
title('output x(t)')


0 2 4 6 8 10
-1
0
1
t-->
A
m
p
l
i
t
u
d
e
-
-
-
>
input x1
0 2 4 6 8 10
-2
0
2
t-->
A
m
p
l
i
t
u
d
e
-
-
-
>
input x2
0 2 4 6 8 10
-5
0
5
t-->
A
m
p
l
i
t
u
d
e
-
-
-
>
output x(t)
b.%x( t ) =3si n( 12*pi *t ) +2 cos( 21*pi *t )
t =0: . 01: 5;
x1= 3*si n( 12*pi *t ) ;
x2=2*cos( 21*pi *t ) ;
f i gur e;
subpl ot ( 4, 1, 1)
pl ot ( t , x1) ;
xl abel ( ' t - - >' )
yl abel ( ' Ampl i t ude- - - >' )
t i t l e( ' i nput x1' )
subpl ot ( 4, 1, 2)
pl ot ( t , x2) ;
xl abel ( ' t - - >' )
yl abel ( ' Ampl i t ude- - - >' )
t i t l e( ' i nput x2' )
y=x1+x2;
subpl ot ( 4, 1, 3)
pl ot ( t , y)
xl abel ( ' t - - >' )
yl abel ( ' Ampl i t ude- - - >' )
t i t l e( ' out put y' )
y= y' *ones( 1, 5) ;
y=y( : ) ;
y=y' ;
subpl ot ( 4, 1, 4)
pl ot ( y)
xl abel ( ' t - - >' )
yl abel ( ' Ampl i t ude- - - >' )
t i t l e( ' out put y f or mor e cycl es' )

0 1 2 3 4 5
-5
0
5
t-->
A
m
p
l
i
t
u
d
e
-
-
-
>
input x1
0 1 2 3 4 5
-2
0
2
t-->
A
m
p
l
i
t
u
d
e
-
-
-
>
input x2
0 1 2 3 4 5
-5
0
5
t-->
A
m
p
l
i
t
u
d
e
-
-
-
>
output y
0 500 1000 1500 2000 2500 3000
-5
0
5
t-->
A
m
p
l
i
t
u
d
e
-
-
-
>
output y for more cycles
(# % x(t)=cos 2pit +2 sin(t+pi/3)
t=0:0.1:30;
x1= cos(2*pi*t);
x2=2*sin(t+pi/3);
figure;
subplot(4,1,1)
plot(t,x1);
xlabel('t-->')
ylabel('Amplitude--->')
title('input x1')
subplot(4,1,2)
plot(t,x2);
xlabel('t-->')
ylabel('Amplitude--->')
title('input x2')
y=x1+x2;
subplot(4,1,3)
plot(t,y)
xlabel('t-->')
ylabel('Amplitude--->')
title('output')
y= y'*ones(1,5);
y=y(:);
y=y';
subplot(4,1,4)
plot(y)
xlabel('t-->')
ylabel('Amplitude--->')
title('output for more cycles')

0 5 10 15 20 25 30
-1
0
1
t-->
A
m
p
l
i
t
u
d
e
-
-
-
>
input x1
0 5 10 15 20 25 30
-2
0
2
t-->
A
m
p
l
i
t
u
d
e
-
-
-
>
input x2
0 5 10 15 20 25 30
-5
0
5
t-->
A
m
p
l
i
t
u
d
e
-
-
-
>
output
0 200 400 600 800 1000 1200 1400 1600
-5
0
5
t-->
A
m
p
l
i
t
u
d
e
-
-
-
>
output for more cycles

You might also like