esl lab manual1[1]
TRANSCRIPT
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 1/69
Lab Manual For ELECTRONICS SOFTWARE LAB
EXPERIMENT NO. 01
INTRODUCTION OF MATLAB
Theory:-
MATLAB is a high-performance language for technical computing. It integrates
computation, visualization, and programming in an easy-to-use environment where
problems and solutions are expressed in familiar mathematical notation.
Typical uses include Math and computation Algorithm development, Data acquisition
Modeling, simulation, and prototyping Data analysis, exploration, and visualization
Scientific and engineering graphics Application development, including graphical user
interface building MATLAB is an interactive system whose basic data element is an
array that does not require dimensioning. This allows you to solve many technical
computing problems, especially those with matrix and vector formulations, in a fraction
of the time it would take to write a program in a scalar non-interactive language such as
C or Fortran.
The name MATLAB stands for matrix laboratory. MATLAB was originally written to
provide easy access to matrix software developed by the LINPACK and EISPACK
projects. Today, MATLAB engines incorporate the LAPACK and BLAS libraries,
embedding the state of the art in software for matrix computation.
In university environments, it is the standard instructional tool for introductory and
advanced courses in mathematics, engineering, and science. In industry, MATLAB is the
tool of choice for high-productivity research, development, and analysis. MATLAB
features a family of add-on application-specific solutions called toolboxes.Very important
to most users of MATLAB, toolboxes allow you to learn and apply specialized
technology. Toolboxes are comprehensive collections of MATLAB functions (M-files)
that extend the MATLAB environment to solve particular classes of problems.
Areas in which toolboxes are available include signal processing, control systems, neural
networks, fuzzy logic, wavelets, simulation, and many others. The MATLAB system
SVERI’S College Of Engineering, Pandharpur. 1
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 2/69
Lab Manual For ELECTRONICS SOFTWARE LAB
consists of five main parts : Desktop Tools and Development Environment. This is the set
of tools and facilities that help you use MATLAB functions and files. Many of these tools
are graphical user interfaces. It includes the MATLAB desktop and Command Window, a
command history, an editor and debugger, a code analyzer and other reports, and
browsers for viewing help, the workspace, files, and the search path. The Command
Window is one of the main tools you use to enter data, run MATLAB functions and other
M-files, and display results. The MATLAB Mathematical Function Library, This is a vast
collection of computational algorithms ranging from elementary functions, like sum, sine,
cosine, and complex arithmetic, to more sophisticated functions like matrix inverse,
matrix eigen values, Bessel functions, and fast Fourier transforms. The MATLAB
Language, This is a high-level matrix/array language with control flow statements,
functions, data structures, input/output, and object-oriented programming features.
Graphics MATLAB has extensive facilities for displaying vectors and matrices as graphs,
as well as annotating and printing these graphs. It includes high-level functions for two-
dimensional and three-dimensional data visualization, image processing, animation, and
presentation graphics. It also includes low-level functions that allow you to fully
customize the appearance of graphics as well as to build complete graphical user
interfaces on your MATLAB applications. The MATLAB External Interfaces/API, This
is a library that allows you to write C and Fortran programs that interact with MATLAB.
It includes facilities for calling routines from MATLAB (dynamic linking), calling
MATLAB as a computational engine, and for reading and writing MAT-files.
In MATLAB, a matrix is a rectangular array of numbers. Like most other programming
languages, MATLAB provides mathematical expressions, but unlike most programming
languages, these expressions involve entire matrices .The building blocks of expressions
are Variables Numbers Operators Functions.
Expressions use familiar arithmetic operators and precedence rules.
+ Addition
- Subtraction
SVERI’S College Of Engineering, Pandharpur. 2
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 3/69
Lab Manual For ELECTRONICS SOFTWARE LAB
* Multiplication
/ Division
\ Left division
^ Power
' Complex conjugate transpose
( ) Specify evaluation order
The MATLAB commands you will encounter in this exercise are as follows:
Operators and Special Characters
: .
+ -
* /
; %
Elementary Matrices and Matrix Manipulation
Ones pi
rand randn
zeros
Elementary Functions
cos exp
imag real
Data Analysis
Sum
Two-Dimensional Graphics
axis grid
legend plot
SVERI’S College Of Engineering, Pandharpur. 3
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 4/69
Lab Manual For ELECTRONICS SOFTWARE LAB
stairs stem
title xlabel ylabel
General Purpose Graphics Functions
clf subplot
Signal Processing Toolbox
sawtooth square
CONCLUSION:------------------------------------
SVERI’S College Of Engineering, Pandharpur. 4
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 5/69
Lab Manual For ELECTRONICS SOFTWARE LAB
EXPERIMENT NO. 02
GENERATION OF VARIOUS SIGNALS
Aim: Program to generate various Continuous time and Discrete Time signals
Software Tool: MATLAB 7
Theory:
Generation of Sequences:-
The purpose of this section is to familiarize you with the basic commands in MATLAB
for signal generation and for plotting the generated signal. MATLAB has been designed
to operate on data stored as vectors or matrices. For our purposes, sequences will be
stored as vectors. Therefore, all signals are limited to being causal and of finite length.
The steps to follow to execute the programs listed in this book depend on the platform
being used to run the MATLAB.
1) Sinusoidal & Cosine Sequences
Another very useful class of discrete-time signals is the real sinusoidal sequence of theform of
Such sinusoidal sequences can be generated in MATLAB using the trigonometric
operators cos and sin.
2) Exponential Signals
Another basic discrete-time sequence is the exponential sequence. Such a sequence can
be generated using the MATLAB operators. ^ and exp.
SVERI’S College Of Engineering, Pandharpur. 5
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 6/69
Lab Manual For ELECTRONICS SOFTWARE LAB
where A and α are real or complex numbers. By expressing
3) Unit Sample
This signal is represented as δ(n).
This signal is also called as Delta signal or Unit Impulse signal.
The Functional Representation of unit sample signal is as given below
Unit sample signal is having Amplitude equal to 1 at n=0 only & it is zero elsewhere.
A unit sample sequence u[n] of length N can be generated using the MATLAB command
u = [1 zeros (1, N -1)];
4) Unit Step Sequences
This signal is represented as u(n).
The Functional representation of unit step signal is as given below
This signal is having amplitude equal to 1 at n≥ 0 & it is zero for negative values of n.
A unit sample sequence ud[n] of length N and delayed by M samples, where M < N, can
be generated using the MATLAB command
ud = [zeros(1,M) 1 zeros(1,N - M - 1)];
Likewise, a unit step sequence s[n] of length N can be generated using the MATLAB
command
s = [ones (1, N)];
SVERI’S College Of Engineering, Pandharpur. 6
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 7/69
Lab Manual For ELECTRONICS SOFTWARE LAB
5) Ramp Signal
This signal is represented as r (n).
The Functional representation of ramp signal is as given below.
If w tends to zero the ramp becomes a step signal. This relationship is important because
we cannot differentiate a step signal because it is discontinuous. However, the ramp
signal is continuous and therefore differentiable.
Conclusion:---------------------------------
SVERI’S College Of Engineering, Pandharpur. 7
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 8/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Program:
1)%$$$$$$$$ Generation of a sine sequence $$$$$$$$$$
n = 0:40;f = 0.1;
phase = 0;A = 1.5;
%----------- Generate Cosine sequence ---------- arg = 2*pi*f*n- phase;x = A*sin(arg);
%----------- Plot CT Sinusoidal sequence-------- subplot(2,1,1);plot(n,x);title('CT sine Sequence');
xlabel('Time index n');ylabel('Amplitude');
%------------ Plot DT Sinusoidal sequence -------
subplot(2,1,2);stem(n,x);axis([0 40 -2 2]);grid;title('DT sine Sequence');xlabel('Time index n');
ylabel('Amplitude');Output: 1)
0 5 10 15 20 25 30 35 40-2
-1
0
1
2CTSinusoidal Sequence
Timeindex n
A m p l i t u d e
0 5 10 15 20 25 30 35 40-2
-1
0
1
2DTSinusoidal Sequence
Timeindex n
A m p l i t u d e
SVERI’S College Of Engineering, Pandharpur. 8
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 9/69
Lab Manual For ELECTRONICS SOFTWARE LAB
2)%$$$$$$$$$$ Generation of a Cosine sequence $$$$$$$$$
n = 0:40;f = 0.1;phase = 0;
A = 1.5;
%----------- Generate Cosine sequence ---------- arg = 2*pi*f*n- phase;x = A*cos(arg);
%---------- Plot CT Cosine sequence -------------
subplot(2,1,1);plot(n,x);title('CT Cosine Sequence');xlabel('Time index n');
ylabel('Amplitude'); %----------- Plot DT Cosine sequence ----------
subplot(2,1,2);stem(n,x);axis([0 40 -2 2]);grid;title('DT Cosine Sequence');xlabel('Time index n');ylabel('Amplitude');
Output: 2)
0 5 10 15 20 25 30 35 40-2
-1
0
1
2CTCosineSequence
Timeindexn
A m p l i t u d e
0 5 10 15 20 25 30 35 40-2
-1
0
1
2
DTCosineSequence
Timeindexn
A m p l i t u d e
SVERI’S College Of Engineering, Pandharpur. 9
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 10/69
Lab Manual For ELECTRONICS SOFTWARE LAB
3)%%%%%%%%%%% Generation of Ramp signal %%%%%%%%%%%%%
% ---------Input the Variables ----------------- a=input('Enter any number=');N= input('Type in length of sequence=');
n= 0:N;
%---------- Generate Ramp sequence ---------- x= a*n;
%--------- Plot CT Ramp sequence -----------
subplot(2,1,1);plot(n,x);title('CT Ramp Sequence');xlabel('Time index n');
ylabel('Amplitude'); %--------- Plot DT Ramp sequence ---------
subplot(2,1,2);stem(n,x);title('DT Ramp Sequence');xlabel('Time index n');ylabel('Amplitude');
Enter any number=4Type in length of sequence=10
Output: 3)
0 1 2 3 4 5 6 7 8 9 100
10
20
30
40CTRampSequence
Timeindexn
A m p l i t u d e
0 1 2 3 4 5 6 7 8 9 100
10
20
30
40DTRampSequence
Timeindexn
A m p l i t u d e
SVERI’S College Of Engineering, Pandharpur. 10
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 11/69
Lab Manual For ELECTRONICS SOFTWARE LAB
4)
% ****** Generation of a Unit Impulse Sequence *******clf;
% !!!!!!!!!! Generate a vector from -10 to 20 !!!!!!!!!!! n = -10:20;
% !!!!!!!!!!! Generate the unit Impulse sequence !!!!!!!!!! u = [zeros (1, 10) 1 zeros (1, 20)];
% !!!!!!! Plot the DT unit Impulse sequence !!!!!!!
subplot(2,1,1);stem(n,u);xlabel('Time index n');ylabel('Amplitude');title('DT Unit Impulse Sequence');axis([-10 20 0 1.2]);
% !!!!!! Plot the CT unit Impulse sequence !!!!!!!!
subplot(2,1,2);plot(n,u);xlabel('Time index n');ylabel('Amplitude');title('CT Unit Impulse Sequence');axis([-10 20 0 1.2]);
Output: 4)
-10 -5 0 5 10 15 200
0.5
1
Timeindexn
A m p l i t u d e
DTUnit sampleSequence
-10 -5 0 5 10 15 200
0.5
1
Timeindexn
A m p l i t u d e
CTUnit SampleSequence
SVERI’S College Of Engineering, Pandharpur. 11
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 12/69
Lab Manual For ELECTRONICS SOFTWARE LAB
5)
% ****** Generation of a Unit Step Sequence *******clf;
% !!!!!!!! Generate a vector from -10 to 20 !!!!!!!!!!
n = -10:20; % !!!!!!!!! Generate the unit step sequence !!!!!!!!!!!!!
u = [ones (1, 10) 1 ones (1, 20)];
% !!!!!!!!!!!! Plot the DT unit step sequence !!!!!!!!!!!
subplot(2,1,1);stem(n,u);xlabel('Time index n');ylabel('Amplitude');title('DT Unit step Sequence');axis([-10 20 0 1.2]);
% !!!!!!!!!!! Plot the CT unit step sequence !!!!!!!!!
subplot(2,1,2);plot(n,u);xlabel('Time index n');ylabel('Amplitude');title('CT Unit step Sequence');axis([-10 20 0 1.2]);
Output: 4)
-10 -5 0 5 10 15 200
0.5
1
Timeindexn
A m p l i t u d e
DTUnit stepSequence
-10 -5 0 5 10 15 200
0.5
1
Timeindexn
A m p l i t u d e
CTUnit stepSequence
SVERI’S College Of Engineering, Pandharpur. 12
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 13/69
Lab Manual For ELECTRONICS SOFTWARE LAB
EXPERIMENT NO. 03
OPERATIONS ON SIGNALS
Aim: Program to perform various operations on Signals
Software Tool: MATLAB 7
Theory:Following Operations we can perform on the signal.
1) Amplitude Scaling
2) Time Scaling
3) Folding/Reflection
4) Shifting
1) Amplitude Scaling:-
Consider x (t) as an original signal and y (t) as the amplitude scaling signal with;
y(t) = B x (t); B is a constant
2) Time Scaling:
Time scaling compresses and expands a signal by multiplying the time variable by some
amount. If that amount is greater than one, the signal becomes narrower and the operation
is called compression, while if the amount is less than one, the signal becomes wider and
is called dilation. It often takes people quite a while to get comfortable with these
SVERI’S College Of Engineering, Pandharpur. 13
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 14/69
Lab Manual For ELECTRONICS SOFTWARE LAB
operations, as people's intuition is often for the multiplication by an amount greater than
one to dilate and less than one to compress.
Consider f (t) as an original signal and y (t) as the time scaling signal with;
y (t) = f (at); a is a real constant
3) Time Reversal:
A natural question to consider when learning about time scaling is: What happens when
the time variable is multiplied by a negative number? The answer to this is time reversal.
This operation is the reversal of the time axis, or flipping the signal over the y-axis.
Consider x (t) as an original signal and y (t) as the time reversal signal.Hence;
y (t) = x (-t)
4) Time Shifting:
Time shifting is, as the name suggests, the shifting of a signal in time. This is done by
adding or subtracting the amount of the shift to the time variable in the function.
Subtracting a fixed amount from the time variable will shift the signal to the right (delay)
that amount, while adding to the time variable will shift the signal to the left (advance).
SVERI’S College Of Engineering, Pandharpur. 14
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 15/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Figure 1: f (t −T ) moves (delays) f to the right by T .
Consider x (t) as an original signal and y (t) as the time shifting signal. It can then be
written as:
y (t) = x (t-to)
where to is a constant.
Let y(t) = x(t-to)
“
SVERI’S College Of Engineering, Pandharpur. 15
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 16/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Program: 1)
%@@@@@@ SCALING - AMPLITUDE SCALING @@@@@@@@ %@@@@@@ y(n) = A*x(n) @@@@@@@@
n = -5:5;
% ***** Generate the unit sample sequence ********
x = [zeros (1, 5) 1 ones (1, 5)];axis ([-5 5 0 1.2]);
% ******** Plot the unit sample sequence ********
subplot (2,1,1);stem (n,x);xlabel('Time index n');ylabel('Amplitude');title('Unit Sample Sequence');
% ***** Generate the Amplitude Scaled signal ******
d=input ('Enter the Amplitude scaling factor');y= d*x;subplot (2,1,2);stem (n,y);xlabel('Time index n');ylabel('Amplitude');title ('Amplitude scaled signal');
Output: 2)
Enter the Amplitude scaling factor 4
-5 -4 -3 -2 -1 0 1 2 3 4 50
0.2
0.4
0.6
0.8
1
Timeindexn
A m p l i t u d e
Unit SampleSequence
-5 -4 -3 -2 -1 0 1 2 3 4 50
1
2
3
4
Timeindexn
A m p l i t u d e
Amplitudescaledsignal
SVERI’S College Of Engineering, Pandharpur. 16
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 17/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Program: 2)
%&&&&&&&&&&& TIME SCALING &&&&&&&&&&&&&&
clf;
clc;n= 0:20;n1=0:40;t=0.1*pi*n;t1=0.1*pi*n1;
%^^^^^^^^^^^ Sinusiodal Signal ^^^^^^^^^^^^^^
x=2*sin(t);subplot(3,1,1);plot(n,x);
axis([0 20 -1 1]);xlabel('Time');ylabel('Amplitude');Title('Original Signal');grid;
%^^^^^^^^^^^^^ Compressed Signal ^^^^^^^^^^^^^
a=input('Enter scaling factor a>1');x1=2*sin(a*t);subplot(3,1,2);plot(n,x1);xlabel('Time');ylabel('Amplitude');Title('Compressed Signal');axis([0 20 -1 1]);grid;
%^^^^^^^^^^^^ Expanded Signal ^^^^^^^^^^^^^^^^
a1=input('Enter scaling factor a<1');x2=2*sin(a1*t1);subplot(3,1,3);plot(n1,x2);xlabel('Time');ylabel('Amplitude');Title('Expanded Signal');axis([0 40 -1 1]);grid;
SVERI’S College Of Engineering, Pandharpur. 17
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 18/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Output: 2)
Enter scaling factor a>1 2
Enter scaling factor a<1 0.5
0 2 4 6 8 10 1 2 1 4 1 6 18 20-1
0
1
T ime
A m p l i t u d e
Or ig ina l S igna l
0 2 4 6 8 10 1 2 1 4 1 6 18 20-1
0
1
T ime
A m p l i t u d e
Co m p re s s e d S ign a l
0 5 1 0 15 20 25 30 35 40-1
0
1
T ime
A
m p l i t u d e
E x p a n d ed S ig na l
SVERI’S College Of Engineering, Pandharpur. 18
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 19/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Program: 3)
%_******* GENERATION OF A FOLDING SEQUENCE ********
%********** Generate a vector from -5 to 5********
n = -5:5; %***** Generate the unit sample sequence ***********
u = [zeros (1, 5) 1 ones (1, 5)];axis ([-5 5 0 1.2]);
%******* Plot the unit sample sequence *************
subplot(2,1,1);stem(n,u);
xlabel('Time index n');ylabel('Amplitude');title('Unit Sample Sequence');
%******* Generate the unit sample sequence ******
subplot(2,1,2);x=fliplr(u);stem(n,x);xlabel('Time index n');ylabel('Amplitude');title('Folded signal');
Output: 3)
-5 -4 -3 -2 -1 0 1 2 3 4 50
0.2
0.4
0.6
0.8
1
Timeindexn
A m p l i t u d e
Unit SampleSequence
-5 -4 -3 -2 -1 0 1 2 3 4 50
0.5
1
Timeindexn
A m p l i t u d e
Foldedsignal
SVERI’S College Of Engineering, Pandharpur. 19
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 20/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Program:4)
%@@@@@@@@ SHIFTING OPERATION ON SIGNAL @@@@@@@@@
%^^^^^^^^^^^^ Plot Original Signal ^^^^^^^^^^^^^^^^^^^
n = [-2:5];x = [4 3 1 0 1 2 3 2]; %input sequencesubplot(3,1,1);stem(n,x);xlabel('Time');ylabel('Amplitude');Title('Original Signal');
%^^^^^^^^^^^^ Delayed Signal ^^^^^^^^^^^^^^^^^^
n11=input ('enter the n0 > 0')
m=n11+n;y=x;subplot(3,1,2);stem(m,y);xlabel('Time');ylabel('Amplitude');Title('Delayed signal');
%^^^^^^^^^^^^^^^^ Advanced Signal ^^^^^^^^^^^^^^^^
n12=input('enter the n0 < 0');
m1=n12+n;y=x;subplot(3,1,3);stem(m1,y);xlabel('Time');ylabel('Amplitude');Title('Advanced signal');
SVERI’S College Of Engineering, Pandharpur. 20
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 21/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Output: 4)
enter the n0 > 0 3
enter the n0 < 0 -3
- 2 - 1 0 1 2 3 4 50
2
4
T i m e
A m
p l i t u d e
O r i g i n a l S i g n a l
1 2 3 4 5 6 7 80
2
4
T i m e
A m
p l i t u d e
D e l a y e d s i g n a l
- 5 - 4 - 3 - 2 - 1 0 1 20
2
4
T i m e
A m
p l i t u d e
A d v a n c e d s i g n a l
CONCLUSION:--------
This module will look at two signal operations, time shifting and time scaling. signaloperations are operations on the time variable of the signal. These operations are verycommon components to real-world systems and, as such, should be understoodthoroughly when learning about signals and systems.
SVERI’S College Of Engineering, Pandharpur. 21
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 22/69
Lab Manual For ELECTRONICS SOFTWARE LAB
EXPERIMENT NO. 04
LINEAR CONVOLUTION OF SIGNAL
Aim: Program to perform Linear Convolution of Signal.
Software Tool: MATLAB 7
Theory:
The response of a discrete-time system to a unit sample sequence {δ[n] } is called the unit
sample response or, simply, the impulse response , and denoted as {h[n] }.
Correspondingly, the response of a discrete-time system to a unit step sequence {μ[n] },
denoted as {s[n] }, is its unit step response or, simply the step response.
The response y[n] of a linear, time-invariant discrete-time system characterized by
an impulse response h[n] to an input signal x[n] is given by
……………………………(1)
which can be alternately written as
…………………………….(2) by a simple change of variables. The sum in Eqs. (1) and (2) is called the convolution
sum of the sequences x[n] and h[n], and is represented compactly as:
…………………………….(3)
where the notation denotes the convolution sum.
Convolution
The convolution operation of Eq. (3) is implemented in MATLAB by the command conv,
provided the two sequences to be convolved are of finite length. For example, the output
sequence of an FIR system can be computed by convolving its impulse response with a
given finite-length input sequence. The following MATLAB program illustrates this
approach.
SVERI’S College Of Engineering, Pandharpur. 22
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 23/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Program: %!!!!!!!!!!!!!!!!! Linear Convolution !!!!!!!!!!!!!!!!!!!!!!!!!!
clc;clear all;
close all;
% ******** Input & Impulse Sequences ********
x = input('Enter the first sequence');h = input('Enter the second sequence');
% ******** Convolution of two sequences *******
y = conv(x,h);
% ************* Input sequence **************
subplot(3,1,1);stem(x);ylabel('Amplitude ');xlabel('fig.(a) n----->');title('First sequence');
%************* Impulse sequence **************
subplot(3,1,2);
stem(h);ylabel('Amplitude ');xlabel('fig.(b) n----->');title('Second sequence');
%************* Output sequence **************
subplot(3,1,3);stem(y);ylabel('Amplitude ');xlabel('fig.(c) n----->');
title('Convolution of two sequences');disp('The resultant signal is');disp(y);
SVERI’S College Of Engineering, Pandharpur. 23
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 24/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Enter the first sequence [3 2 1 2]
Enter the second sequence [2 1 2 1]
Output:
The resultant signal is
6 7 10 12 6 5 2
1 1 .5 2 2 .5 3 3 .5 4
0
2
4
A m p l i t u d e
f ig.(a) n----->
F i r s t s e q u e n c e
1 1 .5 2 2 .5 3 3 .5 40
1
2
A m p l i t u d e
f ig.(b) n----->
S e c o n d s e q u e n c e
1 2 3 4 5 6 70
1 0
2 0
A m p l i t u d e
f ig.(c) n----->
Convo lu t i on o f two sequences
Conclusion:----------------------------
SVERI’S College Of Engineering, Pandharpur. 24
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 25/69
Lab Manual For ELECTRONICS SOFTWARE LAB
EXPERIMENT NO. 05
SAMPLING THEOREM
Aim: Program to Implement Sampling Theorem.
Software Tool: MATLAB 7
Theory:
Sampling Theorem – Let ga(t ) be a bandlimited signal with Ga( jΩ) = 0 for |Ω| >Ωm.
Then ga(t ) is uniquely determined by its samples ga(nT ) , n = 0 , 1 , 2 , 3 , . . . , i
Where
Given {g [n] } = {ga(nT ) }, we can recover ga(t ) exactly by generating an impulse train
gp(t ) of the form
and then passing gp(t ) through an ideal lowpass filter Hr ( jΩ) with a gain T and a cutoff
frequency Ωc greater than Ωm and less than ΩT − Ωm, that is,
The highest frequency Ωm contained in ga(t ) is usually called the Nyquist frequency as it
determines the minimum sampling frequency ΩT > 2Ωm that must be used to fully
recover ga(t ) from its sampled version. The frequency 2Ωm is called the Nyquist rate. If
the sampling rate is higher than the Nyquist rate, it is called oversampling . On the other
hand, if the sampling rate is lower than the Nyquist rate, it is called undersampling .
Finally, if the sampling rate is exactly equal to the Nyquist rate, it is called critical
sampling .
SVERI’S College Of Engineering, Pandharpur. 25
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 26/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Program:
% !!!!!!!! Sampling Process in the Time Domain !!!!!!! clf; % ^^^^^^^^^^ Continuous- Time Signal ^^^^^^^^^^^^
t = 0:0.0005:1;f = 13;xa = cos(2*pi*f*t);subplot(4,1,1)plot(t,xa);gridxlabel('Time, msec');ylabel('Amplitude');title('Continuous-time signal xa(t)');
% ^^^^ Continuous- Time Signal sampled at T=0.1 ^^^^^subplot(4,1,2);T=0.1;
n = 0:T:1;xs = cos(2*pi*f*n);k = 0:length(n)-1;stem(k,xs); gridxlabel('Time index n');ylabel('Amplitude');
title('Continuous-time signal xa(t)sampled at T=0.1');% ^^^^ Continuous- Time Signal sampled at T=0.1 ^^^^^
subplot(4,1,3);T1=0.01;n1 = 0:T1:1;
xs1 = cos(2*pi*f*n1);k1 = 0:length(n1)-1;stem(k1,xs1); gridxlabel('Time index n');ylabel('Amplitude');
title('Continuous-time signal xa(t)sampled at T1=0.01');% ^^^^ Continuous- Time Signal sampled at T=0.1 ^^^^^^
subplot(4,1,4);T2=0.2;n2 = 0:T2:1;xs2 = cos(2*pi*f*n2);k2 = 0:length(n2)-1;stem(k2,xs2); gridxlabel('Time index n');ylabel('Amplitude');
title('Continuous-time signal xa(t)sampled at T2=0.2');
SVERI’S College Of Engineering, Pandharpur. 26
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 27/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Output:
0 0 . 1 0 . 2 0 . 3 0 . 4 0 . 5 0 . 6 0 . 7 0 . 8 0 . 9 1- 1
0
1
T i m e , m s e c
A
m
p l i t u d e
C o n t i n u o u s - t i m e s i g n a l x a ( t )
0 1 2 3 4 5 6 7 8 9 1 0
- 1
0
1
T i m e i n d e x n
A
m
p l i t u d e
C o n t i n u o u s - t i m e s i g n a l x a ( t ) s a m p l e d a t T =
0 1 0 2 0 3 0 4 0 5 0 6 0 7 0 8 0 9 0 1 0 0- 1
0
1
T i m e i n d e x n
A
m
p l i t u d e
C o n t i n u o u s - t i m e s i g n a l x a ( t ) s a m p l e d a t T 1
0 0 . 5 1 1 . 5 2 2 . 5 3 3 . 5 4 4 . 5 5- 1
0
1
T i m e i n d e x n
A
m
p l i t u d e
C o n t i n u o u s - t i m e s i g n a l x a ( t ) s a m p l e d a t T 2
Conclusion:-----------------------
SVERI’S College Of Engineering, Pandharpur. 27
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 28/69
Lab Manual For ELECTRONICS SOFTWARE LAB
EXPERIMENT NO. 06
MONOSTABLE MULTIVIBRATOR USING 555
Aim : To simulate an Monostable Multivibrator using IC 555.
Software Tool: MULTISIM 10
Components:-
Name EDWinComponents Used
Description Number of componentsrequired
RES RC05 Resistor 1
CAP CAP Capacitor 2
555 LM555 Timer 1
VDC VDC Dc voltage source 1
GND SPL0 Ground 3
VGEN VGEN Pulse Generator 1
Theory :-
The 555 timer configured for monostable operation is shown in the figure.
SVERI’S College Of Engineering, Pandharpur. 28
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 29/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Monostable Multivibrator often called a one shot Multivibrator is a pulse generating
circuit in which the duration of this pulse is determined by the RC network connected
externally to the 555 timer. In a stable or standby state, the output of the circuit is
approximately zero or a logic-low level. When external trigger pulse is applied output is
forced to go high ( 2/3 V CC ). The time for which output remains high is determined by the
external RC network connected to the timer. At the end of the timing interval, the output
automatically reverts back to its logic-low stable state. The output stays low until trigger
pulse is again applied. Then the cycle repeats. The Monostable circuit has only one stable
state (output low) hence the name Monostable.
The internal diagram for a 555 timer is shown in the figure.
Pin1: Ground . All voltages are measured with respect to this terminal.
Pin2: Trigger . The output of the timer depends on the amplitude of the external trigger
pulse applied to this pin. The output is low if the voltage at this pin is greater than 2/3
V CC . When a negative going pulse of amplitude greater than 1/3 V CC is applied to this pin,
comparator 2 output goes low, which inturn switches the output of the timer high. The
output remains high as long as the trigger terminal is held at a low voltage.
Pin3: Output . There are two ways by which a load can be connected to the output
terminal: either between pin 3 and ground or between pin3 and supply voltage +V CC .
When the output is low the load current flows through the load connected between pin3
and +V CC into the output terminal and is called sink current. The current through the
SVERI’S College Of Engineering, Pandharpur. 29
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 30/69
Lab Manual For ELECTRONICS SOFTWARE LAB
grounded load is zero when the output is low. For this reason the load connected between
pin 3 and +V CC is called the normally on load and that connected between pin 3 and
ground is called normally off-load . On the other hand, when the output is high the current
through the load connected between pin 3 and +V CC is zero. The output terminal supplies
current to the normally off load. This current is called source current. The maximum
value of sink or source current is 200mA.
Pin4 : Reset . The 555 timer can be reset (disabled ) by applying a negative pulse to this
pin. When the reset function is not in use, the reset terminal should be connected to +V CC
to avoid any possibility of false triggering.
Pin5: Control Voltage. An external voltage applied to this terminal changes the threshold
as well as trigger voltage. Thus by imposing a voltage on this pin or by connecting a pot between this pin and ground, the pulse width of the output waveform can be varied.
When not used, the control pin should be bypassed to ground with a 0.01µF Capacitor to
prevent any noise problems.
Pin6 : Threshold . This is the non-inverting input of comparator 1, which monitors the
voltage across the external capacitor. When the voltage at this pin is greater than or equal
to the threshold voltage 2/3 V CC , the output of comparator 1 goes high, which inturn
switches the output of the timer low.
Pin7 : Discharge. This pin is connected internally to the collector of transistor Q1. When
the output is high Q1 is OFF and acts as an open circuit to external capacitor C connected
across it. On the other hand, when the output is low, Q1 is saturated and acts as a short
circuit, shorting out the external capacitor C to ground.
Pin8: +V CC . The supply voltage of +5V to + 18V is applied to this pin with respect to
ground.
SVERI’S College Of Engineering, Pandharpur. 30
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 31/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Operation:-
Initially when the circuit is in the stable state i.e , when the output is low, transistor Q1 is
ON and the capacitor C is shorted out to ground. Upon the application of a negative
trigger pulse to pin 2, transistor Q1 is turned OFF, which releases the short circuit acrossthe external capacitor C and drives the output high. The capacitor C now starts charging
up towards VCC through R. When the voltage across the capacitor equals 2/3 VCC,
comparator 1’s output switches from low to high, which inturn drives the output to its
low state via the output of the flip-flop. At the same time the output of the flip-flop turns
transistor Q1 ON and hence the capacitor C rapidly discharges through the transistor. The
output of the monostable remains low until a trigger pulse is again applied. Then the
cycle repeats.
The pulse width of the trigger input must be smaller than the expected pulse width of the
output waveform. Also the trigger pulse must be a negative going input signal with
amplitude larger than 1/3 VCC.
The time during which the output remains high is given by
where R is in Ohms and C is in Farads.
Once triggered, the circuit’s output will remain in the high state until the set time, t
elapses. The output will not change its state even if an input trigger is applied again
during this time interval t . The circuit can be reset during the timing cycle by applying
negative pulse to the reset terminal. The output will remain in the low state until a trigger
is again applied.
Procedure:-
Multisim -> Schematic Editor : The circuit diagram is drawn by loading components
from the library. Wiring and proper net assignment has been made. Values are assigned
for relevant components.
SVERI’S College Of Engineering, Pandharpur. 31
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 32/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Multisim -> Simulator: The circuit is preprocessed. The waveform marker is placed at
the output of the circuit. GND net is set as the reference net. The Transient Analysis
parameters are also set and the Transient Analysis is executed. The output waveform is
observed in the Waveform Viewer.
CIRCUIT DIAGRAM:-
A1
555_VIRTUAL
GND
DIS
OUTRST
VCC
THR
CON
TRI
C11uF
C21uF
R11kΩ
R21kΩ
VCC
5V
VCCXSC1
A B
Ext Trig+
+
_
_ + _
2
3
I1
1kHz
1 A
1
0
4
Monostable Multivibrator using
IC 555
Observation Table:-
C(µf) Theoretical(T=1.095 RC(ms))) Practical T(ms)
SVERI’S College Of Engineering, Pandharpur. 32
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 33/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Output:-
The output waveform may be observed in the waveform viewer.
Conclusion:-----------------------------
SVERI’S College Of Engineering, Pandharpur. 33
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 34/69
Lab Manual For ELECTRONICS SOFTWARE LAB
EXPERIMENT NO. 07
ASTABLE MULTIVIBRATOR USING 555
Aim : To simulate an Astable multivibrator using IC 555.
Software Tool: MULTISIM 10
Components:-
Name EDWinComponents Used
Description Number of componentsrequired
RES RC05 Resistor 2
CAP CAP Capacitor 2
555 LM555 Timer 1
VDC VDC Dc voltage source 1
GND SPL0 Ground 3
Theory:-
The circuit diagram for the astable multivibrator using IC 555 is shown here. The astable
multivibrator generates a square wave, the period of which is determined by the circuit
SVERI’S College Of Engineering, Pandharpur. 34
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 35/69
Lab Manual For ELECTRONICS SOFTWARE LAB
external to IC 555. The astable multivibrator does not require any external trigger to
change the state of the output. Hence the name free running oscillator. The time during
which the output is either high or low is determined by the two resistors and a capacitor
which are externally connected to the 555 timer.
The above figure shows the 555 timer connected as an astable multivibrator. Initially
when the output is high capacitor C starts charging towards V cc through R A and R B.
However as soon as the voltage across the capacitor equals 2/3 V cc, comparator1 triggers
the flip-flop and the output switches to low state. Now capacitor C discharges through R B
and the transistor Q1. When voltage across C equals 1/3 V cc, comparator 2’s output
triggers the flip-flop and the output goes high. Then the cycle repeats.
The capacitor is periodically charged and discharged between 2/3 V cc and 1/3 V cc
respectively. The time during which the capacitor charges from 1/3 V cc to 2/3 V cc is equal
to the time the output remains high and is given by
where R A and R B are in ohms and C is in Farads. Similarly the time during which the
capacitor discharges from 2/3 V cc to 1/3 V cc is equal to the time the output is low and is
given by
SVERI’S College Of Engineering, Pandharpur. 35
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 36/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Thus the total time period of the output waveform is
Therefore the frequency of oscillation
The output frequency, f is independent of the supply voltage V cc.
Procedure:-
Multisim -> Schematic Editor: The circuit diagram is drawn by loading components
from the library. Wiring and proper net assignment has been made. Values are assigned.
For relevant components.
Multisim-> Simulator:The circuit is preprocessed. The waveform marker is placed at
the output of the circuit. GND net is set as the reference net. The Transient Analysis
parameters are also set and the Transient Analysis is executed. The output waveform is
observed in the Waveform Viewer.
Circuit Diagram:-
SVERI’S College Of Engineering, Pandharpur. 36
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 37/69
Lab Manual For ELECTRONICS SOFTWARE LAB
U1
LM555CM
GND
1
DIS7
OUT 3RST4
VCC
8
THR6
CON5
TRI2
R1
2.2kΩ
R23.9kΩ
C1100nF C2
10nF
VCC
5VVCC
1
2
00
XSC1
A B
Ext Trig+
+
_
_ +
_
4
3
ASTABLE MULTIVIBRATOR USING
IC LM555
Observation Table:-
C (µf) Theoreticaltime period(us)
Practical time period(us)
Theoretical freq(kHz)
Practicalfreq(kHz)
Output:-
SVERI’S College Of Engineering, Pandharpur. 37
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 38/69
Lab Manual For ELECTRONICS SOFTWARE LAB
The output waveform may be observed in the waveform viewer.
Conclusion:-------------------
EXPERIMENT NO. 08
RC PHASE SHIFT OSCILLATOR
SVERI’S College Of Engineering, Pandharpur. 38
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 39/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Aim: Simulation of RC Phase Shift Oscillator .
Software Tool: - MULTISIM 10
Theory:-
Oscillator Fundamentals:
An oscillator is a circuit that is capable of a sustained AC output signal obtained by
converting input energy. Oscillators can be designed to generate a variety of signal
waveforms, and they are convenient sources of sinusoidal AC signals for testing, control,
and frequency conversion. Oscillators can also generate square waves, ramps, or pulses
for switching, signalling, and control.Simple oscillators produce sinewaves, but another form, the multivibrator, produces square or sawtooth waves. These circuits were
developed with vacuum-tubes, but have since been converted to transistor oscillators.
Figure 1. is a simple block diagram showing an amplifier and a block representing the
many oscillator phase-shift methods. Regardless of its amplifier, an oscillator must meet
the two Barkhousen conditions for oscillation:
1 - The loop gain must be slightly greater than unity.
2 - The loop phase shift must be 0° or 360°.
To meet these conditions the oscillator circuit must include some form of amplifier, and a
portion of its output must be fed back regenerative to the input. In other words, the
SVERI’S College Of Engineering, Pandharpur. 39
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 40/69
Lab Manual For ELECTRONICS SOFTWARE LAB
feedback voltage must be positive so it is in phase with the original excitation voltage at
the input. Moreover, the feedback must be sufficient to overcome the losses in the input
circuit (gain equal to or greater than unity). If the gain of the amplifier is less than unity,
the circuit will not oscillate, and if it is significantly greater than unity, the circuit will be
over-driven and produce distorted (non-sinusoidal) waveforms.
The typical amplifier--vacuum tube, BJT, or field-effect transistor--imparts a 180° phase
shift in the input signal, and the resistive-capacitive (RC) feedback loop imparts the
additional 180° so that the signal is returned in phase. Energy coupled back to the input
by inductive methods can, however, be returned with zero phase shift with respect to the
input.
RC Oscillators:
Figure 2. is the schematic for a phase-shift oscillator , a basic resistive-capacitive
oscillator. Transistor Q1 is configured as a common-emitter amplifier, and its output
(collector) signal is fed back to its input (base) through a three-stage RC ladder network,
which includes R5 and C1, R2 and C2, and R3 and C3.
Each of the three RC stages in this ladder introduces a 60° phase shift between its input
SVERI’S College Of Engineering, Pandharpur. 40
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 41/69
Lab Manual For ELECTRONICS SOFTWARE LAB
and output terminals so the sum of those three phase shifts provides the overall 180°
required for oscillation. The phase shift per stage depends on both the frequency of the
input signal and the values of the resistors and capacitors in the network.
The values of the three RC ladder network capacitors C1, C2, and C3 are equal as are the
values of the three resistors R5, R2, and R3. With the component values shown in Fig. 2,
the 180° phase shift occurs at about 1/14 RC or 700 Hz. Because the transistor shifts the
phase of the incoming signal 180°, the circuit also oscillates at about 700 Hz.
At the oscillation frequency, the three-stage ladder network has an attenuation factor of
about 29. The gain of the transistor can be adjusted with trimmer potentiometer R6 in the
emitter circuit to compensate for signal loss and provide the near unity gain required for
generating stable sine waves. To ensure stable oscillation, R6 should be set to obtain a
slightly distorted sine wave output.The amplitude of the output signal can be varied with
trimmer potentiometer R4. Although this simple phase-shift oscillator requires only a
single transistor, it has several drawbacks: poor gain stability and limited tuning range.
Procedure:-
Multisim -> Schematic Editor: The circuit diagram is drawn by loading components
from the library. Wiring and proper net assignment has been made. Values are assigned.
For relevant components.
Multisim-> Simulator:The circuit is preprocessed. The waveform marker is placed at
the output of the circuit. GND net is set as the reference net. The Transient Analysis
parameters are also set and the Transient Analysis is executed. The output waveform is
observed in the Waveform Viewer.
Circuit Diagram:-
SVERI’S College Of Engineering, Pandharpur. 41
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 42/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Q1
2N2219
R112kΩ
R239kΩ
R32.2kΩ
R4470Ω
R5
100kΩ
R65.6kΩ
R73.3kΩ
R85.6kΩ
C147uF
C2
100nF
C3
100nF
V1
6 V
0
2
C4
100nF
4 5
0
3
C5
47uF
1
XSC1
A B
Ext Trig+
+
_
_ + _
9
6
7
0
RC PHASE SHIFT OSCILLATOR
Output:-
SVERI’S College Of Engineering, Pandharpur. 42
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 43/69
Lab Manual For ELECTRONICS SOFTWARE LAB
The output waveform may be observed in the waveform viewer.
Conclusion:-----------------------
EXPERIMENT NO. 09
SVERI’S College Of Engineering, Pandharpur. 43
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 44/69
Lab Manual For ELECTRONICS SOFTWARE LAB
WEIN BRIDGE OSCILLATOR
Aim:- Simulation of Wein Bridge Oscillator
Software Tool: - MULTISIM 10
Theory:-
There are ways to overcome the drawbacks of the phase-shift oscillator, and one of them
is to include a Wien-bridge or network in the oscillator's feedback loop. The concept is
illustrated in the Fig. block diagram. A far more versatile RC oscillator than the phase-
shift oscillator, its operating frequency can be varied easily.
As shown within the dotted box in Fig. A Wien Bridge consists of a series-connected
resistor and capacitor, wired to a parallel- connected resistor and capacitor. The
component values are "balanced" so that R1 equals R2 and C1 equals C2.
The Wien Network is exceptionally sensitive to frequency. That shift is negative (to a
maximum of -90°) at low frequencies, and positive (to a maximum of +90°) at high
frequencies. It is zero a center frequency of 1/6.28RC. At the center frequency, network
attenuation is a factor of 3. As a result, the Wien network will oscillate if a non-inverting,
amplifier with a gain of 3 is connected as shown between the amplifier's output and input
terminals. The output is taken between the output of the amplifier and ground.
A basic two-stage Wien-Bridge oscillator schematic is shown in Fig. Both transistors Q1
SVERI’S College Of Engineering, Pandharpur. 44
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 45/69
Lab Manual For ELECTRONICS SOFTWARE LAB
and Q2 are configured as low-gain common-emitter amplifiers. The voltage gain of Q2 is
slightly greater than unity, and it provides the 180° phase shift required for regenerative
feedback. The 4.7K resistor R4, part of the Wien bridge network, functions as the
oscillator's collector load.
Transistor Q1 provides the high input impedance for the output of the Wien network.
Trimmer potentiometer R5 will set the oscillator's gain over a limited range. With the
component values shown, the Wien bridge oscillator will oscillate at about 1 KHz.
Trimmer R5 should be adjusted so that the sinewave output signal is just slightly
distorted to achieve its maximum stability.
Many different practical variable-frequency Wien-bridge oscillators can be built with
operational amplifier integrated circuits combined with an automatic gain-control
feedback network. No inductors are needed in these circuits.
Procedure:-
SVERI’S College Of Engineering, Pandharpur. 45
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 46/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Multisim -> Schematic Editor: The circuit diagram is drawn by loading components
from the library. Wiring and proper net assignment has been made. Values are assigned.
For relevant components.
Multisim-> Simulator:The circuit is preprocessed. The waveform marker is placed at
the output of the circuit. GND net is set as the reference net. The Transient Analysis
parameters are also set and the Transient Analysis is executed. The output waveform is
observed in the Waveform Viewer.
Circuit Diagram:-
Q1
2N3904
Q2
2N3904
R127kΩ
R24.7kΩ
R339kΩ R4
4.7kΩ
R61kΩ
R722kΩ
R83kΩ
R94.7kΩ
C233pF
C333pF
9R5
1kΩ
Key=A
90%6
38
V19 V
XSC1
A B
Ext Trig+
+
_
_ + _
1
C5
1uF
C110uF
2
Wein Bridge Oscillator
0
4 5
10
Output:-
SVERI’S College Of Engineering, Pandharpur. 46
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 47/69
Lab Manual For ELECTRONICS SOFTWARE LAB
The output waveform may be observed in the waveform viewer.
Conclusion:--------------------
EXPERIMENT NO. 10
MOSFET AS A SWITCH
SVERI’S College Of Engineering, Pandharpur. 47
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 48/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Aim: Simulation of MOSFET as A Switch.
Software Tool:- MULTISIM 10
Theory:-
The N-channel, Enhancement-mode MOSFET operates using a positive input voltage and
has an extremely high input resistance (almost infinite) making it possible to interface
with nearly any logic gate or driver capable of producing a positive output. Also, due to
this very high input (gate) resistance we can parallel together many different MOSFET's
until we achieve the current handling limit required. While connecting together various
MOSFET's may enable us to switch high current or high voltage loads, doing so becomes
expensive and impractical in both components and circuit board space. To overcome this
problem Power Field Effect Transistors or Power FET's where developed.
By applying a suitable drive voltage to the gate of an FET the resistance of the drain-
source channel can be varied from an "OFF-resistance" of many hundreds of kΩ's,
effectively an open circuit, to an "ON-resistance" of less than 1Ω, effectively a short
circuit. We can also drive the MOSFET to turn "ON" fast or slow, or to pass high
currents or low currents. This ability to turn the power MOSFET "ON" and "OFF" allows
the device to be used as a very efficient switch with switching speeds much faster than
standard bipolar junction transistors.
In this circuit arrangement an Enhancement-mode N-channel
MOSFET is being used to switch a simple lamp "ON" and
SVERI’S College Of Engineering, Pandharpur. 48
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 49/69
Lab Manual For ELECTRONICS SOFTWARE LAB
"OFF" (could also be an LED). The gate input voltage VGS is
taken to an appropriate positive voltage level to turn the
device and the lamp either fully "ON", (VGS = +ve) or a zero
voltage level to turn the device fully "OFF", (VGS = 0).
If the resistive load of the lamp was to be replaced by an
inductive load such as a coil or solenoid, a "Flywheel" diode
would be required in parallel with the load to protect the
MOSFET from any back-emf.
Above shows a very simple circuit for switching a resistive
load such as a lamp or LED. But when using power
MOSFET's to switch either inductive or capacitive loadssome form of protection is required to prevent the MOSFET
device from becoming damaged. Driving an inductive load
has the opposite effect from driving a capacitive load. For
example, a capacitor without an electrical charge is a short
circuit, resulting in a high "inrush" of current and when we
remove the voltage from an inductive load we have a large
reverse voltage build up as the magnetic field collapses,
resulting in an induced back-emf in the windings of the
inductor.
For the power MOSFET to operate as an analogue switching
device, it needs to be switched between its "Cut-off Region"
where VGS = 0 and its "Saturation Region" where VGS(on) =
+ve. The power dissipated in the MOSFET (PD depends upon
the current flowing through the channel ID at saturation and
also the "ON-resistance" of the channel given as R DS(on).
Procedure:-
Multisim -> Schematic Editor: The circuit diagram is drawn
by loading components from the library. Wiring and proper
SVERI’S College Of Engineering, Pandharpur. 49
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 50/69
Lab Manual For ELECTRONICS SOFTWARE LAB
net assignment has been made. Values are assigned. For
relevant components.
Multisim-> Simulator:The circuit is preprocessed. The
waveform marker is placed at the output of the circuit. GND
net is set as the reference net. The Transient Analysis
parameters are also set and the Transient Analysis is
executed. The output waveform is observed in the Waveform
Viewer.
Circuit Diagram:-
R11MΩ
VDD
5V
LED2
Q2
BS170
MOSFET AS A SWITCH
V2
1MHz
5 V
1
0
XSC1
A B
Ext Trig+
+
_
_ + _
VDD
2
SVERI’S College Of Engineering, Pandharpur. 50
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 51/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Output:-
The output waveform may be observed in the waveformviewer.
SVERI’S College Of Engineering, Pandharpur. 51
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 52/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Conclusion:--------------------------
EXPERIMENT NO. 11
PCB DESIGN USING CAD TOOL
Aim: Prepare layout for various circuits using CADTOOL .
Software Tool:- EAGLE 5.2.0 (MULTISIEM 10 ,
PROTEUS)
Theory:-
Tool Box:
SVERI’S College Of Engineering, Pandharpur. 52
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 53/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Control Panel:-
After starting EAGLE, the Control Panel will be opened. It
allows you to load and save projects as well as to setup
certain program parameters. A right mouse click to an entry
in the Projects branch of the tree view opens a context menu
that allows to start a new project ( New/Project).
SVERI’S College Of Engineering, Pandharpur. 53
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 54/69
Lab Manual For ELECTRONICS SOFTWARE LAB
The tree view allows a quick survey of EAGLE's libraries. If
you expand one of the library entries in this branch, for
example 40xx.lbr , the content of the library will be shown.
Select a Device or Package entry to display the preview of
this object on the right.
The Control Panel offers also an overview of User Language
programs, Script files, and CAM jobs. Try selecting various
entries. On the right you will get the referring description.
The Control Panel supports Drag & Drop in usual manner. A
right mouse click on any entry in the tree view opens a
context menu that offers options like Print, Open, Copy,
Rename etc.
The cursor keys allow you to navigate efficiently within the
tree view. The cursorright key expands a branch. Cursorleft
jumps back to the superior node. Hit Cursorleft again to close
the branch. Cursorup/ down leads you to the previous/next
entry. The paths for each branch of the tree view are set in
Options/Directories.
EAGLE Files
The following table lists the most important file types that can be edited with EAGLE:
EAGLE uses only lower case letters for file extensions!
SVERI’S College Of Engineering, Pandharpur. 54
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 55/69
Lab Manual For ELECTRONICS SOFTWARE LAB
PROCEDURE:-
Create EAGLE Projects:-
Lets create a new project first. After starting the program,
first
• The + character of the Projects path, then
• The + character of the entries examples and tutorial
in the tree view. The contents of the tutorial directory
appears.
• Tutorial with the right mouse button.
• Select the option New Project in the popup menu.
Name the new project MyProject , for example and hit
the Enter key.
• This way you are creating a subdirectory of tutorial
that is named MyProject .
• This directory should contain all data files that belong
to your project. Of course you may define additional
subdirectories.
• To define the path where your project directories will
be stored, click => Options/Directories and enter it in
the Projects field.
• A right mouse click on the project entry and you can
open new schematics,
layouts and libraries. Each project directory contains a
file named eagle.epf which stores project specific
settings, window positions etc.
• Click this icon and then mark a rectangular area
by dragging the mouse cursor while the left mouse
button is pressed. Then release the mouse button. The
marked area will now be displayed. It's possible to
SVERI’S College Of Engineering, Pandharpur. 55
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 56/69
Lab Manual For ELECTRONICS SOFTWARE LAB
define a certain area of the drawing as a so called
alias.
Create EAGLE Schematic:-
First a new schematic file is to be created. Close all of the
editor windows and select => File/New/Schematic from the
Control Panel.
A new file with the name untitled.sch is now created.
Normally you should
never save a file with the name untitled , but should use
=> File/Save as... to
choose a different name.
Wire properties like Width, Style or Layer can be altered
through the Properties entry of the context menu. Select the
wire in question by a right mouse click to open the context
menu. As an alternative use the INFO command to open die
properties dialog.
Setting up Grid and Unit:-
Schematics should always be drawn on a grid of 0.1 inches
(2,54 mm) since the libraries are defined this way. The grid
for boards is determined by the components used and by the
complexity of the board. Grid and unit are setup by clicking
on the GRID icon in the parameter toolbar. Clicking with
the right mouse button on the GRID icon opens a popup
menu. It contains the entry Last which switches to the grid
used before. With New.. you are allowed to define so called
aliases representing certain grid settings. The alias name can
SVERI’S College Of Engineering, Pandharpur. 56
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 57/69
Lab Manual For ELECTRONICS SOFTWARE LAB
be used as a parameter with the GRID command. Quick
switches from one grid setting to another are possible now.
All values are given in the currently selected unit.
For all settings in the Design Rules window (= > Edit/Design
Rules...) one can use values in mil or in Millimetres (1 mil =
1/1000 inch). The default unit is mil.
Selecting Layers for Display:-
EAGLE Drawings contain objects in different drawing layers.
In order to obtain a useful result several layers are combined
for the output. For example, the combination of Top, Pad, and
Via layers is used to generate a film for etching the
component side of the printed circuit board. Consequently the
combination of Bottom, Pad, and Via layers is used to
generate the film for the solder side of the board. The Pad
layer contains the
throughholes for the component connections and the via layer
contains the viaholes
which are needed when a signal track changes to another
layer.
Completing the Schematic:-
SVERI’S College Of Engineering, Pandharpur. 57
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 58/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Use the ADD command to add the remaining components and
the symbols for +5V, V+, and GND from supply1.lbr.
Search pattern: *supply*.
Supply symbols represent the power signals in your
schematic and cause the ERC (Electrical Rule Check)to use
special checks for them. Remember that you can use the
MOVE command to move objects around and that you can
rotate objects attached to the mouse with a right mouse click.
Using the NET command, connect the pins of the components
according to the schematic and connect the supply symbols to
the related pins. Use the right mouse button to alternate
between the orthogonal and diagonal modes while using the
NET command.
If you place a net exactly on a connection point, the net is
terminated at this location. Otherwise the net keeps following
the mouse.
The Electrical Rule Check (ERC):-
SVERI’S College Of Engineering, Pandharpur. 58
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 59/69
Lab Manual For ELECTRONICS SOFTWARE LAB
If you haven't entered the complete schematic yourself you
can now load the file demo1.sch.
The ERC command is used to test schematics for electrical
errors. The results are warnings and error messages listed in
the ERC window. To start the Electrical Rule Check click the
ERC icon in the command toolbar.
The ERC finds two warnings in our sample:
POWER Pin IC1 VSS connected to GND
POWER Pin IC1 VDD connected to +5V
These messages inform you that the power pins are connected
to other signals than expected. The power pins were named
VSS or VDD in the library but are connected to GND and
+5V. In our case this has been done on purpose. Click on one
of the message entries and EAGLE will show where the
reason for the problem is located in the schematic. Both
warnings don't cause any problems and could be avoided by
changing
the names of the power pins in the library definition. But you
could also Approve these warnings. The messages are now
shown in the Approved branch, no longer in the Warnings
branch of the menu.
Please note that the ERC can only discover possible error
sources. It is up to you to properly interpret the ERC
messages!
Generating a Board from a Schematic:-
After loading a schematic from which you would like to
design a board, click on the BOARD icon in the action
SVERI’S College Of Engineering, Pandharpur. 59
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 60/69
Lab Manual For ELECTRONICS SOFTWARE LAB
toolbar: A board file will be generated in which the packages
are positioned next to an empty board.
If you have the Schematic Editor and the schematic is already
drawn, you only need a few steps to get the same result as
described in the previous section:
A board containing parts that have already names and values
and whose pads
or SMDs are connected through airwires.
Generating a Board File:-
Load the file demo1.sch and click the BOARD icon :
With this command you create a board file with the same
name as the loaded schematic (demo1.brd ).. Maximize the
Layout Editor window. The white frame on the right of the
window symbolizes the board outlines. It is made up of wires
in the layer 20, Dimension.
Component Placement:-
Select MOVE, the biggest IC somewhere in its center and
move the cursor inside the board outlines. The component
and the airwires remain attached to the cursor. Press the right
mouse button if you want to rotate the component & fix the
position of the component. Place all of the components using
the MOVE command.
Click the RATSNEST icon to calculate the airwires so that
they show the shortest possible connections. Repeat this
command whenever you want to check how good your
current placement is (short airwires, no twisted buses etc.)
Board Changes:-
SVERI’S College Of Engineering, Pandharpur. 60
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 61/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Once you have completed the routing of the board you can
make changes, e.g. you can:
1) press move and arrange wire segments and components
with MOVE and SPLIT ,
2) use the RIPUP command to change routed tracks to
airwires,
3) use DELETE to erase signals (only without
Forward&Back annotation),
4) replace package variants with CHANGE PACKAGE (also
PACKAGE)
5) modify the Design Rules (for example, Restring settings),
Copper Pouring with the POLYGON Command:-
The POLYGON command enables you to define areas which
belong to a signal, connecting all of the related pads to this
signal with Thermal symbols. Such a signal retains a user
defined distance to any other signal path. You can design
layers that contain multiple polygons such as different ground
areas, and you can design polygons on multiple layers.
Autorouter:-If you would like to see a small demo of the Autorouter, click
the icon for the AUTO command in the command toolbar.
Choose a finer Routing Grid (default 50 mil), if necessary and
press OK . It should be finished in no time at all, provided the
placement is not too bad (watch the status bar). If it is taking
too long, interrupt the Autorouter by
clicking the stop sign icon. Confirm the question Interrupt?
with press Yes.
SVERI’S College Of Engineering, Pandharpur. 61
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 62/69
Lab Manual For ELECTRONICS SOFTWARE LAB
If you don't like the result, reverse it with the command
RIPUP. If you would like to change certain routed tracks into
airwires, click these tracks and start the ripup process by a
click on the traffic light icon in the action toolbar. If you
would like to change all routed tracks into airwires, press the
RIPUP icon and then press the traffic light icon. Confirm the
question Ripup all signals? with press OK .
You can start the Autorouter at any time, regardless of
whether there are routed tracks or only airwires on the board.
Typically, supply signals and other critical signal paths are
routed manually, before the Autorouter is used. Tracks which
are layed out before starting the autorouter won't be changed.
No Autorouter on earth will lay your board out exactly as you
would like. But it can free you of a lot of boring work. In this
section we want to demonstrate that you can easily combine
manual and automated routing.
Load the board hexapodu.brd .
Switch off layers 21, tPlace, 23, tOrigins, 25 tNames, 27,
tValues, and 51, tDocu, using the DISPLAY command, so
that the components are not shown any more. This board
contains manually routed signals named AC1 and AC2.
Rectangles in the layers 41, tRestrict , and 42, bRestrict , have
been used to create restricted areas for the Autorouter. Within
these areas the Autorouter is not allowed to route tracks on
the Top or Bottom layers. Component B1 is covered by a
restricted area drawn in layer 43, vRestrict . This means the
Autorouter must not set vias there.
SVERI’S College Of Engineering, Pandharpur. 62
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 63/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Start the Autorouter by clicking the AUTO icon in the
command toolbar. A popup menu appears where you can
enter individual settings You should choose a routing grid of
10 mil (0.254 mm) for hexapodu.brd . As we want to route all
of the unrouted signals OK .
Watch the status messages appearing in the status bar. They
inform you, for instance, of how many signals have been
routed, or of how many vias have been placed at the moment.
You will notice that the number of vias goes down during the
Optimize passes.
If you want to interrupt the Autorouter click on the stop icon.
A protocol of the routing run is stored in the file
hexapodu.pro. Load it into a Text Editor window to have a
look at it. The autorouter uses the width given in the Design
Rules (=> Edit/Design Rules, Sizes tab, Minimum width) for
his tracks. If there are values given in the CLASS command
to define various net classes (as in the example file
hexapod.brd ) the autorouter will also take care of them. In
this case the greater value will be taken.
To define restricted areas for the autorouter use layer 41,
tRestrict , for the Top layer, respectively layer 42, bRestrict ,
for the Bottom layer.
Restricted areas in layer 43, vRestrict , forbids setting vias.
Conclusion:------------------------------
SVERI’S College Of Engineering, Pandharpur. 63
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 64/69
Lab Manual For ELECTRONICS SOFTWARE LAB
Circuit Diagram:-
1)
LAYOUT:-
SVERI’S College Of Engineering, Pandharpur. 64
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 65/69
Lab Manual For ELECTRONICS SOFTWARE LAB
2) CIRCUIT DIAGRAM:-
LAYOUT:-
SVERI’S College Of Engineering, Pandharpur. 65
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 66/69
Lab Manual For ELECTRONICS SOFTWARE LAB
3) CIRCUIT DIAGRAM:-
LAYOUT:-
SVERI’S College Of Engineering, Pandharpur. 66
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 67/69
Lab Manual For ELECTRONICS SOFTWARE LAB
4) CIRCUIT DIAGRAM:-
SVERI’S College Of Engineering, Pandharpur. 67
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 68/69
Lab Manual For ELECTRONICS SOFTWARE LAB
LAYOUT:-
5) CIRCUIT DIAGRAM:-
LAYOUT:-
SVERI’S College Of Engineering, Pandharpur. 68
8/8/2019 ESL Lab Manual1[1]
http://slidepdf.com/reader/full/esl-lab-manual11 69/69
Lab Manual For ELECTRONICS SOFTWARE LAB