You are on page 1of 10

Experiment no: 1

Aim:- To generate step response ,unit impulse, ramp sequence,


exponential sequence.

Software require: MATLAB 2010a


Step response
n=21;
>> t=0:1:n-1;
y=ones(1,n);
subplot(3,2,5);
stem(t,y);
xlabel('x');
ylabel('y');
title('step response');

Unit impulse
t=-5:5;
y=[zeros(1,5),ones(1,1),zeros(1,5)];
subplot(3,2,6);
stem(t,y);
xlabel('x');
ylabel('y');
>> title('UNIT IMPLUSE') ;

Ramp function
n=10;
t=0:n;
subplot(3,2,3);
stem(t,t);
xlabel('x');
ylabel('y');
title('RAMP SEQUENCE');

Exponential sequence
n=10;
t=0:n;
a=.6;
y=exp(a*t);
subplot(3,2,4);
stem(t,y);
xlabel('x');
ylabel('y');
title('EXPONENTIAL SEQUENCE');

Experiment no: 2
Aim: To find the transfer function.

Software require: MATLAB 2010a


clc;
clear all;
n=[0 1 4];
d=[2 0 5];
sys=tf(n,d)
Transfer function:
s+4
--------2 s^2 + 5

Experiment no: 3
Aim: To find the transfer function of close loop by using MATLAB

Software require: MATLAB 2010a


numg=[1];
deng=[500 0 0]
sys1=tf(numg,deng);
numh=[1 1];
denh=[1 2];
sys2=tf(numh,denh);
sys=feedback(sys1,sys2);
sys

Transfer function:
s+2
-------------------------500 s^3 + 1000 s^2 + s + 1

Experiment no: 4
Aim: To generate the sinusoidal, triangular, square wave by using
MATLAB

Software require: MATLAB 2010a

1)
clc;
clear all;
close all;
T=2;
t=2:.01:10;
x1=sin(2*pi*t/T);
subplot(2,2,1),plot(t,x1);
xlabel('t'),ylabel('x1')

2)
clc;
clear all;
close all;
t1=-20:.01:20;
x2=square(t1);
subplot(2,2,2),plot(t1,x2);
xlabel('t1'),ylabel('x2');

3)
clc;
clear all;
close all;
t1=-20:.01:20;
x3=sawtooth(t1);
subplot(2,2,2),plot(t1,x3);
xlabel('t1'),ylabel('x3');

Experiment no: 5
Aim: To generate the Amplitude modulated wave.
Software require: MATLAB 2010a
clc;
clear all;
close all;
fc=input('Enter the carrier signal freq in hz,fc=');
fm=input('Enter the modulating signal freq in hz,fm=');
m=input('Modulation index,m=');
t=0:0.001:1;
c=sin(2*pi*fc*t);
M=sin(2*pi*fm*t);
subplot(3,1,2);plot(t,c);
ylabel('amplitude');xlabel('time index');title('carrier signal');
subplot(3,1,3);plot(t,M);
ylabel('amplitude');xlabel('time index');title('Modulating signal');
y=(1+m+M).*c;
subplot(3,1,1);plot(t,y);
ylabel('amplitude');xlabel('time index');title('modulated signal');
t=0:0.001:1;
c=sin(2*pi*fc*t);
M=sin(2*pi*fm*t);
y=M.*c; Enter the carrier signal freq in hz,fc=100
Enter the modulating signal freq in hz,fm=50
Modulation index,m=.6

OUTPUT

Experiment no: 6
Aim: To generate the Frequency modulated wave.

Software require: MATLAB 2010a


clc;
clear all;
close all;
fc=input('Enter the carrier signal freq in hz,fc=');
fm=input('Enter the modulating signal freq in hz,fm=');
m=input('Modulation index,m=');
t=0:0.0001:0.1;
c=sin(2*pi*fc*t);
M=sin(2*pi*fm*t);
subplot(3,1,1);
plot(t,c);
ylabel('amplitude');
xlabel('time index');
title('carrier signal');
subplot(3,1,2);
plot(t,M);
ylabel('amplitude');
xlabel('time index');
title('Modulating signal');
y=cos(2*pi*fc*t+(m.*sin(2*pi*fm*t)));
subplot(3,1,3);
plot(t,y);
ylabel('amplitude');
xlabel('time index');
title('Frequency Modulated signal');

Enter the carrier signal freq in hz,fc=100


Enter the modulating signal freq in hz,fm=50
Modulation index,m=.6

Experiment no: 7
AIM : To find the root locus of given transfer function

Software require: MATLAB 2010a


num=[1 1]
den=conv([1 0 0],[1 3.6])
g=tf(num,den)
rlocus(g)
grid on
num =
1

den =
1.0000 3.6000

Transfer function:
s+1
------------s^3 + 3.6 s^2

Experiment no: 8
Aim: To find out the response of given feedback function
Software require: MATLAB 2010a
>> close all;
clear all;
Ka=1
Gnum=0.9;
Gden=[0.1 1 0];
'G(s)'
Gs=tf(Gnum,Gden)
G1=Gs*Ka
Ts=feedback(G1,1)
P=pole(Ts)
step(Ts)
Ka = 1
ans =
G(s)
Transfer function:
0.9
----------0.1 s^2 + s
Transfer function:
0.9
----------0.1 s^2 + s
Transfer function:
0.9
----------------0.1 s^2 + s + 0.9

P=
-9
-1

You might also like