Laboratory Manual: Siddhartha
Laboratory Manual: Siddhartha
DEPARTMENT
OF
ELECTRICAL AND ELECTRONICS ENGINEERING
SIDDHARTHA
INSTITUTE OF ENGINEERING &TECHNOLOGY
IBRAHIMPATNAM - R.R. DIST. 501 506
***********
INDEX
CYCLE-I
3. CYCLE-II
AIM: -
To write a MATLAB program for some basic operations on matrices such as addition,
subtraction, multiplication.
SOFTWARE REQURIED:-
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program mentioned below
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc;
close all;
clear all;
a= [a1 a2 a3; a4 a5 a6; a7 a8 a9];
b= [b1 b2 b3; b4 b5 b6; b7 b8 b9];
disp('The matrix a= ');a
disp('The matrix b= ');b
% to find sum of a and b
c=a+b;
disp('The sum of a and b is ');c
% to find difference of a and b
d=a-b;
disp('The difference of a and b is ');d
%to find multiplication of a and b
e=a*b;
disp('The product of a and b is ');e
% to find element-by-element multiplication
Continued…………….1
The matrix a=
a1 a2 a3
a4 a5 a6
a7 a8 a9
The matrix b=
b1 b2 b3
b4 b5 b6
b7 b8 b9
c1 c2 c3
c4 c5 c6
c7 c8 c9
d1 d2 d3
d4 d5 d6
d7 d8 d9
e1 e2 e3
e4 e5 e6
e7 e8 e9
RESULT:-
Finding addition, subtraction, multiplication using MATLAB are successfully
completed
********************
SOFTWARE REQURIED :-
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program mentioned below
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc;
clear all;
close all;
n=-10:1:10;
L=length(n);
for i=1:L
if n(i)==0
x1(i)=1;
else
x1(i)=0;
end;
if n(i)>=0
x2(i)=1;
x3(i)=n(i);
else
x2(i)=0;
x3(i)=0;
end;
end;
Continued…………….1
subplot(3,2,2);
stem(n,x2);
xlabel('time n ---->');
ylabel('amplitude---->');
title('Unit impluse signal');
subplot(3,2,3);
stem(n,x3);
xlabel('time n ---->');
ylabel('amplitude---->');
title('Unit ramp signal');
subplot(3,2,4);
stem(n,x4);
xlabel('time n ---->');
ylabel('amplitude---->');
title('exponential signal');
subplot(3,2,[5,6]);
stem(n,x5);
xlabel('time n ---->');
ylabel('amplitude---->');
title('sinusoidal signal');
Continued…………….2
RESULT:-
Thus the Generation of discrete time signals likes unit impulse, unit step, Unit ramp,
exponential signal and sinusoidal signals are successfully completed.
********************
AIM: -
To write a “MATLAB” Program and generate continuous time signals like unit step,
sawtooth, triangular, Sinusoidal, ramp, and sinc function.
SOFTWARE REQURIED :-
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program as mentioned below
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc;
clear all;
close all;
t=-10:0.01:10;
L=length(t);
for i=1:L
%to generate unit Step and ramp function
if t(i)<0
x1(i)=0;
x2(i)=0;
else
x1(i)=1;
x2(i)=t(i);
end;
end;
Continued…………….1
subplot(2,3,2);
plot(t,x2);
xlabel('t--->');
ylabel('amp--->');
title('unit ramp');
subplot(2,3,3);
plot(t,x3);
xlabel('t--->');
ylabel('amp--->');
title('sinusoidal');
subplot(2,3,4);
plot(t,x4);
xlabel('t--->');
ylabel('amp--->');
title('triangular');
subplot(2,3,5);
plot(t,x5);
xlabel('t--->');
ylabel('amp--->');
title('sawtooth');
subplot(2,3,6);
plot(t,x6);
xlabel('t--->');
ylabel('amp--->');
title('sinc function');
Continued…………….2
RESULT:-
Thus the Generation of continuous time signals like unit step, sawtooth, triangular,
sinusoidal, ramp and sinc functions are successfully completed.
********************
SOFTWARE REQURIED:-
PROGRAM:-
clc,
close all;
clear all;
t=0:0.001:1;
L=length(t);
f1=1;
f2=3;
x1=sin(2*pi*f1*t);
x2=sin(2*pi*f2*t);
figure;
subplot(3,2,1);
plot(t,x1,'b',t,x2,'r');
title('the signals x1(t) and x2(t)');
x3=x1+x2;
subplot(3,2,2);
plot(t,x3);
title('the sum of x1(t) and x2(t)');
x4=x1.*x2;
subplot(3,2,3);
plot(t,x4);
title('the multiplication of x1(t) and x2(t)');
Continued……………1
x7=[zeros(1,200),x2(1:(L-200))];
subplot(3,2,5);
plot(t,x7);
title('the shifting of x1(t)and x2(t)');
x8=x22;
subplot(3,2,6);
plot(t,x8);
title('the squaring of x1(t)and x2(t)');
OUTPUT:-
RESULT:-
Thus the MATLAB Program for some operations on signals is completed successfully.
******************** 2
Apparatus required:-
Personal Computer with MATLAB R2006b (7.3 Version) software
PROCEDURE:-
1. Start the personal Computer and Open the Text Editor which is on the desktop.
2. for the above given circuit decide the node points for each component and also put a
dummy voltage source for the sake of measuring the current at nodes if necessary.
3. Write the program for the above ckt as given below
4. Save the file as .cir and close the file
5. Open the PSPICE AD, which is on the desk top and open the same file which is saved
by a name earlier in the Text editor.
6. You observe a dialog “Simulation completed successfully”
7. Open the file menu and Click the Examine output.
8. You observe the following output results whatever the requirements needed.
Continued……………1
OUTPUT:-
*RECIPROCITY THEOREM
VS 1 0 DC 10V
VX 1 2 DC 0V
R1 2 3 1.1K
R2 3 4 2.2K
R3 3 0 3.3K
VY 4 0 DC 0V
.OP
*RECIPROCITY THEOREM
**** SMALL SIGNAL BIAS SOLUTION TEMPERATURE = 27.000 DEG C
VS -4.132E-03
VX 4.132E-03
VY 2.479E-03………………………………………………..Verified
*RECIPROCITY THEOREM
JOB CONCLUDED
RESULT:-
********************
AIM:-
To verify the Superposition Theorem with DC Input and find the Current [IT]
Using P Spice software.
Apparatus required:-
PROCEDURE:-
1. Start the personal Computer and Open the Text Editor which is on the desktop.
2. For the above given circuit decide the node points for each component and also put a
dummy voltage source for the sake of measuring the current at nodes if necessary.
3. Write the program for the above ckt as given below
4. Save the file as .cir and close the file
5. Open the PSPICE AD, which is on the desk top and open the same file which is saved
by a name earlier in the Text editor.
6. You observe a dialog “Simulation completed successfully”
7. Open the file menu and Click the Examine output.
8. You observe the following output results whatever the requirements needed.
Continued……………1
OUT PUT:-
**** CIRCUIT DESCRIPTION
*SUPERPOSITION THEOREM
V1 1 0 DC 10V
VX 1 2 DC 0V
R1 2 3 1.1K
R2 3 5 2.2K
R3 3 4 3.3K
VY 4 0 DC 0V
VZ 5 6 DC 0V
V2 6 0 DC 15V
.OP
.END
**** SMALL SIGNAL BIAS SOLUTION TEMPERATURE = 27.000 DEG C
( 5) 15.0000 ( 6) 15.0000
JOB CONCLUDED
TOTAL JOB TIME 0.00
RESULT:-
********************
2
Apparatus required:-
Given Circuit:-
Procedure:-
1. Start the personal Computer and Open the Text Editor which is on the desktop.
2. For the above given circuit decide the node points for each component and also put a
dummy voltage source for the sake of measuring the current at nodes if necessary.
3. Write the program for the above ckt as given below
4. Save the file as .cir and close the file
5. Open the PSPICE AD, which is on the desk top and open the same file which is saved
by a name earlier in the Text editor.
6. You observe a dialog “Simulation completed successfully”
7. Open the file and Click the Examine out put.
8. You can observe the following output results as required.
Continued……………1
OUTPUT:-
CIRCUIT DESCRIPTION
( 5) -11.2500
VIN 5.000E-01
VX -1.125E+00
RESULT:-
Thevenin’s equivalent Voltage using P Spice software is determined.
********************
AIM: -.
To write a MATLAB program and to plot the waveform synthesis using Laplace
transforms. .
SOFTWARE REQURIED :-
PROCEDURE:-
Open MATLAB Software
Open new M-file
Type the program mentioned below
Save in current directory
Run the program
For the output see command window\ Figure window.
PROGRAM:-
clc;
close all;
syms s;
F =(1/(s2))*(1-exp(-s)-(1/2)*exp(-3*s)+(1/2)*exp(-5*s));
f=ilaplace(F);
pretty(simplify(f))
ezplot(f,[0,5]);
grid;
RESULT: -
Thus waveform is plotted by using waveform synthesis
SOFTWARE REQURIED :
Personal Computer with MATLAB R2006b (7.3 Version) software
.
PROCEDURE:-
Open MATLAB Software
Open new M-file
Type the program
Save in current directory
Run the program
For the output see command window\ Figure window.
RESULTS: - Thus the MATLAB program to draw pole-zero map in S-plane is successfully
completed.
OUTPUT:-
Transfer function:
s^2 - 2 s + 1
----------------------
s^3 + 6 s^2 + 11 s + 6
Zeros are at
1
1
Poles are at
-3.0000
-2.0000
-1.0000
SOFTWARE REQURIED :-
Personal Computer with MATLAB R2006b (7.3 Version) software
PROCEDURE:-
Open MATLAB Software
Open new M-file
Type the program
Save in current directory
PROGRAM:-
RESULTS: - Thus the MATLAB program to draw pole-zero map in S-plane is successfully
completed.
OUTPUT:-
Enter the numerator polynomial vector
[1 0 0]
Enter the denominator polynomial vector
[1 1 0.16]
Transfer function:
1
--------------------
1 + z^-1 + 0.16 z^-2
AIM:-
To determine the Transient Response of RLC Circuit with Sinusoidal Input and
find the Voltage & Current using P Spice software.
Apparatus required:-
Personal Computer with MATLAB R2006b (7.3 Version) software
Given Circuit
VIN 0.000E+00
TIME V(3)
(*)---------- -2.0000E+01 -1.0000E+01 0.0000E+00 1.0000E+01 2.0000E+01
(+)---------- -1.0000E+01 -5.0000E+00 0.0000E+00 5.0000E+00 1.0000E+01
___________________________
4.980E-04 1.020E+01 . . .+ * .
4.990E-04 9.976E+00 . . .+ * .
5.000E-04 9.747E+00 . . + * .
---------------------------
JOB CONCLUDED
Experiment No-9
SOFTWARE REQURIED :-
PROGRAM:-
clc;
clear all;
close all;
t=-5:0.001:5;
A=0.8;
x1=A.^(t);
x2=A.^(-t);
if(x2==x1)
disp('The given signal is even signal');
else
if(x2==(-x1))
disp('The given signal is odd signal');
else
disp('The given signal is neither even nor odd');
end
end
xe=(x1+x2)/2;
xo=(x1-x2)/2;
subplot(2,2,1);
plot(t,x1);
xlabel('t');ylabel('x(t)');title('signal x(t)');
subplot(2,2,2);
plot(t,x2);
xlabel('t');ylabel('x(t)');title('signal x(-t)');
subplot(2,2,3);
plot(t,xe);
xlabel('t');ylabel('x(t)');title('even part signal x(t)');
subplot(2,2,4);
plot(t,xo);
xlabel('t');ylabel('x(t)');title('odd part signal x(t)');
RESULT:-
Thus the MATLAB Program to find even and odd parts of signals
completed successfully.
OUTPUT:-
AIM: - To find Fourier transform and inverse Fourier transforms of given functions.
SOFTWARE REQURIED :-
PROGRAM:-
To find Fourier transform
F1=A*pi*(dirac(w-o)+dirac(w+o));
f1=ifourier(F1,t);
disp('the inverse fourier transform of A*pi*(dirac(w-o)+dirac(w+o)=');
disp(f1);
F2=A*pi*(dirac(w-o)-dirac(w+o))/i;
f2=ifourier(F2,t);
disp('the inverse fourier transform of A*pi*(dirac(w-o)+dirac(w+o)/i=');
RESULT: - Thus the MATLAB program to find fourier transform and inverse fourier
transform of given functions successfully completed.
OUTPUT:-
the fourier transform of dirac(t) =1
Experiment no-10(b)
AIM: -. To find Fourier transform of the given signal and to plot its magnitude and phase
spectrum.
SOFTWARE REQURIED :-
PROGRAM:-
RESULT: - Thus the MATLAB program to find fourier transform and ploting magnitude and
Phase spectrums successfully completed.
OUTPUT:-