Вы находитесь на странице: 1из 81

MANIPAL INSTITUTE OF TECHNOLOGY

Manipal – 576 104

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING

CERTIFICATE

This is to certify that Ms./Mr. …………………...……………………………………

Reg. No. …..…………………… Section: ……………… Roll No: ………………... has

satisfactorily completed the lab exercises prescribed for Signals & Circuit Simulation

Lab [ECE- 2112] of Second Year B. Tech. Degree at MIT, Manipal, in the academic

year 2016-2017.

Date: ……...................................

Signature Signature
Lab in Charge Lab Coordinator

1
2
CONTENTS

EXP PAGE
TITLE REMARKS
NO. NO.

COURSE OBJECTIVES AND OUTCOMES 1


EVALUATION PLAN 1
START UP INSTRUCTIONS 2

E1 Verification of KCL & KVL 4

E2 R, L, and C circuits 10

E3 Diode and its applications 25

E4 I/O characteristics of BJT & OPAMP 32

E5 Network Theorems 37

E6 Amplifiers and Waveform generators 43

E7 Applications of OPAMP 59

E8 Active filters 67
Simulation of signal and operation using
E9 74
MATLAB.
E10 Study of system response to various inputs 83

3
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, procedures and observation table,
expected results/graphs): 12 marks
 Conduction: 12 marks
 Results and Calculations: 08 marks
 Viva-Voce: 08 marks

4
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.

5
 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)

Figure (a) Example of PWL Waveform Figure (b) PULSE Waveform


 Solution Control Statement:
DC Analysis: .DC SNAME IVAL FVAL INC
AC Analysis: .AC LIN NP FSTART FSTOP
Transient Analysis: .TRAN TSTEP TSTOP UIC

6
.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.

.TRAN statement performs a transient analysis on the circuit from time t = 0 to t =


TSTOP seconds in steps of TSTEP. Example: .TRAN 20NS 5uS.

UIC stands for use initial conditions and Used when initial charge across capacitors or
initial current through inductors not equal to zero.

Format of the output specification statements:


 .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.

 .PLOT: It is to get the output plots.

 .TF: It is the small signal transfer (used in Thevenin’s equivalent).

7
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
Follow the naming and location instruction properly
1) Create a folder with first name of student (limit name to max 7 letters) and save
in D:\student\SCS16\SecA1(SecA2 and so on)
2) Again in above folder create two folders as NET16 and SCH16
A – SCHEMATIC: Using Capture CIS
1. Open Capture CIS
startup→Allprograms→OrCAD→CaptureCIS
2. Create new project: File →new → Project → Create a new project: Select and
enter :
 Analog or Mixed A/D,
 Specify name of project as Expt number (eg. Expt 1 as E1).
 Location: in folder SCH16
{If asked then use Create a blank project worksheet appears}
3. A blank worksheet appears if not click on ‘+’ near the design→
‘+’SCHEMATIC1→PAGE1
Right click on SCHEMATIC1 rename. (eq. S1, S2….)

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 NET16
4. To simulate again open that file which was saved with .cir extension and run.

8
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.
Steps for getting active components (Diode, BJT, OPAMP..)
1. For Diode: Select part D1N4002 from Diode library.
2. Transformer: Select part XFRM_LIN/CT-SEC from ANL_MISC library.
3. Transistor: Select part Q2N22222A from transistor library.
4. Operational Amplifier: Select part U1 (μA 741C) from OPAMP library.

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).
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.

9
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

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, primary sweep (give voltage
source name (V1), and in Sweep type (i) value list and give 10 volts 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. Also select parametric sweep, global parameter, parameter name as val, and
Sweep type log: 1 to 100K, no of points per decade is 10.
5. From the TRACE Menu select ADD TRACE and select the input and output
voltage (Set X-axis in log scale) to view variation clearly.

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.

10
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.

Bias point analysis (Using for Thevenin’s Theorem)


1. PSPICE →create Netlist & setup a new simulation profile and save.
2. Analysis → edit the simulation set up → Bias point analysis -> Transfer function
(.TF). Give input voltage name as V1, and output name as voltage across R2 as
V(2,0).
3. Run and check output file. Note the value of output resistance which is
Thevenin’s resistance.

11
INTRODUCTION TO TINA

TINA Design Suite is a powerful yet affordable software package for analyzing,
designing and real-time testing of circuits with analog, digital & microcontroller
components, and components defined in various HDLs (Hardware Description
Languages) and for designing their PCB layouts. This document provides a brief
introduction of TINA. A detailed description can be found at [1].

Getting Started:
 Click TINA-TI icon on the desktop to open TINA. Figure 1 shows the default
screen that appears on opening TINA

A brief description of the different parts of the screen is described below:


1. The menu bar
2. Cursor or pointer: This is used to select commands and to edit schematics.
3. The Schematic window: This shows the circuit schematic currently being edited
or analyzed.
4. The Tool Bar: You can select most of the editor commands (e.g., select, zoom,
wire etc.,) from this toolbar.

12
5. The Component bar: Components are arranged in groups, named by the tabs on
the Component bar. Once you have selected a group, the available component
symbols appear above the tabs. When you click on the desired component (and
release the button), the cursor changes to that component symbol and you can
move it anywhere in the drawing area.
6. Find component tool: This tool helps you find by name any component in the
TINA catalog.
7. Open files tab: You can have several different circuit files or different parts
(macros) of a circuit open in the schematic editor at the same time. Clicking on a
tab brings that circuit page up in the editor.
8. The TINA Task bar: TINA’s Task bar appears at the bottom of the screen and
provides speed buttons for the various tools or T&M instruments currently in
use.
9. The Help line: The Help line, at the bottom of the screen, provides short
explanations of items pointed to by the cursor.

Placing the Circuit Components


Components are selected from the Component bar and their symbols are moved by
the mouse to the required position. After a component symbol has been selected and
positioned, you may double click on it to enable a dialog window where you can
enter parameter values and a label. TINA will automatically assign a label for each
component you place on the schematic. It will also display the numerical value of
the main component parameter (for example: R4 10k). Note that the value is shown
only if the Values option of the View menu is checked.

To place a wire, move the cursor to the component terminal point where you want to
begin. The cursor will change into a drawing pen. You can draw a wire in two
different ways:
1) Select the starting point of the wire with a left mouse click, then move the
pen with the mouse while TINA draws the wire along the path. While
drawing the wire, you can move in any direction and the wire follows. At the
end point of the wire, click the left button of the mouse again.

13
2) Hold down the left mouse button while positioning the pen; release it at the
end point.
While drawing a wire, you can delete previous sections by moving backward on the
same track. By pressing the Ctrl key while drawing you can move the last horizontal or
vertical section.

Analyses
TINA has a variety of analysis modes and options: The analysis method is analog when
a circuit contains only analog components; then the components are modeled with
their analog models.

DC Analysis: Go to Analysis-> DC Analysis. Select appropriate analysis. Eg: If we


need to plot DC transfer characteristics. Click Analysis-DC Analysis->DC Transfer
Characteristics. Select the input parameter, and specify its start and end value and a
total number of points for plot. Click OK.

AC Analysis: Go to Analysis-> AC Analysis. Select appropriate analysis.


Transient Analysis: Go to Analysis->Transient. Enter appropriate values.

Parameter stepping:
1. Select the component for which you wish to perform parameter stepping. Let’s
say R1.
2. Go to analysis->select control object. It will create a pointer (which looks like a
variable resistance) when moved in the schematic region. Using this pointer
click on R1. This will open properties windows of the object (Here R1).
3. Click on three dots (…) at the end of the parameter value to change its value.
For R1, you should click at the end of the row marked ‘resistance (ohms)’.
4. Enter appropriate start and end values of the parameter and click ok.
References

[1] TINA User Manual V9.


http://www.designsoftware.com/home/distrib/en/tina9doc/TINA_9.0_manual.pdf

14
Experiment No. 1: Verification of KCL & KVL

Objectives:
To verify Ohms law and Kirchhoff laws (KCL & KVL) using simple resistive circuits.

Figure 1.1 Circuit to verify Ohms law

Steps to draw the Schematic using TINA-TI:


Get all the components and place them in the worksheet as shown in Figure 1.1.
1. Resistance from Basic  select “Resistance” symbol
2. DC Voltage source from Sources.select “DC voltage source” symbol. To set
the value for Vdc, double click and type the values as Vdc=10.
3. Ground: go to Basic select “ground” symbol.
4. Toolbar  select “wire” symbol and connect all the components using wires as
shown in the circuit.
5. Save the schematic with relative name.

Analysis/Simulation set up:


1. Go to Meters  select “Voltage pin”
2. Go to Analysis ERC (Electric Rule Check), it will display if errors any.
3. Go to Analysis DC Analysis  Calculate nodal Voltages

15
Circuit 2: To verify KCL & KVL

Figure 1.2 Circuit to verify KVL

Figure 1.3 Circuit to verify KCL

Steps to draw the Schematic:


Get all the components and place them in the worksheet as shown in Figure 1.3.

Analysis/Simulation set up:


1. Go to Meters  select “Voltage pin”
2. Go to Meters  select “Current Arrow”
3. Go to Analysis ERC (Electric Rule Check), it will display if errors any.
4. Go to Analysis DC Analysis  Calculate nodal Voltages

16
Circuit 3: To verify KCL & KVL

Figure 1.4 Circuit to verify KVL and KCL

Analysis/Simulation set up:


1. Go to Analysis ERC (Electric Rule Check), it will display if errors any.
2. Go to Analysis DC Analysis  Table of DC results

To see the Netlist of the given Schematic:

17
1. Go to File  Export  Netlist  for Tina (.CIR) Save the File in the proper
Location  open the file.
2. The Netlist for the Circuit shown in Figure 1.4 is given as follows.

Circuit 4: To verify KCL & KVL

Figure 1.5 Circuit to verify KVL and KCL

18
Steps to draw the Schematic:
Get all the components and place them in the worksheet as shown in Figure 1.5.
Analysis/Simulation set up: Perform DC analysis and verify KVL and KCL.

Exercise:
E1.1. Verify the KVL & KCL for the AC circuit shown in Figure E1.1 and verify the
netlist.
E1.2. Find the loop current in the loop containing R2 R1 L1 and L2 shown in the loop
and voltage across 5Ω resistor for the following circuit and verify the netlist.
E1.3. Vary the value of “RLoad” from 1 to 100k ohms and plot the corresponding
volatges and currents across it.

Figure Figure E1.1

Figure E1.1 Figure E1.2

Figure E1.3

19
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

Figure 2.1 R C circuit


Steps to draw the Schematic: Get all the components and place them in the worksheet
as shown in Figure 2.1.
Analysis: Perform Transient analysis with a square wave input signal with amplitude
2Vp-p and frequency 50Hz.
Result:

Figure 2.2 Input and Output waveform of R C circuit

20
Analysis: Perform AC analysis.
Result:

Figure 2.3 Gain in dB v/s frequency


Circuit 2: R-C Circuit by varying time constant

Figure 2.4 RC circuit by varying R


Analysis: Perform Transient analysis with parameter stepping for R.
Result:

Figure 2.5 Waveform across the capacitor in R C circuit by varying R

21
Circuit 3: R C Circuit by giving a Triangular wave input

Figure 2.6 R C circuit with a Triangular wave input.


Analysis: Repeat transient analysis with Triangular wave input signal.
Result:

Figure 2.7 O/P waveform of R C circuit for a triangular wave input.


Circuit 4: Verification of coupling circuit

Figure 2.8 Coupled Circuits


22
Analysis: Perform AC analysis with Sinusoidal wave input signal.
Result:

Figure 2.9 Simulated Results

Circuit 5: Series Resonant Circuit

(a) (b)
Figure 2.10 (a) Series Resonant circuit (b) Current Vs Frequency waveform

Figure 2.11(a) Series Resonant circuit at 10kHz resonant frequency

23
Analysis: Perform AC analysis with Sinusoidal wave input signal.
Results:

Figure 2.11(b) Load current Vs frequency

Figure 2.11(c) Reactance (XL and XC) v/s frequency

Figure 2.11(d) Impedance (R+j(XL-Xc)) v/s frequency

24
Figure 2.11(e) Phase angle of series resonant circuit (tan-1((XL-XC)/R)) v/s frequency

Circuit 6: Series Resonant circuit by varying R, L and C

Figure 2.12(a) Series Resonant circuit at 10 kHz resonant frequency by varying L

Analysis: Perform AC analysis with parameter stepping with appropriate values for L.
Result:

Figure 2.12(b) Current v/s Frequency waveform by varying L

25
Figure 2.12(c) Current v/s Frequency waveform by varying C

Figure 2.12(d) Current v/s Frequency waveform by varying R

Exercise:
E2.1. Simulate and analyze the parallel resonant circuit at resonant frequency 10 kHz
given below in Figure E2.1. Obtain
a) Impedance v/s Frequency plot.
b) Current v/s frequency plot.
Susceptance v/s frequency plot
(BL= -1/(2*pi*f*L); Bc=2*pi*f*C)

Figure E2.1
c) Vary R, Land C and observe the effect in impedance v/s frequency plot.

26
E2.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.

E2.3. Determine the real power in the circuits shown in Figure E2.2. Obtain a plot of
the instantaneous voltages, currents and power.

Figure E2.2 (a) Figure E2.2 (b)


E2.4. For the parallel RLC circuit, plot voltage magnitude and phase angle over a
range of 30 to 300 Hz in increment of 1 Hz. Determine the resonant
frequency. Also draw the 0.707 V0(max) line and estimate the circuit bandwidth
and the Q-factor.
E2.5. 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 E2.3 Figure E2.4

27
Experiment No. 3: DIODE APPLICATIONS

Objective:
1. To simulate and analyze various applications of diode
Circuit 1: Half wave rectifier

Figure 3.1: Half wave rectifier circuit

Figure 3.2 Half wave rectified output waveform


Steps to draw the Circuit:

Place all the components as per the circuit shown in figure 3.1 from library which in
shown on horizontal icon of the tools. Select voltage generator and select sine wave
and set Vamp=10V, frequency=50 Hz.
Analysis:
1. Go to analysis and select transient
2. Set t=10msec
3. OK

28
Results: The simulation setting for the circuit is as shown in Figure 3.2.

Figure 3.3: Amplitude of secondary input voltage for HWR set to (a) 23V (b) 1V

Figure 3.4 I/O waveforms of HWR for Vm=23V and Vm=1V

Circuit 2: Full wave rectifier

Figure 3.5: Circuit diagram of a center tapped FWR

29
Figure 3.6: waveform at different nodes of a center tapped Full wave rectifier
Steps to draw the Circuit:
Place all the components as per the circuit shown in figure 3.5 from library which in
shown on horizontal icon of the tools. Select voltage generator and select sine wave
and set Vamp=1V, frequency=50 Hz. Linear transformer with center tape with
coupling coefficient 0.113.

Analysis: Go to analysis and select transient. Set t=100msec.


Results: The simulation setting for the circuit is as shown in Figure 3.6.

Circuit 3: Full Wave rectifier without using transformer

Figure 3.7 Circuit diagram of FWR with sources

30
Results: The simulation setting for the circuit is as shown in Figure 3.8.

Figure 3.8:I/O of FWR with separated curves

Exercise:
E3.1. Simulate Bridge rectifier using 4 diodes
E3.2. Simulate centre tapped and Bridge rectifiers using C type filters.
E3.3. Simulate clipper circuits (positive, negative and both level)
E3.4. Simulate half wave rectifier with C filter.

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.

Circuit 1: Transistor in CE configuration

Figure 4.1 Circuit diagram for CE configuration.


Steps to draw the Schematic:
Get all components and place and wire as shown in Figure 4.1.
Analysis:
Plot DC transfer characteristics (Output V-I characteristics) using parameter
stepping for appropriate voltages/current.
Results: The simulated waveform for the circuit above is as shown in Figure 4.2.

Figure 4.2 Output V-I characteristics of CE configuration.


32
Circuit 2: OPAMP Transfer Characteristics

Figure 4.3 OPAMP basic circuit to plot the transfer characteristic


Note: It is implied that the necessary bias voltages are to be given to the Op.Amps.

Steps to draw the Schematic:


Get all components and place and wire as shown in Figure 4.3.

Analysis: Perform DC analysis to plot the transfer characteristics of the opamp.


Results:

Figure 4.4 Simulated Waveform


Note: In the transfer characteristic curve of OPAMP, calculate Ad. Calculation :-
(Ad=Vout/V1). It should be in the range of 10^6.

Exercise:
E4.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.

33
E4.2. Build the circuit as shown in Figure E4.1. Calculate the I/P impedance. Provide
necessary bias voltage for OPAMP.

Figure E4.1
E4.3. Build the circuit a shown in Figure E4.2. Apply Vin = 1Vpp sine waveform at 1
KHz. Vary frequency from 100 Hz to 3 MHz and measure Vout. Plot a
logarithmic graph for frequency response. What is your bandwidth?
E4.4. Obtain the characteristics of a transistor in CB configuration.
E4.5. For a square wave input of amplitude 5V, verify the working of BJT as an
inverter in Figure E4.3.

Figure E4.2 Figure E4.3

34
Experiment No. 5: Network Theorems

Objectives:
To verify the circuit theorems-Thevenin’s, Norton’s, Maximum Power Transfer,
Superposition Theorem.

Circuit 1 & 2:

Figure 5.1: Circuit Diagram Figure 5.2: Thevenin’s equivalent Circuit

Steps to draw the Schematic and Analysis:


1. Find the voltage at node 2 in Fig 5.2(Open circuit voltage across load).
2. Perform Bias Point analysis and find the value of output resistance

Circuit 3:

Figure 5.3 Circuit Diagram to verify Norton’s theorem


Steps to do the Analysis:
1. Draw the circuit and give value of Load as 1f .
2. Do DC Analysis-Find the current through load resistor(Nortons current).

35
Circuit 4:

Figure 5.4 Circuit Diagram to verify maximum power transfer theorem

Steps to draw the Schematic and Analysis:


1. Place all circuit components, vary load resistance and plot power vs load
characteristics.

Results:

Figure 5.5 Power transferred to Load v/s Load resistance (‘val’)

36
Circuit 5:

Figure 5.6 Circuit to verify superposition theorem

Note: Unit ‘V’ in x-axis is unit of variable. In Figure 5.5 variable ‘val’ represents load ‘V’ is
considered as ‘Ω’
Steps
1) Perform DC Analysis, Measure current in each branch.
2) Deactivate each source one by one and note down the currents and verify the
theorem.

Circuit 6:

Figure 5.7(a) Circuit to verify Reciprocity Theorem

37
Circuit 7:

Figure 5.7(b) Circuit to verify Reciprocity Theorem


Steps:
1) Perform DC analysis and measure the current through resistor R5.
2) Do the DC analysis for the second circuit and measure current through R1.

Exercise:
E5.1. Calculate Iab and Vcg using superposition theorem for circuit shown in Figure E5.1
E5.2. Verify the Thevenin’s, Norton’s andMaximum Power Transfer Theorem for
circuit shown in Figure E5.2
E5.3. In the following figure E5.3, 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.
E5.4. Find the Thevenin's equivalent of circuit shown in Figure E5.4.
E5.5. Verify the maximum power transfer theorem for the circuit given in Figure E5.5

Figure E5.1 Figure E5.2

38
Figure E5.3 Figure E5.4

Figure E5.5

39
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

40
VCC
V R2 and RB = R1 ‖ R2
R1  R2
VCC RB
V
R1
R1 = 18.59kΩ ≈ 22kΩ (std) and R2 = 3.57kΩ = 3.3kΩ (std)

5. Selection of Coupling Capacitor


Let reactance of CC is one tenth of input resistance Ri.

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

6. Selection of emitter bypass capacitor CE:


R'
1
Let fL = 200Hz, fL = R
2R E C E

Where R'  hFE RE = 124kΩ


R  hie = 2.2kΩ , CE = 73.63µF
CE = 100µF.

1. Without feedback (CE connected):

Steps to draw the Schematic:


1. Draw the circuit as shown in Figure 6.1, set the amplitude as 1mV and phase = 0.

Analysis:
1. Set AC simulation as ‘Logarithmic’ in the range of 1Hz to 10GHz with 10 points.
2. Measure bandwidth.

41
Figure 6.1(a) Schematic circuit diagram of amplifier using BJT without feedback

Result:

Figure 6.1(b) Frequency response of amplifier using BJT without feedback

42
2. With feedback (CE not connected):

Figure 6.2(a) Schematic circuit diagram of amplifier using BJT with feedback

Result:

Figure 6.2(b) Frequency response of amplifier using BJT with feedback

Objective: To generate the sinusoidal signal of desired frequency using BJT


1
Design 2: The Frequency in Hz is given by 𝑓 = 2𝜋𝑅𝐶√2𝑁, , where R is the Resistance in
Ohms, C is the Capacitance in Farad, and N is the number of RC stages (N = 3). The
RC combination in the Oscillator circuit acts as an attenuator producing an
attenuation of 1/29th (Vo/Vi) per stage, the gain of the amplifier must be sufficient
to overcome the losses and must be greater than 29.

43
Steps to draw the Schematic:
1. Draw the circuit as in Figure 6.3 (a).

Figure 6.3(a) Schematic circuit diagram of Oscillator using BJT( RC oscillator)

Analysis:
1. Set Transient analysis and run time to 160msec and run.
2. Observe the outputs as shown in Figure 6.3(b).
3. Measure frequency by calculating time period using cursor in Figure 6.3(b).

Result:

Figure 6.3(b) voltage waveforms of RC phase oscillator using BJT

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

44
Steps to draw the Schematic:
1. Draw circuit as shown in Figure 6.4(a)

Analysis:
1. Set AC simulation as ‘Logarithmic’ in the range of 10Hz to 100 kHz with 100
points.
2. Observe the output voltage and input voltage using transient analysis as shown
in Figure 6.4(b) and Figure 6.4(c).

Figure 6.4(a) Schematic circuit diagram of amplifier using OPAMP (UA741)

Results:

Figure 6.4(b) Gain v/s frequency of amplifier using OPAMP (UA741) (Gain Plot)

45
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

Figure 6.5(a) Schematic circuit diagram of osclilator (Hartely)

Analysis:
1. Set Transient Analysis and run to 20msec. Observe the output as shown in
Figure 6.5(b).
46
2. Measure frequency by using cursor in Figure 6.5(b).

Result:

Figure 6.5(b) output voltage waveform of Hartely osscilator

Objective: Design a suitable circuit to generate square wave using OPAMP for a
desired frequency and duty cycle.

𝟏 𝟏+𝜷 𝑹𝟒
Design 5: = 𝑻 = 𝟐𝑹𝑪 𝒍𝒏 𝟏−𝜷 Where 𝜷=𝑹
𝒇 𝟒 +𝑹𝟐

Steps to draw the Schematic:


Draw circuit as in Figure 6.5(a) Vcc=+/- 12V.

Analysis:
1. Set Transient analysis, run for 100msec.
2. Observe the output as in Figure 6.6(b).

47
Figure 6.6(a) Schematic diagram of square wave generator
Result:

Figure 6.6(b) Output waveform of square wave generator

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: Draw circuit as shown circuit in Figure 6.7 (a).
Analysis:
1. Set Transient Analysis and run for 5msec.
2. Observe the output voltages of each of the OPAMP and verify results are shown
in Figure 6.7(b).
48
Figure 6.7(a) Schematic diagram of Triangular wave generator
Result:

Figure 6.7(b) output eaveform of Triangular wave generator

Exercise:

E6.1. Design a square wave generator for fo = 1kHz. Take dc supply voltage ± 12V.
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.
49
E6.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.
E6.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.
E6.4. Connect the circuit shown in Figure E6.1. Use input voltage Vi=2Vpp sine wave
at 1kHz. Observe the input and output waveforms. (Note: This circuit is referred
as Schmitt trigger.)
E6.5. Design a triangle wave generator of frequency 5kHz. Take β =0.5. Assume
Resistance values appropriately.
E6.6. Obtain the transient and frequency response of an RC coupled amplifier using
BJT as shown in Figure E6.2. Calculate the Bandwidth, Voltage Gain, Gain
Bandwidth Product, Maximum signal handling capacity.

Figure E6.1 Figure E6.2

50
Experiment No. 7: Applications of OPAMP

Objectives:
1. To simulate an inverting amplifier and non-inverting amplifier using Op-Amp.
2. To simulate and analyze various applications of Op-Amp Circuits.

Circuit 1: Inverting amplifier

Figure 7.1 Inverting amplifier


Steps to draw the Schematic:
1. Draw circuit as shown in Figure 7.1.
2. Give a sinusoidal input signal with amplitude 2Vp-p and frequency 50Hz.
Analysis:
1. Perform a Transient analysis, run for 50ms.
2. Analyse the input and output waveforms and calculate the gain as shown in
Figure 7.2.
3. Repeat the analysis by increasing the gain to 20 and observe the output.
4. Obtain frequency response by performing AC analysis as shown in Figure 7.3.
5. Calculate the bandwidth of this response by finding the 3dB frequency
(Use cursor option in the tool bar).

51
Results:

Figure 7.2 Input - Output waveforms for the Inverting amplifier.

Figure 7.3 Frequency response for OPAMP inverting amplifier

Circuit 2: OPAMP Adder


Steps to draw the Schematic:
1. Draw circuit as shown circuit in Figure 7.4.
2. Give two DC inputs with V1=5V and V2=3V.
Analysis:
1. Set transient analysis, run for 1sec.
2. Observe the input output waveforms.

52
Figure 7.4 OPAMP Adder circuit

Results:

Figure 7.5 Input-Output waveform for OPAMP Adder.

53
Circuit 3: Integrator

Figure 7.6 OPAMP Integrator


Steps to draw the Schematic:
1. Draw circuit as shown in Figure 7.6.
2. Give a square wave input with amplitude 2Vp-p and frequency 100Hz.
Analysis:
1. Use Transient analysis and run to time 100ms.
2. Obtain the input and output waveforms as shown in Figure 7.7.
3. Repeat the analysis by varying the value of the capacitor.
4. Repeat the analysis by using a square wave with nonzero rise time and fall time.
(Use the General Waveform option in voltage generator.)

Results:

Figure 7.7 Input - Output Waveforms for Integrator.

54
Exercise:
E7.1. Perform the transient and AC analysis for a non-inverting amplifier using
OPAMP with gain 5. Give a sinusoidal input signal with amplitude 2Vp-p and
frequency 50Hz. Repeat the analysis by considering a square wave input with
amplitude 2Vp-p and frequency 100KHz. Observe the effect of slew rate.

E7.2. Simulate and analyse the OPAMP differentiator circuit as given in Figure E7.1.
a) Consider a square wave with amplitude 2Vp-p and frequency 100Hz as input.
b) Consider a sine wave with amplitude 4Vp-p and frequency 1 KHz as input.

Figure E7.1

E7.3. An Integrator circuit is shown in Figure E7.2.


a) For the input voltage shown in Figure E7.3 obtain the output voltage by
performing the transient analysis.
b) Repeat the analysis by considering a sinusoidal input signal with amplitude
4Vp-p and frequency 5 KHz.
c) Obtain the frequency response of this circuit and find the bandwidth.

55
Figure E7.2

Figure E7.3

E7.4. A practical differentiator circuit is given in Figure E7.4.


a) For a triangular input as in Figure E7.5, perform the transient response to get
the output voltage.
b) Repeat the analysis for an input as shown in Figure E7.6. (Note: This input
waveform can be obtained by using Piecewise linear model in the voltage
generator.)

56
Figure E7.4

Figure E7.5

Figure E7.6

57
E7.5. Design a circuit using OPAMP to obtain an output Vo = 4V1 + 5V2 - 2V3- 3V4,
Where V1, V2, V3 and V4 are DC input voltages.

E7.6. Implement a 4 bit Digital to Analog Converter (DAC) circuit using OPAMP.

E7.7. For the circuit shown in Figure E7.8, the Voltage Generator (VG1) produces a
triangular wave with amplitude 2Vp-p and frequency 50Hz. Output of this
voltage generator is connected to a DC supply with VDC=1V. Simulate the
circuit and plot the waveforms at pins VG1, Vin and Vout.

Figure E7.8

E7.8. Simulate the precision rectifier circuit as shown in Figure E7.9.


a) Obtain the output waveform for a sinusoidal input with amplitude 2Vp-p and
Frequency 1 KHz.
b) Repeat the analysis by considering the waveform in Figure E7.10 as input.

58
Figure E7.9

Figure E7.10

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=2 kHz with pass band gain of 2. Choose
C=0.01F.
2. HPF to give a cut off frequency f=2 KHz with pass band gain of 2.
3. BPF with lower and higher cut-off frequencies 2kHz and 400Hz respectively&
with pass band gain of 4
4. BEF with lower and higher cut-off frequencies 1 kHz and 20 kHz respectively.

Circuit 1: Low Pass Filter

Figure 8.1 LPF Circuit

60
Steps to draw the Schematic:
1. Draw circuit as shown in Figure 8.1.
2. Set AC Voltage sources Vamp=1V, Frequency=50Hz (By default the values are
selected)

Result:

Figure 8.2 Frequency response of LPF Filter

Circuit 2: High Pass Filter

61
Figure 8.3 HPF Filter
Result:

Figure 8.4 Frequency response of HPF Filter

62
Circuit 2: Band Pass Filter

Figure 8.5 BPF circuit


Results:

63
Figure 8.6 Frequency response of BPF

Circuit 3: Band Elimination Filter

Figure 8.7 BEF circuit

64
Result:

Figure 8.8 Frequency response of BRF

Exercises

E8.1. Design a first order low pass filter for a high cut off frequency of 2 kHz and pass
band gain of 2.
E8.2. Given below is a second order low pass filter (Figure E8.1). Calculate the high
frequency cut off and pass band gain both theoretically and by simulation.
E8.3. The Circuit given in Figure E8.2 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).
E8.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.01F. Where 𝑄 = 𝐵𝑊 and

65
𝑓𝑜 = √𝑓𝑙 𝑓ℎ (Since pass band gain is 4, the LPF and HPF section may be designed
to give gain of 2.)

E8.5. Figure E8.2

E8.6. Figure E8.1


E8.7. Connect the circuit as shown in Figure E8.3 using discrete components.
a. Given an input signal of 1V peak to peak and measure the output voltage for
different frequencies.(eg. 100Hz, 200Hz, 500Hz, 1kHz, 1.5kHz, 2kHz, 5kHz,
10kHz).
b. Plot the frequency response 20 log(Vo/Vi) versus input frequency and find the
3dB frequency from here.
c. Calculate theoretically and by simulation the upper cut off frequency and pass
band gain. Interchange the resistor R with the capacitor C to make the high pass
filter and repeat steps a, b, and c.
66
Figure E8.3
E8.8. A filter circuit is shown in Figure E8.4.. 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.

Figure E8.4

67
EXP NO: E9

INTRODUCTION TO MATLAB
MATLAB is an interactive, matrix based system for numeric computation and
visualisation. It is a powerful tool in the sense that is is simple and also can be extended
to create new commands and functions.

How to start matlab?


Click on start programs MATLAB 7.0.4
Command window will get opened

Figure 9.1 Command Window

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)

68
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

Type Help <space> command in command window You will get the syntax and
explanation.
If you want to write a code and save it you can use M file
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.

Figure 9.2 Editor Window

69
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

Figure 9.3 Delta Function

Unit step

u[n]= 1 n ≥ 0

0 n<0

Figure 9.4 Unit Step Function

70
MATLAB CODE

a) Unit impulse
clc;
clear all;
close all;
n = -15:15; Figure 9.5 delta Function
u = [(n)==0];
stem (n,u);

b) Unit step
clc;
clear all;
close all;
n = -15:15;
u = [(n)>=0]; Figure 9.6 Unit Step Function
stem (n,u);

c) Sine wave
clc;
clear all;
close all;
n = 0:.001:5;
x=5*sin(2*pi*n); Figure 9.7 Sine wave form
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
71
Exercise:
E9.1.1. Generate square wave and triangular wave of different frequency
E9.1.2. Generate and plot Unit-step function and delayed step function with a delay of
n = 5.
E9.1.3. Generate and plot Square wave with duty cycle 25,50 and 75%.(Use square
function )
E9.1.4. Generate and plot the signals a) (-1/2)k b) (2)k and c) (-2)k, assuming k=0 to
5
E9.1.5. Generate and plot a mixed frequency signal having the frequencies 10, 30 and
60Hz.
E9.1.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

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';

72
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;

Figure 9.8 Convolution Result

Exercise:

E9.2.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])

73
Plot the vectors x, h, and y on the same page using subplot commands.

E9.2.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.

E9.2.3. Generate and plot signal x[n] = 0.5𝑛 {𝑢[𝑛] − 𝑛[𝑛 − 10]}. If the impulse
response of the system is y[n] = {𝑢[𝑛] − 𝑢[𝑛 − 3]}

EXPERIMENT 9.3
Objective:
Circuit Analysis using MATLAB

1. Do Loop Analysis and find current in R2 using MATLAB

Figure 9.9 Circuit for analysis

Ans: 0.037 AMPERS

Hint: write loop equations;use inv function.

2. 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.

74
MATLAB CODE
t0=0;
tf=20e-2;
x0=0;
[t,v0]= ode23('diff1',[t0 tf],x0); function dy=diff1(t,y)
subplot(2,1,1); dy=100-10*y;
plot(t,v0,'b'); end
v0a=10*(1-exp(-10*t));
subplot(2,1,2);
plot (t,v0a,'r');
Type this function and save it as
separate M file in the name
diff1.m

Figure 9.10 Circuit for problem 2

75
EXP NO 10: STUDY OF SYSTEM RESPONSE TO VARIOUS
INPUTS
Objective:
To Study the response of system

1. To find the impulse response of a system defined by difference equation

y(n)-0.6y(n-1)-0.16y(n-2)=5x(n)

MATLAB CODE

clear all;
close all;
n=20;
b=[5 0 0];
a=[1,-0.6,-0.16];
f=[1,zeros(1,n-1)];
y=filter(b,a,f);
k=0:1:n-1;
stem(k,y);
xlabel('n');

ylabel('x(n)'); Figure 10.1 Impulse response

title('impulse response');

2. To find the impulse response of a system. The Z-Transform is given by

H(z) = (1+2z^-1) / (1-0.2z^-1)(1+0.6z^-1)


MATLAB CODE

clear all;
close all;
b=[1 2];

76
a=[1 0.4 -0.12];
L=11;
[y,t]=impz(b,a,L);
stem(t,y);
xlabel('n');
ylabel('h(n)');
title('impulse response');

Figure 10.2 Impulse response

3. To study the Fast Fourier Transform and its properties.

MATLAB CODE

clear all;
close all;
x=input('Enter the sequence');
N=input('Enter fft length');
X=fft(x,N);
subplot(2,1,1);
stem(x);
xlabel('n');
ylabel('x');
title('Input Signal');
subplot(2,1,2);
% n=0:1:7;
stem(X);
title('FFT of the signal');

Output:
Enter the sequence [1 2 3 4]
Enter fft length 8

77
Figure 10.3 FFT of the signal

4. Express the following Z-transform in factored form, plot its poles and zeros, and then
determine its ROCs.

H(z) = (2z^4+16z^3+44z^2+56z+32) / (3z^4+3x^3-15z^2+18z-12)


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); Figure 10.4 Pole Zero Plot

78
disp('Second order system');
disp(real(sos));
zplane(b,a);

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
0.5000 + 0.8660i
0.5000 - 0.8660i

Gain constant=
0.6667

Radius of poles:
3.2361
1.2361
1.0000
1.0000

Second order system


0.6667 4.0000 5.3333 1.0000 2.0000 -4.0000
1.0000 2.0000 2.0000 1.0000 -1.0000 1.0000

5. Find the response of the system defined by the differential equation


𝑑𝑦
+ 𝑦(𝑡) = 1
𝑑𝑡
with 0 initial conditions.

79
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:

E10.1. Find inverse Z transform: X(z)=(8z3+2z2 – 5z)/(z3 – 1.75z + 0.75)


E10.2. Find the impulse response: y(n) – 1.5y(n-1) + y(n-2) = x(n-2)
E10.3. Find response of system: d2y/dt2+4dy/dt+13y(t)=0; dy/dt (t=0)=0; y(0)=1
E10.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])
E10.5. y[n] = y[n − 1] + 2y[n − 2] + x[n − 2]
E10.6. A simple digital differentiator is given by y[n] = x[n] − x[n − 1]. Implement
this differentiator on the following sequences and plot the results. Comment on
the appropriateness of this differentiator.
E10.7. x[n] = n(u[n] − u[n − 10]) + (20 − n)(u[n − 10] − u[n − 20])
E10.8. x[n] = 5(u[n] − u[n − 20])
E10.9. Find the Discrete Fourier Transform (DFT) of a sine wave of frequency 50Hz
and plot the magnitude and phase. (Use fft function).
E10.10. Find the DFT of mixed frequency sine wave with 30Hz, 80Hz, 120Hz
frequency components and plot the magnitude vs. frequency in Hz.
E10.11. A causal LTI system is described by the difference equation
E10.12. y[n] = x[n] + 0.5x[n − 1] − 0.5y[n − 1] + 0.25y[n − 2].Write MATLAB
program to determine
80
i) the impulse response representation
ii) the system function
iii) pole-zero plot the output y[n] if the input is 𝑥[𝑛] = 2(0.9)𝑛 𝑢[𝑛].

81

Вам также может понравиться