Scs Manual
Scs Manual
Scs Manual
ENGINEERNG
CERTIFICATE
has satisfactorily completed the lab exercises prescribed for Signals & Circuits Simulation Lab
[ECE- 2162] of Second Year B. Tech. Degree at MIT, Manipal, in the academic year 20 - 20
Date : ………………………………………..
Signature Signature
Faculty in-charge Head of the Department
CONTENTS
EXP PAGE
TITLE REMARKS
NO. NO.
E2 R, L, and C circuits 15
E5 Network Theorems 36
E7 Applications of OPAMP 53
E8 Active filters 60
Simulation of signal and operation using
E9 68
MATLAB.
E10 Study of system response to various inputs 75
Course Objectives
To simulate and analyze basic circuits using schematics.
To develop programming skills to describe electric circuits using netlist.
To design, simulate and verify circuits consisting of R, L, C, diodes, transistors
and OPAMPs.
To generate various signals using MATLAB and study their spectrum.
To analyze a given system and determine the response of the system for the
given input using MATLAB.
Course Outcomes
At the end of this course, students will be able to
Simulate designed circuits using schematic and Netlist.
Explore various applications using diode, BJT and OPAMP.
Generate various signals and verify their spectrums.
Analyze a given system for various inputs.
Evaluation plan
Internal Assessment Marks : 60%
Continuous evaluation component (for each experiment):10 marks
Assessment is based on conduction of each experiment, exercise problems,
answering the questions related to the experiment.
Total marks of the 10 experiments scaled to 60 marks
Note: Follow code of conduct (punctual, disciplined, and sincere)
End semester assessment: 40 % (40 marks)
write up (circuit diagram, design/analysis, netlist, observation table, expected
results/graphs): 12marks
Conduction: 12 marks
Results and Calculations: 08 marks
Viva-Voce: 08 marks
1
Introduction to Simulation using PSPICE
Introduction
Simulation allows predicting the circuit behavior, without constructing a prototype. A
simulator is a software that enables to assemble circuit components models tested. It
provides economic and fast solution for testing of designs. SPICE (Simulation Program
with Integrated Circuit Emphasis) can be used to simulate circuits containing resistors,
capacitors, inductors, mutual inductance, independent and dependent voltage and
current sources and semiconductor devices. The circuit can be described either as a
Netlist or as a schematic. The described circuit is analyzed and the waveforms are
displayed interactively using the waveform viewer, Probe. The bias point details and
node voltages and currents are noted using output file.
Programming in PSPICE
Netlist can have 5 parts
Title and comment statements:
First statement while writing the Netlist is the Title. Netlist file can have any
number of comment statements, by appending an asterisk(*) in the first column, the
statements are considered to be comments.
Circuit Description:
Circuit Description can be done with data statements. Data statement is composed of
element name, circuit nodes to which elements are connected and the value of the
element.
Analysis:
Analysis like AC, DC or Transient can be carried on the specific circuit. The
solution control statement specifies the type of analysis to be performed.
Output Description:
The output specification statements specify how the results are to be stored in the
output file.
END Statement:
The last statement while writing Netlist must be END statement, which indicates the
end of the simulation.
2
Format of Data Statements:
Passive Elements:
Resistor : Rname node1 node2 value
Capacitor : Cname node1 node2 value
Inductor : Lname node1 node2 value
Coupled Circuit : Kname L1 L2 value
Suffixes to be used to specify the value are: P-Pico, N-nano, U-micro, M-milli, K-kilo,
MEG- mega. Units are optional.
For coupled circuits, value indicates coefficient of coupling and should be a number
between 0 and 1. The ( ) DOT end should be the first node of L1 and L2.
Independent Sources:
Voltage Sources: Vname +node -node type value
Current Sources: Iname +node -node type value
Type indicates the type of the source model. Source Models: Few of the source models
are
DC VALUE
AC MAGNITUDE PHASE
PWL (T1 V1 T2 V2 T3 V3 T4 V4…)
PULSE (V1 V2 TD TR TF TW PER)
3
.DC statement performs a dc sweep analysis for the source SNAME with IVAL as its
initial value, FVAL as its final value in steps of INC. It gives repeated dc steady state
solutions for different values of the source SNAME. Circuit parameters other than
SNAME remain unchanged.
Example: .DC VIN -0.125 0.125 0.005: This command does a DC sweep. The
Voltage source VIN is swept from -0.125 volts to 0.125 volts in steps of 0.005 volts.
.AC Statement is used to calculate the frequency response of a circuit over a range of
frequencies from FSTART to FSTOP. NP denotes the number of points and LIN
indicates linear sweep over the range.
Example: .AC DEC 10 100KHZ 10GHZ : The real and imaginary response of the
circuit is calculated as the inputs are swept from 100KHz to 10GHz by decades with 10
points per decade.
UIC stands for use initial conditions and Used when initial charge across capacitors or
initial current through inductors not equal to zero.
.OP: Used with DC analysis. It displays the DC voltages, current delivered by the
sources and the total power dissipated. It specifies DC operation point.
.PRINT type list: Prints values in output file. Here type is the type of analysis such
as DC,AC,TRAN etc. and list is a list of output variables to be displayed.
.PROBE: It is for invoking the waveform viewer PROBE which displays the results
of PSPICE simulator graphically and interactively.
4
START INSTRUCTIONS
There are two ways we can simulate the circuits
A) Drawing the circuit and simulating using Capture CIS.
B) Writing Netlist and simulating using PSPICE.
To work using software tools it is very important where and how you save your
work/programs
B – Writing Netlist
1. Open PSpice A/D
2. startup→Allprograms→OrCAD→PSpice A/D
3. Create new text file: File →new → text file: Save text file with ‘.cir’ extension
with name as N1.cir or N2.cir in folder E1 in NET15
4. To simulate again open that file which was saved with .cir extension and run.
5
Steps to draw the Schematic:
Get all the components and place them in the worksheet
Place → part →
1. Resistance : Analog → R
2. Place DC Voltage source from the Source library (Vdc). To set the value for
Vdc, double click and type the values as Vdc=10 V.
3. Place ground: go to Place →ground. Use 0/source option.
4. Place →wire: Connect all the components using wires as shown in the circuit.
5. Place→netalias to relabel the nodes.
6. Save the schematic as specified in introduction.
DC Analysis:
1. Go to PSPICE →create netlist.
2. To setup a PSPICE simulation, click on “PSPICE” and then select “New
simulation profile”. Enter a filename for the simulation click on “Create”.
3. To do analysis select edit simulation settings→ DC Sweep and select Primary
source. Enter voltage source name as V1, Sweep type (i) value list and give 10
or (ii) select Linear and give start value as 10v, end value as 10v and increment
as 1v
(Note: Don’t give increment as zero).
4. Run the simulation. (After simulation is finished a probe window pops up).
6
5. Measure currents and voltages using “Trace→Eval” goal functions.
Note: Eval goal functions works only for constant value
6. From the “TRACE” menu, select “ADD TRACE” and select the voltages and
currents you would like to display. Also verify Ohms Law by writing expression
in TRACE window.
Parametric Sweep
1. PARAM: Select part Special library
To Edit properties: Insert new column: name=val, its value =1, apply and display
column headed val (name and value)
2. Change value of that part (in this case say load resistor) to {val}
3. Place net alias for all important nets in circuit
7
Transient Analysis
1. PSPICE →create netlist.
2. To setup a PSPICE simulation, click on “PSPICE” and then select “New
simulation profile”. Enter a filename for the simulation click on “Create”.
3. Analysis → edit the simulation set up: set Time Domain(Transient) analysis,
Run to time=20ms, Maximum step size=5ms.
4. Click on run button. Once the simulation is finished a probe window pops up.
5. From the TRACE Menu select ADD TRACE and select the voltage and currents
you like to display.
AC Analysis
1. PSPICE →create Netlist & setup a new simulation profile and save.
2. Analysis → edit the simulation set up: set AC Sweep/Noise analysis, select AC
Sweep type ‘Logarithmic, Start Frequency=1, Stop Frequency=10k and
Total Points=100.
3. Click on run button. Once the simulation is finished a probe window pops up.
4. From the TRACE Menu select ADD TRACE and Plot the frequency response.
8
Experiment No. 1: Verification of KCL & KVL
Objectives:
To verify Ohms law and Kirchhoff laws (KCL & KVL) using simple resistive circuits.
10
Circuit 3: Voltage source
Figure 1.4 Circuit to verify relation between voltage source and load resistor
11
Result:
Figure 1.6 Circuit to analyze the behavior of voltage source as current source
Analysis/Simulation set up
1. PSPICE →create netlist
2. To setup a PSPICE simulation click on “PSPICE” and then select “New
simulation profile”. Enter a filename for the simulation click on “Create”.
3. Analysis→edit the simulation set up: DC sweep and follow the similar
instructions given for previous circuits.
4. Also select parametric sweep, global parameter, parameter name as val, and
Sweep type log : 1 to 100K , no of points per decade is 10.
12
5. From the TRACE Menu select ADD TRACE and select the load current (Set X-
axis in log scale) to view variation clearly. Also plot the current independent of
load (V1/100+100K).
Result:
Figure 1.8 Circuit for problem 2 Figure 1.9 Circuit for problem 3
4. Use the PSpice Schematics to construct the circuit shown in Figure 1.10 and obtain
the node voltages and branch currents.
13
Figure 1.10 Circuit for problem 4
5. Find the loop current in the loop containing R2 R1 L1 and L2 shown in the loop
and voltage across 6Ω resistor for the circuit shown in Figure 1.11.
Figure 1.11 Circuit for problem 5 Figure 1.12 Circuit for problem 6
6. Use the PSpice Schematics to construct the circuit below and obtain the node
voltages.
14
Experiment No. 2: R L and C Circuits
Objectives:
1. Analysis of R C and R L circuits by varying the time constant.
2. Verification of coupling circuits.
3. To simulate and analyze series and parallel resonating circuits at 10 kHz
resonant frequency.
4. To observe the effect of variation in R, L, and C in resonating circuits.
Circuit 1: R C Circuit
Analysis:
1. PSPICE →create netlist.
2. To setup a PSPICE simulation, click on “PSPICE” and then select “New
simulation profile”. Enter a filename for the simulation click on “Create”.
15
3. Analysis → edit the simulation set up : set Time Domain(Transient) analysis,
Run to time=20ms, Maximum step size=5ms.
4. Click on run button. Once the simulation is finished a probe window pops up.
5. From the TRACE Menu select ADD TRACE and select the voltage and currents
you like to display.
Result:
Analysis:
1. PSPICE →create Netlist & setup a new simulation profile and save.
2. Analysis → edit the simulation set up : set AC Sweep/Noise analysis, select AC
Sweep type ‘Logarithmic, Start Frequency=1, Stop Frequency=10k and
Total Points=100.
3. Click on run button. Once the simulation is finished a probe window pops up.
4. From the TRACE Menu select ADD TRACE and Plot the frequency response.
16
Result:
17
Analysis:
1. PSPICE →create netlist & setup a new simulation profile and save.
2. Analysis→ edit the simulation set up: set Time Domain(Transient) analysis,
Run to time=20m, Maximum step size=5m.
3. Also select parametric sweep, global parameter, parameter name as val, and
value list as 10, 5k, 10k.
4. From the TRACE Menu select ADD TRACE and display input output voltages.
Result:
18
Steps to draw the Schematic:
Analysis:
Result:
19
Circuit 4: Verification of coupling circuit
Result:
20
Circuit 5: Series Resonant Circuit
(a) (b)
Figure 2.10 (a) Series Resonant circuit (b) Current Vs Frequency waveform
Analysis:
1. PSPICE →create netlist and Set AC Sweep type ‘Linear’, Start Frequency=1k,
Stop Frequency=20k and Total Points=100 and run
2. TRACE various voltage and currents, reactance v/s frequency.
21
Results:
22
Figure 2.11(e) Phase angle of series resonant circuit (tan-1((XL-XC)/R)) v/s frequency
Analysis:
1. Create netlist and simulation profile for AC sweep for 1KHz to 20KHz.
2. Also select parametric sweep, global parameter, parameter name as val, and
value list as 0.27 , 0.25, 0.23.
3. Run simulation and plot load current.
4. Similarly obtain plots of currents by (ii) varying C(1.1n,1n,0.9n) and keeping R
and L constant and (iii) varying R (0.8k,1k,1.2k) and keeping C and L constant.
23
Result:
24
Exercise:
1. Simulate and analyze the parallel resonant circuit at resonant frequency 10 kHz
given below in Figure 2.13. Obtain
a) Impedance v/s Frequency plot.
b) Current v/s frequency plot.
c) Susceptance v/s frequency plot (BL= -1/(2*pi*f*L) and Bc=2*pi*f*C).
d) Vary R, Land C and observe the effect in impedance v/s frequency plot.
2. Stimulate and analyze the R C and R L circuits using VPULSE and VPWL inputs.
(a) Find the voltages across R, L, or C in each case by varying R, C and L.
(b) Also observe the Frequency Response in each case.
4. Design a Band pass filter using a low pass filter of cut off frequency 10k and high
pass filter with cut off frequency 1k.
25
5. Determine the real power in the circuits shown in Figure 2.15. Use PSPICE and
obtain a plot of the instantaneous voltages. currents and power.
7. For the series RLC circuit shown, use AC Analysis to sweep the frequency from
10Hz to 100KHz over a decade variation with 200 points per decade.
(a) Plot the current magnitude and phase angle. Determine the resonant frequency.
(b) Also draw the 0.707(V0(max)) line and estimate the circuit bandwidth b, and the
Q-factor.
(c) Plot the real and reactive power delivered to the circuit as a function of
frequency.
Figure 2.16 Circuits for problem 5 Figure 2.17 Circuits for problem 6
26
Experiment No. 3: Diode and its Applications
Objectives:
1. To simulate and analyze various applications of diode
2. To use C filter with rectifiers to smooth out the ripples present in rectified output
(a) (b)
Figure 3.1 (a) Half wave rectifier circuit (b) Rectified output waveform
Analysis:
1. Create netlist, simulate transient sweep for time =40ms
2. Run and TRACE the voltage and currents.
27
Results:
Figure 3.2 Amplitude of secondary input voltage for HWR set to (a) 23V (b) 1V
28
Circuit 2: Center tapped Full wave rectifier
Figure 3.4: Center tapped FWR circuit and voltages at different nodes of FWR
Analysis:
1. Create netlist, set transient analysis and run for time 40ms.
2. TRACE various input voltages and load voltage.
The center tapped FWR circuit can be represented by using equivalent input at the
secondary directly as shown in Figure 3.5.
Figure 3.5 Center tapped FWR and its Equivalent Spice Model
29
Result:
Analysis:
1. Create netlist, select transient analysis and run for 40ms
2. Also select parametric sweep to vary R as 50 , 4k, 10k and plot input and
output voltages
.
30
Results:
Figure 3.8 Waveforms for HWR with C filter for varied values of R
Exercise:
1. Simulate Bridge rectifier using 4 diodes.
2. Simulate center tapped and Bridge rectifiers using C type filters.
3. Simulate clipper circuits (positive, negative and both level).
4. Simulate the diode V- I characteristics using the circuit given below. Use diode
D1N4002.
5. Build the circuit as shown in Figure 3.10. Provide Vin= 2V pp at 1 KHz and
observe the output waveform. The circuit is called voltage doubler. What
changes would you do to the circuit of Figure 3.10 to build a simple clamping
circuit? What would the output look like? Verify using PSPICE.
Figure 3.9 Circuit for problem 4 Figure 3.10 Circuit for problem 5
31
Experiment No. 4: I/O Characteristics of BJT and OPAMP
Objectives:
1. To simulate and analyses the transfer characteristic of BJT.
2. To simulate and analyses the transfer characteristic of OPAMP.
3. Measurement of Slew rate and Input-output impedance of OPAMP.
4. To simulate Frequency Response of OPAMP.
1. Get all components and place and wire as shown in Figure 4.1.
2. Transistor: Select part Q2N22222A from transistor library.
3. Set DC Voltage values as DC=12.
4. Label nets and Save the schematic.
Analysis:
1. Create netlist and new simulation profile.
2. Set DC Analysis: Primary sweep for V1 in the range 0 to 12V in steps of 0.01
and Secondary sweep for I3 in the range of 0 to 1m in steps of 0.25m.
3. TRACE input and output currents to be displayed.
32
Results: The simulated waveform for the circuit above is as shown in Figure 4.2.
Analysis:
1. Create Netlist, DC analysis in new simulation profile.
2. Set V1 in the range of -150uV to 150uV in increments of 10uV.
3. TRACE output node voltage.
33
Results:
Exercise:
1. Build the voltage follower circuit. Apply Vin+ = 1 Vpp square waveform at 1 KHz.
Observe output signal and calculate slew rate. Use µa741 OPAMP.
2. Build the circuit as shown in Figure 4.5. Calculate the I/P impedance. Provide
necessary bias voltage for OPAMP.
3. Build the circuit a shown in Figure 4.7. Apply Vin = 1Vpp sine waveform at 1 KHz.
Vary frequency from 100 Hz to 3 MHz and measure Vout. Plot logarithmic graph
for frequency response. What is your bandwidth?
34
4. Obtain the characteristics of transistor in CB configuration.
5. For a square wave input of amplitude 5V, verify the working of BJT as an inverter
in Figure 4.8.
Figure 4.6 Slew rate Measurement Figure 4.7 Circuit for frequency response
35
Experiment No. 5: Network Theorems
Objectives:
To verify the circuit theorems-Thevenin’s, Norton’s, Maximum Power Transfer,
Superposition Theorem.
Circuit 1 & 2:
36
Circuit 3:
Circuit 4:
37
Results:
Note: Unit ‘V’ in x-axis is unit of variable. In Figure 5.5 variable ‘val’ represents load ‘V’ is
considered as ‘Ω’
Circuit 5:
38
Circuit 6:
Figure 5.7 Circuit to verify superposition theorem with voltage source alone
Circuit 7:
Figure 5.8 Circuit to verify superposition theorem with current source alone
Exercise:
1. Calculate Iab and Vcg using superposition theorem for circuit shown in Figure 5.9
2. Verify the Thevenin’s, Norton’s andMaximum Power Transfer Theorem for circuit
shown in Figure 5.10
39
3. In the following figure, R1= 4 KΩ, R2 = 8 KΩ, R3= 10 KΩ, R4= 2Ω, R5=8 KΩ,
R6=6KΩ, and V1=10V. If the current source I1 is 5 mA, find the Thevenin’s
equivalent circuit between nodes A and B. If 2KΩ resistor is connected between
nodes A and B, find the power dissipated.
4. Find the Thevenin's equivalent of circuit shown in Figure 5.12.
5. Verify the maximum power transfer theorem for the circuit given in Figure 5.13
Figure 5.9 Circuit for problem 1 Figure 5.10 Circuit for problem 2
Figure 5.11 Circuit for problem 3 Figure 5.12 Circuit for problem 4
40
Experiment No. 6: Amplifiers and Oscillators
Objective:
To design and simulate RC-Coupled amplifier circuit (with or without feedback)
and plot frequency response.
Design 1:
1. Selection of VCC
Given VCEQ = 5V and ICQ = 2mA
For thermal stabilization
VCEQ ≤ VCC/2 or VCC ≥ 2VCEQ
Therefore VCC = 12V.
2. Selection of RE
Let the voltage drop across RE = 10 % of VCC
VRE = 1.2V, now IC IE =2mA
Therefore RE = VRE/IE = 1.2/2m = 600 Ω
Select RE = 620 Ω standard value.
3. Selection of RC
RC = VRC/IC, here VRC = VCC – VCEQ – VRE
12 – 5 – 1.2 = 5.8V
RC = 2.9kΩ
Select RC = 3kΩ standard value.
4. Selection of R1 and R2
Transistor is BC107, from data book hFE = 200 = β
S
1 1 [ RB / RE ]
, where RB = R1 ‖ R2
1 [ RB / RE ]
Given S = 6, β = 200, we get RB 3kΩ
Now V = IBRB + VBE (1+ β) IBRE
Where IB = IC/ β = 10µA, VBE = 0.7V
We get V = 1.936V
41
VCC
V R2 and RB = R1 ‖ R2
R1 R2
VCC RB
V R1 = 18.59kΩ ≈ 22kΩ (std)
R1
R2 = 3.57kΩ = 3.3kΩ (std)
Ri = R1 ‖ R2 = hFE. re
re = 25mv/ IE = 12.5Ω, Ri = 133Ω, XCC = 1/ 2πfLCC
where fL = lower cut-off frequency = 200Hz, CC = 6µF ≈ 10µF
42
Analysis:
1. Create netlist, Set simulation AC Sweep ‘Logarithmic’ in the range of 1Hz to
10GHz with 10 points
2. TRACE 20*log10{(o/p voltage)/(i/p voltage)} and measure bandwidth.
Figure 6.1(a) Schematic circuit diagram of amplifier using BJT without feedback
Result:
43
2. With feedback (CE not connected):
Figure 6.2(a) Schematic circuit diagram of amplifier using BJT with feedback
Result:
Analysis:
1. Create netlist, set Transient analysis and run time to 160msec, maximum step
size = 50u, and run.
2. TRACE V(C4:2),V(C2:2),& V(C1:2) in as shown in Figure 6.3(b).
3. Measure frequency by calculating time period using curser in Figure 6.3(b).
Result:
45
Objective: Design and simulate an inverting amplifier using Op-amp uA741 for a gain
of 50. Measure its roll off rate and bandwidth.
Design 3: Gain=Rf/R1., UGB=1MHZ ; Cuttoff Freq=UGB/Gain
Analysis:
1. Set for AC Sweep, frequency range 10Hz to 100KHz, and 100.
2. TRACE 20*log10 {(o/p voltage)/ (i/p voltage)} and also Output voltage and
input voltage using transient/ time domain analysis as shown in Figure 6.4(c).
Results:
Figure 6.4(b) Gain v/s frequency of amplifier using OPAMP (UA741) (Gain Plot)
46
Figure 6.4(c): Input-output waveform of amplifier using OPAMP (μA741)
Objective:
Design a suitable circuit to generate the sinusoidal signal of desired frequency
using tank Circuit (LC) using BJT
1
Design 4: The frequency of oscillations for a Hartley Oscillator is given as: 𝑓 = 2𝜋√𝐿𝐶
The total inductance is sum of two inductive coils: 𝐿 = 𝐿1 + 𝐿2
47
Analysis:
1. Set Transient Analysis and run to 10msec. (maximum step size = 50u).
2. TRACE V (L3:2) as shown in Figure 6.5(b).
3. Measure frequency by using curser in Figure 6.5(b).
Result:
Objective: Design a suitable circuit to generate square wave using OPAMP for a
desired frequency and duty cycle.
𝟏 𝟏+𝜷 𝑹𝟒
Design 5: = 𝑻 = 𝟐𝑹𝑪 𝒍𝒏 𝟏−𝜷 Where 𝜷=𝑹
𝒇 𝟒 +𝑹𝟐
Analysis:
1. Set Transient analysis, run for 100msec, maximum step size = 50u.
2. TRACE V (R2:2) as in Figure 6.6(b).
48
Figure 6.6(a) Schematic diagram of square wave generator
Result:
Objective: Design a suitable circuit to generate triangular wave with specified peak
value and frequency.
𝑅 1 𝑅3
Design 6: Triangular wave Vo(pp) =2 𝑅2 𝑉𝑠𝑎𝑡 and Output frequency =
3 4𝑅1 𝐶2 𝑅2
Steps to draw the Schematic:
1. Draw circuit as shown circuit in Figure 6.7 (a).
Analysis:
1. Set Transient Analysis and run for 5msec, maximum step size = 50u.
49
2. TRACE output voltages of each of the OPAMP and verify results are shown in
Figure 6.7(b).
Result:
50
Exercise:
1. Design a square wave oscillator for fo = 1kHz. Take dc supply voltage ± 12V. Refer
Figure 6.6(a). Take R2 = 1.16 R4. Also take C = 0.05µF. Observe the output
waveform at pin 6 and capacitor waveform at pin 2 of OPAMP. Measure the
amplitude and frequency.
2. Design a phase shift oscillator to oscillate at 500 Hz. Use OPAMP instead of BJT.
Choose C=0.1µF. Take the resistance value appropriately. Adjust feedback resistor
to obtain a sine wave output. Measure the frequency of oscillator and voltage
amplitude.
3. Simulate the circuit shown in Figure 6.3(a). Use the following values: R4=100k,
R5=50k, R6=1.75k, R8=R9=5k, R2=1.8k, R1=10k, C1=C2=C4=10nF and
C6=100µF.
4. Connect the circuit shown in Figure 6.8. Use input voltage Vi=2Vpp sine wave at
1kHz. Observe the input and output waveforms.
51
5. Design a triangle wave generator of frequency 5kHz. Take β =0.5. Assume Resistance
values appropriately.
6. Obtain the transient and frequency response of an RC coupled amplifier using BJT as
shown below. Calculate the Bandwidth, Voltage Gain, Gain Bandwidth Product, Maximum
signal handling capacity.
52
Experiment No. 7: Applications of OPAMP
Objectives:
1. To simulate an inverting amplifier and non-inverting amplifier using Op-Amp.
2. To simulate and analyse various applications of Op-Amp Circuits.
Figure 7.2 (a) Input - Output waveform (peak output voltage exceeds saturation voltages)
53
Figure 7.2 (a) Gain of inverting amplifier (with OPAMP operating in linear region)
Circuit 2: Summer
54
Results:
Circuit 3: Integrator
Analysis:
1. Set transient analysis and run to time 6 ms.
2. TRACE input and output waveforms.
55
Results:
Exercise:
1. Simulate non-inverting amplifier using OPAMP (refer Figure 7.7).
2. Simulate and analyze differentiator circuit using OPAMP (refer Figure 7.7).
3. An Integrator circuit is shown below. For the input voltage shown, plot the transient
response of the output voltage for duration of 0 to 4millisec in steps of 50microsec.
56
Figure 7.9 Circuit for problem 3
4. A practical differentiator circuit is given below. For a triangular input, Plot the
transient response of the output voltage for duration of 0 to 4millisec in steps of 50
microsec.
57
Figure 7.11 Circuit for problem 4
5. Design circuit using OPAMP adder- subtractor which give the output Vo = 4V1 +
5V2 - 2V3- 3V4.
58
6. For the following precision diode rectifier, VCC= 10V, VEE= -10V, X1, X2 are
μA741 op amps, and D1, D2 are D1N4002 diode. If the input voltage is the
triangular wave as shown in figure with period of 2ms, 10Vp-p, and zero average
value, find the output voltage.
59
Experiment No. 8: Active and Passive First Order Filters
(LPF, HPF, BPF, BEF)
Objectives:
To design a first order
1. LPF to give a cut off frequency f=1kHz with pass band gain of 4. Choose
C=0.01F.
2. BPF with lower and higher cut-off frequencies 100Hz and 1kHz respectively.
3. BEF with lower and higher cut-off frequencies 1kHz and 20kHz respectively.
4. HPF to give a cut off frequency f=1MHz with pass band gain of 4.
Analysis:
1. Set AC Sweep type: Logarithmic; frequency 1 Hz to 100kHz and
points/Decade=10.
60
2. TRACE Gain in dB v/s frequency
Result:
61
Results:
Figure 8.4(a) Frequency response of LPF, HPF and BPF(Cascade of LPF and HPF)
62
Circuit 3: Band Elimination Filter
Result:
63
Circuit 4: Passive LPF
64
Figure 8.8(b) Frequency response of Passive LPF (with different values of ‘R’ values)
Exercise:
1. Design a first order low pass filter for a high cut off frequency of 2 kHz and pass
band gain of 2.
2. Given below is a second order low pass filter. Calculate the high frequency cut off
and pass band gain both theoretically and by simulation.
3. The Circuit given below is an all pass filter where Rf=R1=10kΩ; R=15.9kΩ and
C=0.01µF. Simulate the circuit and verify that the output voltage will have the same
frequency as the input, but lags the input voltage by 90°. Given ϕ = -2 tan-1(2πRC).
65
Figure 8.10 Circuit for problem 3
4. Cascade a low pass filter with higher cut off frequency 2kHz and a high pass filter
of lower cut off frequency 400Hz to give a band pass filter with pass band gain of 4.
𝑜 𝑓
Also find the value of Q of the filter. Take C=0.01F. Where 𝑄 = 𝐵𝑊 and 𝑓𝑜 =
√𝑓𝑙 𝑓ℎ (Since pass band gain is 4, the LPF and HPF section may be designed to
give gain of 2.)
66
6. A filter circuit is shown below. For the circuit, plot the frequency response of the
output voltage. The frequency is varied from 10Hz to 100MHz with an increment of
1 decade and 10 points per decade.
67
Experiment No. 9: Simulation of signal, operations on signals using
MATLAB
Now you can enter the commands and functions directly in command window.
Try some examples in the command window:
1. A = ones(R,C)
R=number or rows C=number of columns.
A=ones(3,3), A=zeros(3,3)
Study different functions like:-
2. Plot - used to plot continuous time signal
3. Subplot
4. Stem - used for plotting discrete time signals.
5. Figure
6. Title ,label, axis, linespace etc
68
Type Help <space> command in command window You will get the syntax and
explanation.
M-file editor
From file menu select NEW M-File
Edit window will appear with untitled.
Enter the program statements. Save the program with name and extension .m
Run the program either from command window or from editor window.
Experiment 9.1
Objectives :
To plot different signals a) unit impulse b) step c) sine wave d) square wave.
Theory:
Unit impulse
δ[n] =1 n=0
0 n≠0
69
Unit step:
u[n]= 1 n ≥ 0
0 n<0
b) Unit step
clc;
clear all;
close all;
n = -15:15;
u = [(n)>=0];
stem (n,u);
70
c) Sine wave
clc;
clear all;
close all;
n = 0:.001:5;
x=5*sin(2*pi*n);
plot(n,x);
d) Square wave.
clc;
t=0:.001:5;
v = square(2*pi*t);
plot(t,v);
Figure 9.8 Square wave form
Exercise:
1. Generate square wave and triangular wave of different frequency.
2. Generate Unit-step function & delayed step function with a delay of n = 5.
3. Generate Square wave with duty cycle 25,50 and 75%.(Use square function )
4. Generate the signals a) (-1/2)k b) (2)k and c) (-2)k, assuming k=0 to 5.
5. Generate a mixed frequency signal having the frequencies 10, 30 and 60Hz.
6. Write a MATLAB program to sketch the following discrete-time signals in the
time range of -10 n 10.
a) 𝑥[𝑛] = 𝑢[𝑛] − 𝑢[𝑛 − 3]
𝑛𝜋
b) 𝑥[𝑛] = sin ( 3 ) 𝑢[𝑛]
𝑗𝜋𝑛
c) 𝑥[𝑛] = (0.5)𝑛 𝑒 2
71
Experiment 9.2
Objective:
To study and find the convolution of two signals.
MATLAB CODE
clear all;
t1=-10:.01:0;
t1=t1';
g1=-2*exp(2*t1);
t2=0:.01:10;
t2=t2';
g2=2*exp(-t2);
t=[t1;t2];
g=[g1;g2];
f=[zeros(size(g1));ones(size(g2))];
subplot(3,1,1);
plot(t,f);
title('f(t)');
subplot(3,1,2);
plot(t,g);
title('g(t)');
c=0.01*conv(f,g);
t=-20:.01:5;
subplot(3,1,3);
plot(t,c(1:length(t)));
title('c(t)');
grid on;
72
Exercise:
1. Find the system output y[n], 0 n 10, of an LTI system when the input
𝑥[𝑛] = (0.8)𝑛 (𝑢[𝑛] − 𝑢[𝑛 − 5]) and
the impulse response
ℎ[𝑛] = (0.8)𝑛 (𝑢[𝑛] − 𝑢[𝑛 − 10])
Plot the vectors x, h, and y on the same page using subplot commands.
2. Find the system output y[n], 0 ≤ n ≤ 10, of an LTI system when the input x[n] =
δ[n] + 3δ[n – 1] + 4δ[n – 3], and the impulse response h[n] = (0.5)n(u[n] – u[n -5]).
Plot the vectors x, h, and y on the same page using subplot commands.
3. Generate and plot signal x[n] = 0.5𝑛 {𝑢[𝑛] − 𝑛[𝑛 − 10]}. If the impulse response
of the system is y[n] = {𝑢[𝑛] − 𝑢[𝑛 − 3]}.
5. In Figure 9.10, VS = 10V, R = 10,000 Ω, C = 10μF. Find the output voltage v0(t),
between the interval 0 to 20 ms, assuming v0(0) = 0 and by (a) using a numerical
solution to the differential equation; and (b) analytical solution.
73
Figure 9.10 Circuit for problem 5
MATLAB CODE
t0=0;
tf=20e-2; function dy=diff1(t,y)
x0=0; dy=100-10*y;
[t,v0]= ode23('diff1',[t0 tf],x0); end
subplot(2,1,1);
plot(t,v0,'b'); Type this function and save it
v0a=10*(1-exp(-10*t)); as separate M file in the name
subplot(2,1,2); diff1.m
plot (t,v0a,'r');
74
Experiment No. 10: Study of Response of System
Objective:
To Study the response of system.
impulse response
MATLAB CODE 5
clear all;
4.5
close all;
n=20; 4
2.5
1)];
y=filter(b,a,f); 2
k=0:1:n-1; 1.5
stem(k,y);
1
xlabel('n');
ylabel('x(n)'); 0.5
title('impulse 0
response'); 0 5 10 15 20
n
MATLAB CODE
clear all;
close all;
b=[1 2];
75
impulse response
2
a=[1 0.4 -0.12];
L=11;
1.5
[y,t]=impz(b,a,L);
stem(t,y);
1
xlabel('n');
ylabel('h(n)');
h(n) 0.5
title('impulse
response');
0
-0.5
-1
0 2 4 6 8 10
n
76
Output:
Enter the sequence [1 2 3 4]
Enter fft length 8
Input signal
4
0
1 1.5 2 2.5 3 3.5 4
-5
-10
1 2 3 4 5 6 7 8
n
4. Express the following Z-transform in factored form, plot its poles and zeros, and then
determine its ROCs.
77
MATLAB CODE
clear all;
close all;
b=[2 16 44 56 32];
a=[3 3 -15 18 -12];
[z p k]=tf2zp(b,a);
disp('Zeros: ');
disp(z);
disp('Poles: ');
disp(p);
disp('Gain
constant= ');
disp(k);
disp('Radius of
poles: ');
disp(abs(p));
sos=zp2sos(z,p,k);
disp('Second order
system');
disp(real(sos));
zplane(b,a); Figure 10.4 Pole Zero Plot
Outputs:
Zeros:
-4.0000 + 0.0000i
-2.0000 + 0.0000i
-1.0000 + 1.0000i
-1.0000 - 1.0000i
Poles:
-3.2361 + 0.0000i
1.2361 + 0.0000i
78
0.5000 + 0.8660i
0.5000 - 0.8660i
Gain constant=
0.6667
Radius of poles:
3.2361
1.2361
1.0000
1.0000
MATLAB CODE
clear all;
close all;
y=dsolve('Dy=1-y','y(0)=0');
disp('y=');
disp(y);
Output: y= 1- 1/exp(t)
Exercise:
1. Find inverse Z transform: X(z)=(8z3+2z2 – 5z)/(z3 – 1.75z + 0.75)
2. Find the impulse response: y(n) – 1.5y(n-1) + y(n-2) = x(n-2)
3. Find response of system: d2y/dt2+4dy/dt+13y(t)=0; dy/dt (t=0)=0; y(0)=1
79
4. Determine the UNIT impulse response h[n] of a system specified by the equation. (Use
filter function with input to the system as unit impulse δ[n])
a. 𝑦[𝑛] = 𝑦[𝑛 − 1] + 2𝑦[𝑛 − 2] + 𝑥[𝑛 − 2]
5. A simple digital differentiator is given by 𝑦[𝑛] = 𝑥[𝑛] − 𝑥[𝑛 − 1]. Implement this
differentiator on the following sequences and plot the results. Comment on the
appropriateness of this differentiator.
a. 𝑥[𝑛] = 𝑛(𝑢[𝑛] − 𝑢[𝑛 − 10]) + (20 − 𝑛)(𝑢[𝑛 − 10] − 𝑢[𝑛 − 20])
b. 𝑥 [𝑛] = 5(𝑢[𝑛] − 𝑢[𝑛 − 20])
6. Find the Discrete Fourier Transform (DFT) of a sine wave of frequency 50Hz and plot
the magnitude and phase. (Use fft function).
7. Find the DFT of mixed frequency sine wave with 30Hz, 80Hz, 120Hz frequency
components and plot the magnitude vs. frequency in Hz.
8. A causal LTI system is described by the difference equation
𝑦[𝑛] = 𝑥[𝑛] + 0.5𝑥[𝑛 − 1] − 0.5𝑦[𝑛 − 1] + 0.25𝑦[𝑛 − 2].Write MATLAB program to
determine
i) the impulse response representation
ii) the system function
iii) pole-zero plot the output y[n] if the input is 𝑥[𝑛] = 2(0.9)𝑛 𝑢[𝑛]
References
1. Muhammad H Rashid,” SPICE for Circuits and Electronics Using PSPICE”, 2nd
edition, 1996.
2. D. Roy Choudhury & Shail B. Jain,” Linear Integrated Circuits”, New Age
International Publishers , 3rd edition, 2009.
3. Ramakant A. Gayakwad, “Op.Amps and linear integrated circuit”s, PHI.
80
OBSERVATION & WORK SPACE
81