0% found this document useful (0 votes)
8 views

B20EN0502 Signals and Systems Lab Manual Final to Print

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

B20EN0502 Signals and Systems Lab Manual Final to Print

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 74

School of Electronics and

Communication Engineering
Program : B.Tech. in ECE
Signals and Systems(I) Lab

LABORATORY MANUAL

20EN0502

V Semester

2020-24

Rukmini Educational
Charitable Trust www.reva.edu.in
Vision of the University
‘’REVA University aspires to become an innovative university by developing excellent human
resources with leadership qualities, ethical and moral values, research culture and innovative skills
through higher education of global standards”

Mission of the University


• To create excellent infrastructure facilities and state-of-the-art laboratories and incubation
centres
• To provide student-centric learning environment through innovative pedagogy and education
reforms
• To encourage research and entrepreneurship through collaborations and extension activities
• To promote industry-institute partnerships and share knowledge for innovation and
development
• To organize society development programs for knowledge enhancement in thrust areas
• To enhance leadership qualities among the youth and enrich personality traits, promote
patriotism and moral values.

Vision of the School


The School of Electronics and Communication Engineering is envisioned to be a leading centre
of higher learning with academic excellence in the field of electronics and communication engineering
blended by research and innovation in tune with changing technological and cultural challenges
supported with leadership qualities, ethical and moral values.

Mission of the School


• Establish a unique learning environment to enable the students to face the challenges in the
field of Electronics and Communication Engineering and explore multidisciplinary which serve
the societal requirements.
• Create state-of-the-art laboratories, resources, and exposure to the current industrial trends
to enable students to develop skills for solving complex technological problems of current
times and provide a framework for promoting collaborative and multidisciplinary activities.
• Promote the establishment of Centres of Excellence in niche technology areas to nurture the
spirit of innovation and creativity among faculty and students.
• Offer ethical and moral value-based education by promoting activities which inculcate the
leadership qualities, patriotism and set high benchmarks to serve the society

Program Educational Objectives (PEOs)

The Program Educational Objectives of B. Tech in B.Tech in ECE/ ECM Engineering are as
follows:

PEO -1: To have successful professional careers in industry, government, academia, and military as
innovative engineers.
PEO -2: To successfully solve engineering problems associated with the lifecycle of B.Tech in
ECE/ ECM Engineering Systems either leading a team or as a team member.
PEO -3: To continue to learn and advance their careers through activities such as participation in
professional organizations, attainment of professional certification for lifelong
learning and seeking higher education.
PEO -4: To be active members ready to serve the society locally and internationally and will undertake
entrepreneurship for the growth of economy and to generate employment.
Program Outcomes (POs)

On successful completion of the program, the graduates of B. Tech. in ECE/ ECM Engineering
program will be able to:

 PO-1: Engineering knowledge: Apply the knowledge of mathematics, science, engineering


fundamentals for the solution of complex problems in B.Tech in ECE/ ECM Engineering.
 PO-2: Problem analysis: Identify, formulate, research literature, and analyze engineering
problems to arrive at substantiated conclusions using first principles of mathematics, natural,
and engineering sciences.
 PO-3: Design/development of solutions: Design solutions for complex engineering problems
and design system components, processes to meet the specifications with consideration for
the public health and safety, and the cultural, societal, and environmental considerations.
 PO-4: Conduct investigations of complex problems: Use research-based knowledge
including design of experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.
 PO-5: Modern tool usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modeling to complex engineering
activities with an understanding of the limitations.
 PO-6: The engineer and society: Apply reasoning informed by the contextual knowledge to
assess societal, health, safety, legal, and cultural issues and the consequent responsibilities
relevant to the professional engineering practice.
 PO-7: Environment and sustainability: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate the knowledge
of, and need for sustainable development.
 PO-8: Ethics: Apply ethical principles and commit to professional ethics and responsibilities
and norms of the engineering practice.
 PO-9: Individual and team work: Function effectively as an individual, and as a member or
leader in teams, and in multidisciplinary settings.
 PO-10: Communication: Communicate effectively with the engineering community and with
society at large. Be able to comprehend and write effective reports documentation. Make
effective presentations, and give and receive clear instructions.
 PO-11: Project management and finance: Demonstrate knowledge and understanding of
engineering and management principles and apply these to one’s own work, as a member and
leader in a team. Manage projects in multidisciplinary environments.
 PO-12: Life-long learning: Recognize the need for, and have the preparation and ability to
engage in independent and life-long learning in the broadest context of technological change.
REVA University School of ECE

Course Signals and Systems Course Type HC Integrated


Title
Course Code B20EN0502 Credits 4 Class V Semester
Contact
Work Load Total Number
LTP Credits Hours
of
Lecture 3 3 3 Assessment
Classes
in Weightage
Tutorial - - - Per Semester

Practice 1 2 2
- - - - Theory Practical IA SEE

Total 4 5 5 42 28 50% 50%

COURSE OVERVIEW:
The course covers the fundamentals of signal and system analysis tackling both continuous-time (CT) and discrete-time (DT)
systems. The course provides the necessary background needed for understanding analog and digital signal processing, automatic
control, analog and digital communications, and probability and random processes. The course focuses on the study of linear time-
invariant (LTI) systems and their analysis in the time domain or in the frequency domain. Fourier analysis in the course includes
Fourier series for periodic continuous-time signals, the continuous-time Fourier transform (CTFT) and the discrete-time Fourier
transform (DTFT). In addition the course includes a chapter on Z transform.

COURSE OBJECTIVES:
The objectives of this course are :
1. Provide insight into fundamentals of Continuous and Discrete-time signals and systems, their properties and representations.
2. Introduce time domain representation of Linear Time invariant Systems such as Convolution Sum, Convolution Integral.
3. Provide understanding of signal representation in Fourier domain such as Fourier Series, Fourier transform, discrete
time Fourier transform.
4. Provide insights into applications of Fourier transform and brief understanding of signal representation in Z-domain.

COURSE OUTCOMES(COs)
On successful completion of this course; the student shall be able to:

CO# Course Outcomes POs PSOs

Illustrate the operations on Signals and summarize the properties of Systems. 1,2,3,4,5,9,10 1,2
CO1

Apply Convolution operation on an LTI System to calculate the output. 1,2,3,4,5,9,10 1,2
CO2
Represent the continuous and Discrete time periodic signals in frequency domain 1,2,3,4,5,9,10
CO3 and calculate the Fourier Coefficients 1,2,3

Represent the continuous and Discrete time Aperiodic signals in frequency domain 1,2,3,4,5,9,10
CO4 and interpret the Frequency Spectrum 1,2,3

Analyze the stability of Discrete time system by applying Z-transform. 1,2,3,4,5,9,10 1,2,3
CO5
Represent the discrete time system in Z-domain and determine the behavior of 1,2,3,4,5,9,10
CO6 Causal LTI system using properties of Z-Transform. 1,2,3

Signals and Systems Lab Manual - B20EN0502 Sem:V P age |1


REVA University School of ECE

BLOOM LEVEL OF THE COURSE OUTCOMES

Bloom s Level
Remember Understand Apply Analyze Evaluate Create
CO# (L1) (L2) (L3) (L4) (L5) (L6)
CO1
CO2
CO3
CO4
CO5
CO6

COURSE ARTICULATION MATRIX

PSO1

PSO2

PSO3
PO10

PO11

PO12
PO1

PO2

PO3

PO4

PO5

PO6

PO7

PO8

PO9
CO#/
POs

CO1 3 2 1 1 2 2 2 2 3

CO2 3 3 2 1 2 2 2 2 3

CO3 3 2 1 1 2 2 2 2 3

CO4 3 3 1 1 2 2 2 2 3

CO5 3 3 2 1 2 2 2 2 3

CO6 3 2 1 1 2 2 2 2 3

Note:1-Low,2-Medium,3-High
COURSE CONTENT
THEORY:
Contents

UNIT - 1
Introduction to Signals and Systems
Definitions of signals and systems, Elementary signals, Basic operations on signals, Classification of signals, Properties of
systems, Numerical on each topic.

UNIT - 2
Analysis of Linear Time Invariant Systems and Fourier Series
Time domain representation of LTI systems, Impulse response representation, Types of Convolution: Convolution Sum and
Integral, Fourier Representation of Periodic Signals: Analysis using CTFS and DTFS of basic signals.
Numerical on each topic.
UNIT - 3
Fourier Transform and its applications
FT representation of CT signals Definition of FT, FT of standard CT signals, Properties and their significance,
Inverse FT, Solvingdifferential equations using FT.
FT representation of DT signals-Definition of DTFT, DTFT of standard DT signals, Properties and their significance.
Numerical on each topic.

Signals and Systems Lab Manual - B20EN0502 Sem:V P age |2


REVA University School of ECE

UNIT - 4
Z-Transforms and its applications
Z -Transforms: Definition, Properties of Z transform, ROC, Inversion of Z transforms, transform analysis of LTI Systems.Z-
Transforms and its application to solve difference equations. Numerical on each topic.

PRACTICE SESSION:

Sl. Name of the Practice Session Tools and Expected Skill


No. Techniques /Ability
a) Generation and Plotting of Simulation of Mathematical Model Program synthesis, Debugging,
Sine Waves in Octave or MATLAB scripting. Simulation and Verification
1.
b) Generation and Plotting of
Elementary Signals
Perform Operations on Simulation of Mathematical Model Program synthesis, Debugging,
2.
Dependent Variable of a Signal. in Octave or MATLAB scripting. Simulation and Verification
Perform Operations on Simulation of Mathematical Model Program synthesis, Debugging,
3.
Independent Variable of a Signal. in Octave or MATLAB scripting. Simulation and Verification
To Calculate Signal Power and Simulation of Mathematical Model Program synthesis, Debugging,
4. Signal Energy in Octave or MATLAB scripting. Simulation and Verification

To Compute the Linear Simulation of Mathematical Model Program synthesis, Debugging,


Convolution of The Given Input in Octave or MATLAB scripting. Simulation and Verification
5. Sequence x(n) & The Impulse
Response of The System h(n).
(Causal Sequences)
To Compute the Linear Simulation of Mathematical Model Program synthesis, Debugging,
Convolution of The Given Input in Octave or MATLAB scripting. Simulation and Verification
6. Sequence x(n) & The Impulse
Response of The System h(n).
(Non-Causal Sequences)
Solve Any Given Difference Simulation of Mathematical Model Program synthesis,
7. Equation of An LTI System in Octave or MATLAB scripting. Debugging,Simulation
Without and Verification
Initial Conditions.
Solve Any Given Difference Simulation of Mathematical Model Program synthesis, Debugging,
8. Equation of An LTI System with in Octave or MATLAB scripting. Simulation and Verification
Initial Conditions.
a) Fourier synthesis of square Simulation of Mathematical Model Program synthesis, Debugging,
wave in MATLAB in Octave or MATLAB scripting. Simulation and Verification
9. b) Fourier synthesis of a triangular
wave in MATLAB

Demonstration of Sampling Simulation of Mathematical Model Program synthesis, Debugging,


10
Theorem. in Octave or MATLAB scripting. Simulation and Verification
To Compute the Linear Simulation of Mathematical Model Program synthesis, Debugging,
Convolution of The Given Input in Octave or MATLAB scripting. Simulation and Verification
11 Sequence x(n) & The Impulse
Response of The System h(n) using
TMS320C6713 Kit.
Solve Any Given Difference Simulation of Mathematical Model Program synthesis, Debugging,
12 Equation of An LTI System in CCS Studio. Simulation and Verification
Without Dumping and Verification of
Initial Conditions Using

Signals and Systems Lab Manual - B20EN0502 Sem:V P age |3


REVA University School of ECE

TMS320C6713 Kit. Simulated code in TMS320C6713


Kit.
Demonstration of Sampling Simulation of Mathematical Model Program synthesis, Debugging,
13
Theorem. in Octave or MATLAB scripting. Simulation and Verification

TEXT BOOKS:
1. Simon Haykin India Pvt Ltd, Second Edition, 2018.
2. S Palani, “Signals and Systems”,Springer International Publishing AG, Second Edition, 2021.
3. I J Nagrath, “Signals and Systems”, Tata McGraw Hill, 3rd edition, 2010.

REFERENCE BOOK:
1. Michael Rober
2. Allan V. Oppenheim, S. Wilsky and S.H Nawab, “Signals and Systems”, Pearson Education, Second Edition, 2019.
3. Benoit Boulet, “Fundamentals of Signals and Systems”, Da Vinci Engineering Press, 2nd edition, 2006.

JOURNALS/MAGAZINES/ ADDITIONAL SOURCES:


1. https://ieeexplore.ieee.org/abstract/document/9244176
2. https://ocw.mit.edu/resources/res-6-007-signals-and-systems-spring-2011/lecture-notes/
3. https://www.khanacademy.org/science/electrical-engineering/ee-signals
4. http://bonnie.ece.gatech.edu/book/TUTORIAL/tutorial.html
5. https://stanford.edu/~boyd/ee102
6. https://www.springer.com/journal/34
7. https://www.inderscience.com/jhome.php?jcode=ijsise
8. https://ieeexplore.ieee.org/document/1143815
9. https://ieeexplore.ieee.org/xpl/RecentIssue.jsp?punumber=79
https://www.ieee.org/membership-catalog/productdetail/showProductDetailPage.html?product=PER310-PRT

SWAYAM/NPTEL/MOOCs:
1. https://nptel.ac.in/courses/108/104/108104100/
2. https://nptel.ac.in/courses/117/101/117101055/
3. https://nptel.ac.in/courses/108/106/108106163/
4. https://www.coursera.org/courses?query=signals%20and%20systems
5. https://nptel.ac.in/courses/117/104/117104074/

Signals and Systems Lab Manual - B20EN0502 Sem:V P age |4


REVA University School of ECE

Contents

Sl. No TITLE PAGE No.


Introduction To MATLAB 6-8
1 MATLAB Basics 9-13
2 A) Generation And Plotting Of Sine Waves 14-15
B) Generation And Plotting Of Elementary Signals
3 Perform Operations On Dependent Variable Of a Signal. 23-25
4 Perform Operations On Independent Variable Of a Signal. 26-28
5 To Calculate Signal Power and Signal Energy 29-29
6 To Compute The Linear Convolution Of The Given Input Sequence 30-33
x(n) & The Impulse Response Of The System h(n). (Causal
Sequences)
7 To Compute The Linear Convolution Of The Given Input Sequence 34-35
x(n) & The Impulse Response Of The System h(n). (Non-Causal
Sequences)
8 Solve Any Given Difference Equation Of An LTI System 36-38
Without Initial Conditions.
9 a) Fourier synthesis of square wave in MATLAB 39-44
b) Fourier synthesis of a triangular wave in MATLAB
10 Solve Any Given Difference Equation Of An LTI System 45-46
With Initial Conditions.
11 Demonstration Of Sampling Theorem 47-51
Texas Instruments (TI) TMS320c6713 DSK KIT
12 C Program To Generate A Sine Wave Using CCS Studio And TI 64-64
Processor Kit
13 C Program To Compute The Linear Convolution Of The Given Input 65-65
Sequence x(n) & The Impulse Response Of The System h(n) Using
Using CCS Studio And TI Processor Kit
14 Viva Question and Answers 70-70

Signals and Systems Lab Manual - B20EN0502 Sem:V P age |5


REVA University School of ECE

MATLAB Introduction
What is MATLAB?

MATLAB is the name of a software product developed by a company called

It is very general, powerful and popular. By skill demand, it is one of the top 10 computer
languages. There is no field untouched and uninfluenced by it and is used by millions of people
from all walks of life – students, teachers, researchers etc - worldwide.
Just a pick of the several applications: MATLAB has been used in projects such as modelling
energy consumption to build smart power grids, developing control algorithms for hypersonic
vehicles, analyzing weather data to visualize the track and intensity of hurricanes, and running
millions of simulations to pinpoint optimal dosing.
Why?
BECAUSE MATLAB
• first and foremost, is easy to use. Just like how you write on paper. No variable
declarations, No dimension declarations, No type declarations, No inclusion of libraries and so
on. It is all about mathematical computations -everything from simple to most complex.
• data visualization– i.e. simple to powerful graphics like 3D and animated graphics.
• much much more - for example, symbolic math, importing and exporting of data,
programming, publishing and interfacing to hardware.
• The strength of MATLAB is its matrix-based operations. Ability to deal with several
numbers at the same time rather than one at a time.
• MATLAB handholds from conceptualization to hardware implementation and
acceptance.
• simply put, MATLAB is all about everything you need to do a job from concept to
using.
• superb documentation, embedded help, free source code, demos, videos, user fora and
shared knowledge, MATLAB based subject books....
Disclaimer and scope:
In this introduction to MATLAB, we will only be scratching the surface. Just the flavour of
matlab for understanding its usage in signals and systems lab experiments. Also nothing can
beat built-in MATLAB documentation. But we will give enough push/guidance so that the
reader can be on his own with the various help mechanisms available in MATLAB.
Versions

Signals and Systems Lab Manual - B20EN0502 Sem:V P age |6


REVA University School of ECE

MATLAB has two releases every year; they are called like 2015a, 2015b, 2016a, and 2016b.
Next one is expected in Feb-Mar 2017timeframe.
Invoking MATLAB and using MATLAB as a calculator
MATLAB is easier-to-use than a calculator and yet incomparably powerful.
Let us get started! INVOKE MATLAB! By double-clicking on the MATLAB icon on your
desktop.
Let us see some examples of using MATLAB for numerical calculations – MATLAB as a
calculator.

>> What is this?


All your input to the MATLAB goes after this. It is the command prompt. You enter the
instructions/commands after this and initiate execution by pressing the [RETURN]/[ENTER]
key.
% commenting
You can comment any command after entering % after the command. Anything after % till the
end of the line would be ignored by MATLAB
To err is human, to forgive is MATLAB:
When you make typos or enter invalid commands, MATLAB lets you know with informative
messages.
>>fft(1:1e10);
Requested 10000000000x1 (74.5GB) array exceeds maximum array size preference.
Creation of arrays greater than this limit may take a long time and cause MATLAB to
become unresponsive. See array size limit or preference panel for more information.
But/And if you realize your error, there are several ways of correcting your entries.

Signals and Systems Lab Manual - B20EN0502 Sem:V P age |7


REVA University School of ECE

You can erase an entire line of command, without executing by pressing the [esc] key.
You can use Up-arrow or Down-arrow keys to access previously executed commands and
execute them after making changes using the LeftArrow, RightArrow to reach the place of
correction. Any previously executed command can be reexecuted as it is – using the same
method – if no correction is needed.
ORDER OF PRECEDENCE:
MATLAB follows normal mathematical rule of operator precedence BODMAS.
() highest precedence
Mathematical constants (not comprehensive list)
pi (MATLAB is case-sensitive, so pi, Pi, pI, PI are all different, for example!)
i,j (square root of -1, as long as you did not change the value of it by assigning some other
value to it.)
>>3+5i
ans =
3.0000 + 5.0000i
All the built-in constants can be reassigned. And other variables can be created with these
values.
How to get out of a logjam?
Ctrl+C
>>a=1;while a==1,end
Ctrl+C
>>
How to get out?
Key in exit or close the MATLAB window.

Signals and Systems Lab Manual - B20EN0502 Sem:V P age |8


REVA University School of ECE

1. MATLAB BASICS

In these examples, the results are stored in ‘ans’. So the latest result overwrites the previous
‘ans’.

Sl.
Arithmetic operations MATLAB Expressions
No.
01 2.7183 + 3.1416 2.7183 + 3.1416
02 1947-1857 1947-1857
03 60x60 60*60
04 25 2^5
05 25 2^5 / (2^5-1)
25 − 1
06
3*(sqrt(5)-1) / (sqrt(5)+1)^2-1

07 Area=πr2 with r = π1/3-1 Area=pi*(pi^(1/3)-1)^2

Sl. Exponential and


MATLAB Expressions
No. Logarithms
01 e3 exp(3)
02 ln(e3) log(exp(3))
03 log10(e3) log10(exp(3))
04 log10(105) log10(10^5)
05 eπ√163 exp(pi*sqrt(163))

Signals and Systems Lab Manual - B20EN0502 Sem:V P age |9


REVA University School of ECE

Sl.
Trigonometric functions MATLAB Expressions
No.
01 sin (π/6) sin(pi/6)
02 cos (π) cos(pi)
03 tan (π/2 tan(pi/2)
04 Sin2 π/6 + cos2 π/6 (sin(pi/6))^2 + (cos(pi/6))^2

Example:
Given a=3; b=2;c=5; d=3;

1. Evaluate the following MATLAB assignment statements:


a) y = a*b+c*d;
b) y = a*(b+c)*d;
c) y = (a*b)+(c*d);
d) y = a^b^d;
e) y = a^(b^d);

a) y = a*b+c*d
= 3*2+5*3 => 6+15 => 21 => y = 21

b) y = a*(b+c)*d
= 3*(2+5)*3 => 3*7*3 => y = 63

c) y = (a*b)+(c*d)
= (3*2)+(5*3) => 6+15 => y = 21

d) y = a^b^d;
= 3^2^3 => 9^3 => y = 729

e) y = a^(b^d)
= 3^(2^3) => 3^8 => y = 6561

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 10


REVA University School of ECE

Matrices MATLAB command


A =[1 2 5; 3 9 0];
1.

A = [1 3 9;5 10 15; 0 0 -5];


OR
2

Initializing with
builtin functions MATLAB
Comments
in MATLAB / Expression
OCTAVE
1. A =
Creates 2X2 with 0’s
zeros(2);
2. B =
Creates 2X3 with 0’s
zeros(2,3);
3. C =
Creates 2X3 with 1’s
ones(2,3);

4. D = Creates 3X3 with diagonal elements


eye(3); as 1

5. E = Creates 3X3 with diagonal elements


4*eye(3); as 4

Array operations:
1. .* => Element by element multiplication
2. ./ => Element by element left division
3. .\ => Element by element right division
4. .^ => Element by element exponentiation

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 11


REVA University School of ECE

MATRIX PROBLEMS:

1. Assume

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 12


REVA University School of ECE

SIMPLE X, Y PLOTS

MATLAB Code for the given equation y= x2-10x+15


%MATLAB Code for the given equation y= x2-10x+15
clc;
x=0:1:10;
y=x.^2-10.*x+15;
plot(x,y); % plots the value x and y in continuous form
xlabel('x');
ylabel('y');
title('plot of y vs x');
grid on;

output:

%MATLAB Code for the given equation y= x2-10x+15


clc;
x=0:1:10;
y=x.^2-10.*x+15;
stem(x,y); % plots the value x and y in discrete form
xlabel('x');
ylabel('y');
title('plot of y vs x');
grid on;
output:

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 13


REVA University School of ECE

2. A) GENERATION AND PLOTTING OF SINE WAVES


Theory: Sinusoids are the building block of analog signal processing. All real world signals can be
represented as an infinite sum of sinusoidal functions via a Fourier series.

%MATLAB Code for the given equation y= A sin(2πft)


clc;
t=0:0.00001:0.01;
A=10;
f=200;
y=A*sin(2*pi*f*t);
plot(t,y);
xlabel('time axis');
ylabel('Amplitude');
title('sine wave plot');

%MATLAB Code for the given equation y= A cos(2?ft)


clc;
t=0:0.00001:0.01;
A=10;
f=200;
y=A*cos(2*pi*f*t);
plot(t,y);
xlabel('time axis');
ylabel('Amplitude');
title('cosine wave plot');

%MATLAB Code to plot both sine and cosine in one figure window
clc;
t=0:0.00001:0.01;
A=10;
f=200;
y1=A*sin(2*pi*f*t);
y2=A*cos(2*pi*f*t);
plot(t,y1,t,y2);
xlabel('time axis');
ylabel('Amplitude');
title('sine/cosine wave plot');

%MATLAB Code to plot both sine and cosine in separate figure window
clc;
t=0:0.00001:0.01;
A=10;
f=200;
y1=A*sin(2*pi*f*t);
y2=A*cos(2*pi*f*t);

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 14


REVA University School of ECE

figure(1);
plot(t,y1);
xlabel('time axis');
ylabel('Amplitude');
title('sine wave plot');

figure(2);
plot(t,y2);
xlabel('time axis');
ylabel('Amplitude');
title('cosine wave plot');

%MATLAB Code to plot both sine and cosine by dividing the figure window:
clc;
t=0:0.00001:0.01;
A=10;
f=200;
y1=A*sin(2*pi*f*t);
y2=A*cos(2*pi*f*t);

subplot(2,1,1);
% Divides the figure window into 2 rows, 1 column and 1st position respectively
plot(t,y1); % plots the waveform in continuous form
xlabel('time axis');
ylabel('Amplitude');
title('sine wave plot');

subplot(2,1,2);
% Divides the figure window into 2 rows, 1 column and 2nd position respectively
plot(t,y2);
xlabel('time axis');
ylabel('Amplitude');
title('cosine wave plot');

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 15


REVA University School of ECE

2. B) GENERATION AND PLOTTING OF ELEMENTRY SIGNALS


Theory:
An impulse (Dirac delta function) is defined as a signal that has an infinite magnitude and an
infinitesimally narrow width with an area under it of one, centered at zero.
It is not, in reality, possible to generate such a signal, but it can be sufficiently approximated
with large amplitude, narrow pulse, to produce the theoretical impulse response in a network
to a high degree of accuracy. The symbol for an impulse is δ(t).
Note: If an impulse is used as an input to a system, the output is known as the impulse response.
The impulse response defines the system because all possible frequencies are represented in
the input.
A unit step function is a signal that has a magnitude of zero before zero and a magnitude of
one after zero. The symbol for a unit step is u(t).
Note: If a step is used as the input to a system, the output is called the step response. The step
response shows how a system responds to a sudden input, similar to turning on a switch. The
period before the output stabilizes is called the transient part of a signal. The step response can
be multiplied with other signals to show how the system responds when an input is suddenly
turned on.
%Matlab code for unit impulse signal generation:

clc;
clear all;
close all;
disp('Unit Impulse Signal Generation'); % disp is used to display messages on the
command window
N = input('Enter no of samples:'); % input is used to read the values through console
n = -N : 1 : N;
x = inline('1*(n==0)');
stem(n,x(n));
xlabel('Sample');
ylabel('Amplitude');
title('Unit Impulse Signal');

Output:
Unit Impulse Signal Generation
Enter no of samples: 10

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 16


REVA University School of ECE

% MATLAB Code for Generalised Impulse Sequence

% generates impulse sequence delayed by c, in a, between the positions d and e


% to see the unit sample we should satisfy d<=c<=e

% OUTPUT ARGUMENTS
% a the output sequence name
% b position vector for output sequence plotting

% INPUT ARGUMENTS
% c delay of the impulse sequence
% d start position for plotting c
% e end position for plotting e
clc;
clear all;
close all;

c= input(' Enter delay of the impulse sequence c: ');


d= input ('Enter start position for plotting d: ');
e= input (' Enter end position for plotting e: ');
if c<d,
error('impulse sample will not be seen within the range of positions given')
end
n= d:e;
x = inline('1*(n==c)');
stem(n,x(c,n));
xlabel('sample position');
ylabel('sample value');
title('plot of the sequence');

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 17


REVA University School of ECE

Output:
Enter delay of the impulse sequence c: 3
Enter start position for plotting d: -10
Enter end position for plotting e: 10

% MATLAB code for unit step signal generation:


clc;
clear all;
close all;
disp('Unit Step Signal Generation');
N = input('Enter no of samples: ');
n = -N : 1 : N;
x = inline('1*(n>=0)');
stem(n,x(n));
xlabel('Sample');
ylabel('Amplitude');
title('Unit Step Signal');

Output:
Unit Step Signal Generation
Enter no of samples: 10

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 18


REVA University School of ECE

% MATLAB Code for Generalised Step Sequence

% generates step sequence delayed by c, in a, between the positions d and e


% generates step sequence indirectly using the impulse sequence generation.

% OUTPUT ARGUMENTS
% a the output sequence name
% b position index for output sequence plotting

% INPUT ARGUMENTS
% c delay of the impulse sequence
% d start position for plotting
% e end position for plotting
clc;
clear all;
close all;
c= input(' Enter delay of the impulse sequence c: ');
d= input ('Enter start position for plotting d: ');
e= input (' Enter end position for plotting e: ');
if c<d,
error('impulse sample will not be seen within the range of positions given')
end
n= d:e;
x = inline('1*(n>=c)');
stem(n, x(c,n));
xlabel('sample position');
ylabel('sample value');
title('plot of the desired sequence');

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 19


REVA University School of ECE

Output:
Enter delay of the step sequence c: 3
Enter start position for plotting d: -10
Enter end position for plotting e: 10

% MATLAB code for unit ramp signal generation:

clc;
clear all;
close all;
disp('Unit Ramp Signal Generation');
N = input('Enter no of samples: ');
n = -N : N;
r= inline ('n.*(n>=0)');
stem (n, r(n));
xlabel('Sample');
ylabel('Amplitude');
title('Unit Ramp Signal');

Output:
Unit Ramp Signal Generation
Enter no of samples: 10
Max Amplitude: 10

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 20


REVA University School of ECE

% MATLAB Code for Generalised Ramp Sequence

% generates ramp sequence delayed by c, in a, between the indices d and e


% a the output sequence name
% b position index for output sequence plotting
% c delay of the impulse sequence
% d start position for plotting
% e end position for plotting
clc;
clear all;
close all;
c= input(' Enter delay of the ramp sequence: ');
d= input ('Enter start position for plotting d: ');
e= input (' Enter end position for plotting e: ');
if c<d,
error('impulse sample will not be seen within the range of positions given')
end
n= d:e ;
r= inline ('(n-c).*(n>=c)');
stem(n, r(c,n));
xlabel('sample position');
ylabel('sample value');
title('plot of the desired sequence');

Output:
Enter delay of the ramp sequence: 3
Enter start position for plotting d: -10
Enter end position for plotting e: 10

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 21


REVA University School of ECE

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 22


REVA University School of ECE

3. PERFORM OPERATIONS ON DEPENDENT VARIABLE OF


ASIGNAL.
% MATLAB Code for Addition/Subtraction of two sequences

% x1 first sequence
% n1 first sequence start position
% x2 second sequence
% n2 second sequence start position
% y restulting sequence
% n resulting sequence positin vector

clc;
clear all;
close all;
x1= input('Enter the first sequence: ');
n1= input('Enter the first sequence start position: ');
x2= input('Enter the second sequence: ');
n2= input('Enter the second sequence position: ');

MIN = min(n1,n2);
MAX = max (n1+length(x1)-1,n2+length(x2)-1);
n=MIN:MAX;
y1=zeros(1,length(n));
y2=y1;
a=n1(1)-MIN+1;
b=n2(1)-MIN+1;
y1(a:a+length(x1)-1)=x1;
y2(b:b+length(x2)-1)=x2;
y = y1+y2;% sequence addition, y1-y2 for sequence subtraction
disp(y);
subplot(3,1,1)
stem(n,y1)
title(' Signal x1' );
subplot(3,1,2)
stem(n,y2)
title(' Signal x2');
subplot(3,1,3)
stem(n,y)
title(' Signal y, addition of x1 and x2')

Output:

Enter the first sequence: [2 4 5 6]


Enter the first sequence start position: 1
Enter the second sequence: [-5 3 6 9]
Enter the second sequence position: 0
Addition Output:
-5 5 10 14 6

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 23


REVA University School of ECE

% MATLAB Code for Multiplication of two sequences


% x1 first sequence
% n1 first sequence start position
% x2 second sequence
% n2 second sequence start position
% y restulting sequence
% n resulting sequence positin vector

clc;
clear all;
close all;
x1= input('Enter the first sequence: ');
n1= input('Enter the first sequence start position: ');
x2= input('Enter the second sequence: ');
n2= input('Enter the second sequence position: ');

MIN = min (n1, n2);


MAX = max (n1+length(x1)-1, n2+length(x2)-1);
n=MIN: MAX;
y1=zeros (1, length (n));
y2=y1;
a=n1 (1)-MIN+1;
b=n2 (1)-MIN+1;
y1 (a: a+length(x1)-1) =x1;
y2 (b: b+length(x2)-1) =x2;
y = y1.*y2; % sequence multiplication
disp(' Multiplication output');
disp(y);

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 24


REVA University School of ECE

subplot(3,1,1)
stem(n,y1)
title(' Signal x1' );
subplot(3,1,2)
stem(n,y2)
title(' Signal x2');
subplot(3,1,3)
stem(n,y)
title(' Signal y, multiplication of x1 and x2')

Output:

Enter the first sequence: [2 4 5 7]


Enter the first sequence start position: 0
Enter the second sequence: [4 3 5 -4]
Enter the second sequence position: 1
Multiplication output
0 16 15 35 0

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 25


REVA University School of ECE

4. PERFORM OPERATIONS ON INDEPENDENT VARIABLE OF


ASIGNAL.

% MATLAB Code for Shifting a Signal

clc;
clear all;
close all;

n1=input('Enter the amount to be delayed: ');


n2=input('Enter the amount to be advanced: ');
n=-2:2;
x=[-2 3 0 1 5];
subplot(3,1,1);
stem(n,x);
title('Signal x(n)');
m=n+n1;
y=x;
subplot(3,1,2);
stem(m,y);
title('Delayed signal x(n-n1)');
t=n-n2;
z=x;
subplot(3,1,3);
stem(t,z);
title('Advanced signal x(n+n2)');

Output:

Enter the amount to be delayed: 2


Enter the amount to be advanced: 3

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 26


REVA University School of ECE

Signal x(n)
5

-
5
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Delayed signal x(n-n1)
5

-
5
0 0.5 1 1.5 2 2.5 3 3.5 4
Advanced signal x(n+n2)
5

-5
-5 -4.5 -4 -3.5 -3 -2.5 -2 -1.5 -1

% MATLAB Code for plotting reflection a Signal

clc;
clear
all;
close
all;

n=-1:2;
x=[3 -1 0 -4];
subplot(2,1,1
)stem(n,x);
axis([-3 3 -5 5]);
title('Signal
x(n)');c=fliplr(x);
y=fliplr(-n);
subplot(2,1,2);
stem(y,c);
axis([-3 3 -5 5]);
title('Reflected Signal x(-n)');

CHALLENGE EXPERIMENT:

Write a general matlab program for shifting and folding operation also plot the graph for
x(n)=[1 3-4 5 3] and (i) x(-n+3) (ii)x(-n-5)

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 27


REVA University School of ECE

Output:

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 28


REVA University School of ECE

5. TO CALCULATE SIGNAL POWER AND SIGNAL ENERGY

% MATLAB Code for Calculating Signal Power and Signal Energy

clc;
clear all;
close all;
x=[3 -1 1 -4];

power=sum(abs(x).^2)/length(x);
disp(power);

Energy=sum(abs(x).^2);
disp(Energy);

Output:

6.7500

27

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 29


REVA University School of ECE

6. TO COMPUTE THE LINEAR CONVOLUTION OF THE GIVEN


INPUT SEQUENCE x(n) & THE IMPULSE RESPONSE OF THE
SYSTEM h(n). (CAUSAL SEQUENCES)

Theory:
 The output y[n] of a LTI (linear time invariant) system can be obtained by convolving
the input x[n] with the system’s impulse response h[n].
 The convolution sum is

 x[n] and h[n] can be both finite or infinite duration sequences.


 Even if one (or both) of the sequences is infinite (say, h[n]=(0.9)n u[ n] ), we can
analytically evaluate the convolution formula to get a functional form (closed form
solution) of y[n].
 If both the sequences are of finite duration, then we can use the matlab function ‘conv’
to evaluate the convolution sum to obtain the output y[n]. Convolution is implemented
as polynomial multiplication (refer matlab help).
 The length of y[n] = xlength + hlength -1.
 The conv function assumes that the two sequences begin at n=0 and is invoked by
y=conv(x,h).
 Even if one of the sequences begin at other values of n, say n=-3,or n=2; then we need
to provide a beginning and end point to y[n] which are ybegin=xbegin+hbegin and
yend=xend+hend respectively.

Algorithm:
1. Input the two sequences as x1, x2
2. Convolve both to get output y.
3. Plot the sequences.

Matlab Implementation:
Matlab recognizes index 1 to positive maximum. Index 0 is also not recognized. The timing
information for a sequence is provided by another vector, say n=-3:5; creates a vector with
values from -3 to 5 with an increment of 1.
During plotting, the time vector size and the sequence size should be the same, i.e., the number
of elements in the sequence x1 and in its time vector n1 should be the same. Similarly for x2
and y.

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 30


REVA University School of ECE

Matlab Program:
% CAUSAL SEQUENCES
%main part of computation

clc;
clear all;
close all;
x=input('Enter first sequence: ');
h=input('Enter second sequence: ');
y=conv(x,h);
disp('linear con of x & h is y= ');
disp(y);

% graphical display part


subplot(3,1,1); % Divides the fig window into 3-rows, 1-Column & 1st position
stem(x); % To display ‘x’ input in figure window
xlabel('time index n');
ylabel('amplitude ');
title('plot of x(n)');

subplot(3,1,2); % Divides the fig window into 3-rows, 1-Column & 2nd position
stem(h); % To display ‘h’ input in figure window
xlabel('time index n');
ylabel('amplitude ');
title('plot of h(n)');

subplot (3,1,3); % Divides the fig window into 3-rows, 1-Column & 3rd position
stem(y); % To display ‘y’ output in figure window
xlabel('time index n');
ylabel('amplitude ');
title('convolution output');

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 31


REVA University School of ECE

Calculations:-
h(n)= Impulse response of a system due to impulse input function.
y(n)= x(n) * h(n)

let, x(n) = [1 2 3] = δ(n) + 2δ(n-1) + 3δ(n-2)


h(n) = [1 2 3 4] = δ(n) + 2δ(n-1) + 3δ(n-2) + 4δ(n-3)

x(n)*h(n) = [δ(n)+2δ(n-1)+3δ(n-2)] * [δ(n)+2δ(n-1) + 3δ(n-2)+4δ(n-3)]

Using convolution property of the two delayed unit impulse sequence we get,
x(n)*h(n) = δ(n)+2δ(n-1) +3δ(n-2) + 4δ(n-3)
+2δ(n-1) + 4δ(n-2) + 6δ(n-3) + 8δ(n-4)
+3δ(n-2) + 6δ(n-3) + 9δ(n-4) +12δ(n-5)
x(n)*h(n) = δ(n) + 4δ(n-1) +10δ(n-2) +16δ(n-3) +17δ(n-4) +12δ(n-5)

Therefore, x(n)*h(n) = [1, 4, 10, 16, 17, 12]

Output :

Enter first sequence: [1 2 3]


Enter second sequence: [1 2 3 4]
linear con of x & h is y=
1 4 10 16 17 12

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 32


REVA University School of ECE

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 33


REVA University School of ECE

7. TO COMPUTE THE LINEAR CONVOLUTION OF THE GIVEN


INPUT SEQUENCE x(n) & THE IMPULSE RESPONSE OF THE
SYSTEM h(n). (NON-CAUSAL SEQUENCES)

Matlab Program:
% Two sided sequences (Non- Causal Sequences)
% Main part of computation

x= [3 11 7 0 -1 4 2]; % first sequence


n1=-3:3; % time vector of first sequence
h=[2 3 0 -5 2 1]; % second sequence
n2=-1:4; % time vector of second sequence
ybegin=n1(1)+n2(1); % add first elements of time vector
yend=n1(length(x))+n2(length(h)); % add last elements of time vector

ny=[ybegin:yend];
y=conv(x,h);
disp('linear con of x & h is y=');
disp(y); % Displays the value of ‘y’ on Terminal window

%graphical display with time info


subplot(3,1,1); % Divides the fig window into 3-rows, 1-Column & 1st position
stem(n1,x); % To display ‘x’ input in figure window
xlabel('time index n');
ylabel('amplitude ');
title('plot of x(n)');

subplot(3,1,2); % Divides the fig window into 3-rows, 1-Column & 2nd position
stem(n2,h);
xlabel('time index n');
ylabel('amplitude ');
title('plot of h(n)');

subplot (3,1,3); % Divides the fig window into 3-rows , 1-Column & 3rd position
stem(ny,y);
xlabel('time index n');
ylabel('amplitude ');
title('convolution output');

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 34


REVA University School of ECE

Calculations:-
x = [3 11 7 0 -1 4 2] h = [2 3 0 -5 2 1]
↑ ↑
x*h = [ 3δ(n+3)+11δ(n+2)+7δ(n+1)-1δ(n-1)+4δ(n-2)+2δ(n-3)]*[ 2 δ(n+1)+3 δ(n)-5 δ(n-2)+2δ(n-3)+δ(n- 4)]

= 6δ(n+4)+22δ(n+3)+14δ(n+2)- 2δ(n)+ 8δ(n-1)+ 4δ(n-2)


+9δ(n+3)+ 33δ(n+2)+21δ(n+1) - 3δ(n-1)+12δ(n-2)+6δ(n-3)
-15δ(n+1)-55δ(n)-35δ(n-1) +5δ(n-3)-20δ(n-4)-10δ(n-5)
+6δ(n)+22δ(n-1)+14δ(n-2) - 2δ(n-4)+8δ(n-5)+4δ(n-6)
+3δ(n-1)+11δ(n-2)+7δ(n-3) δ(n-5)+4δ(n-6)+2δ(n-7)
6δ(n+4)+31δ(n+3)+47δ(n+2)+6δ(n+1)-51δ(n)-5δ(n-1)+41δ(n-2)+18δ(n-3)-22δ(n-4)-3δ(n-5)+8δ(n-6)+2δ(n-7)
Therefore, y = [6, 31, 47, 6, -51, -5, 41, 18, -22, -3, 8, 2]
Output:
x = [3 11 7 0 -1 4 2] n1 = [-3 -2 -1 0 1 2 3]
h = [ 2 3 0 -5 2 1] n2 = [-1 0 1 2 3 4]
linear con of x & h is y=
6 31 47 6 -51 -5 41 18 -22 -3 8 2

CHALLENGE EXPERIMENT:
3. Write a general matlab program for linear convolution for any two general sequences
(causal and non-causal) without using inbuilt function.

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 35


REVA University School of ECE

8. SOLVE ANY GIVEN DIFFERENCE EQUATION OF AN LTI


SYSTEM WITHOUT INITIAL CONDITIONS.
Theory:

Fig. of LTI system


A discrete time LTI system (also called digital filters) as shown in Fig. is represented by :
 A linear constant coefficient difference equation, for example,
y [ n]+a1 y [ n−1]−a2 y [ n−2]=b0 x [n]+b1 x [ n−1]+b2 x [ n−2 ] ;
 A system function H(z) (obtained by applying Z transform to the difference equation).

 A frequency response function obtained by applying DFT on the impulse response h[n]
(or by replacing z with ejΩ in H(z)) to get

 Given the difference equation or H(z), the impulse response of the LTI system is found
using filter or impz matlab/gnu-octave functions. If the difference equation contains
past samples of output, i.e., y[n-1], y[n-2], etc , then its impulse response is of infinite
duration (IIR). For such systems the impulse response is computed for a large value of
n, say n=100 (to approximate n=∞).
 Given only the input sequence x[n] and the output sequence y[n], we can find the
impulse function h[n] by using the inverse operation deconv. (The conv operation
convolves 2 sequences x[n] and h[n] to obtain the output y[n]. If both y[n] and x[n] are
finite then the impulse response is finite (FIR).
 The de-convolution operation is valid only if the LTI system is ‘invertible’.
Matlab Implementation:
FILTER One-dimensional digital filter.
Y = FILTER(B,A,X) filters the data in vector X with the filter described by vectors A
and B to create the filtered data Y. The filter is a "Direct Form II Transposed"
implementation of the standard difference equation:
a(1)*y(n) = b(1)*x(n) + b(2)*x(n-1) + ... + b(nb+1)*x(n-nb)
- a(2)*y(n-1) - ... - a(na+1)*y(n-na)
If a(1) is not equal to 1, FILTER normalizes the filter coefficients by a(1).

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 36


REVA University School of ECE

% matlab program to find Impulse Response given the difference equation with zero initial
condition:
clc;
N=5;
b= [1 0.5]; % numerator coefficients
a=[1 -0.63 0.72]; % denominator coefficients
x=[1,zeros(1,N-1)]; % x=[1 0 0 0 0];
y=filter (b,a,x);

disp('the impluse response of the system without initial conditions');


disp(y);

stem(y);
title('impluse response of the system without initial conditions');

Calculations:-
y[n]-0.63y[n-1]+0.72y[n-2] = x[n]+0.5x[n-1]
y[n] = 0.63y[n-1]-0.72y[n-2]+ x[n]+0.5x[n-1]
n=0; y[0] = 0.63y[0-1]-0.72y[0-2]+x[0]+0.5x[0-1]

y[0] = 1

n=1; y[1] = 0.63y[1-1]-0.72y[1-2]+x[1]+0.5x[1-1]

= (0.63)(1)+(0.5)(1)
y[1] = 1.13

n=2; y[2] = 0.63y[2-1]-0.72y[2-2]+x[2]+0.5x[2-1]

= (0.63)(1.13)-(0.72)(1)
y[2] = -0.008100

n=3; y[3] = 0.63y[3-1]-0.72y[3-2]+x[3]+0.5x[3-1]

= (0.63)(-0.008100)-(0.72)(1.13)

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 37


REVA University School of ECE

y[3] = -0.818703
n=4; y[4] = 0.63y[4-1]-0.72y[4-2]+x[4]+0.5x[4-1]

= (0.63)(-0. 8187)-(0.72)(-0.0081)
y[4] = -0.509949

Result:
the impluse response of the system
without initial conditions 1.0000 1.1300
-0.0081 -0.8187 -0.5100

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 38


REVA University School of ECE

9. FOURIER SYNTHESIS OF SQUARE WAVE AND TRIANGULAR


WAVE IN MATLAB

FOURIER SERIES
A Fourier series is an expansion of a periodic function f(x) in terms of an infinite
sum of sines and cosines. Fourier series make use of the orthogonally
relationships of the sine and cosine functions. The computation and study of
Fourier series is known as harmonic analysis and is extremely useful as a way to
break up an arbitrary periodic function into a set of simple terms that can be
plugged in, solved individually, and then recombined to obtain the solution to the
original problem or an approximation to it to whatever accuracy is desired or
practical. Examples of successive approximations to common functions using
Fourier series are illustrated above.
In particular, since the superposition principle holds for solutions of a linear
homogeneous ordinary differential equation, if such an equation can be solved in
the case of a single sinusoid, the solution for an arbitrary function is immediately
available by expressing the original function as a Fourier series and then plugging
in the solution for each sinusoidal component. In some special cases where the
Fourier series can be summed in closed form, this technique can even yield
analytic solutions.
Any set of functions that form a complete orthogonal system have a
corresponding generalized Fourier series analogous to the Fourier series. For
example, using orthogonally of the roots of a Bessel function of the first kind
gives a so-called Fourier-Bessel series.

The computation of the (usual) Fourier series is based on the integral identities

Using the method for a generalized Fourier series, the usual Fourier series
Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 39
REVA University School of ECE

involving sines and cosines is obtained by taking f1(x)=cosx and f2(x)=sinx. Since
these functions form a complete orthogonal system over [-pi,pi], the Fourier series
of a function f(x) is given by

and n=1, 2, 3, .... Note that the coefficient of the constant term has been written
in a special form compared to the general form for a generalized Fourier series in
order to preserve symmetry with the definitions of an and bn
The Fourier series for a few common functions are summarized in the table below.

Fourier Series--Square Wave

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 40


REVA University School of ECE

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 41


REVA University School of ECE

Fourier Series--Triangle Wave

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 42


REVA University School of ECE

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 43


REVA University School of ECE

MATLAB program for Fourier Synthesis of Square wave


clc;
clear all;
close all
Fs=150;
t=0:1/Fs:4-1/Fs;
f=2;
x=square(2*pi*f*t);
figure;
plot(t,x);
axis([0 1 -2 2]);
% Approximation with Fourier decomposition
y=0;
N=15;
for r=1:2:N
y=y+sin(2*pi*f*t*r)/r;
end
hold on;
plot(t,y,'r');
xlabel('t');
ylabel('magnitude');
hold off;

Graph of Fourier Synthesis of Square wave

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 44


REVA University School of ECE

10. SOLVE ANY GIVEN DIFFERENCE EQUATION OF AN LTI SYSTEM


WITH INITIAL CONDITIONS.

% matlab program to find Impulse Response given the difference equation with initial
condition:
clc;
N=5;
b= [1 0.5]; % numerator coefficients
a=[1 -0.63 0.72]; % denominator coefficients
x=[1,zeros(1,N-1)]; % x=[1 0 0 0 0];
zi=filtic(b,a,[1 2]); % with initial conditions y(-1) = 1 and y(-2) = 2
y=filter (b,a,x,zi);
disp('the impluse response of the system with initial conditions');
disp(y);

stem(y);
title('impluse response of the system with initial conditions');

Calculations:-
y[n]-0.63y[n-1]+0.72y[n-2] = x[n]+0.5x[n-1]
y[n] = 0.63y[n-1]-0.72y[n-2]+ x[n]+0.5x[n-1]

initial condition is, y(-1)=1; y(-2)=2;


n=0; y[0] = 0.63y[0-1]-0.72y[0-2]+x[0]+0.5x[0-1]
= (0.63)(1) – (0.72)(2) + 1 + (0.5)(0)
= 0.63-1.44+1
y[0] = 0.19
n=1; y[1] = 0.63y[1-1]-0.72y[1-2]+x[1]+0.5x[1-1]
= 0.63y[0]-0.72y[-1]+x[1]+0.5x[0]
= (0.63)(0.19) – (0.72)(1) + 0 + (0.5)(1)
y[1] = -0.1003

n=2; y[2] = 0.63y[2-1]-0.72y[2-2]+x[2]+0.5x[2-1]


= 0.63y[1]-0.72y[0]+x[2]+0.5x[1]
= (0.63)(-0.1003) – (0.72)(0.19) + 0+ (0.5)(0) => -0.06318-0.1368
y[2] = -0.1999

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 45


REVA University School of ECE

n=3; y[3] = 0.63y[3-1]-0.72y[3-2]+x[3]+0.5x[3-1]


= 0.63y[2]-0.72y[1]+x[3]+0.5x[2]
= (0.63)(-0.1999) – (0.72)(-0.1003) + 0+ (0.5)(0) => -0.125937+0.072216
y[3] = -0.0537

n=4; y[4] = 0.63y[4-1]-0.72y[4-2]+x[4]+0.5x[4-1]


= 0.63y[3]-0.72y[2]+x[4]+0.5x[3]
= (0.63)(-0.0537) – (0.72)(-0.1999) + 0 + (0.5)(0) => -0.033831+0.143928
y[4] = 0.1100

Result:
the impluse response of the system with initial conditions
0.1900 -0.1003 -0.2000 -0.0538 0.1101

CHALLENGE EXPERIMENT:
1. Write a matlab program to extend the calculation of output for other standard inputs
like unit step, ramp and sinusoid (can use matlab inbuilt functions).

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 46


REVA University School of ECE

11. DEMONSTRATION OF SAMPLING THEOREM


clc

clear all;

close all;

tfinal=0.05;

t=0:0.00005:tfinal;

f1=input('Enter first analog frequency');

f2=input('Enter second analog frequency');

%define input analog signal

xt=cos(2*pi*f1*t)+cos(2*pi*f2*t);

fm=max(f1,f2);

%simulate condition for undersampling i.e., fs < 2fm

fs=1.3*fm;

Ts=1/fs;

n=0:Ts:tfinal;

%Generate the undersampled signal

xn=cos(2*pi*f1*n)+cos(2*pi*f2*n);

%plot the analog & sampled signals

figure(1)

subplot(3,1,1);

plot(t,xt)

xlabel('t')

ylabel('x(t)')

title('Original analog signal');

subplot(3,1,2);

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 47


REVA University School of ECE

stem(n,xn)

xlabel('n')

ylabel('x(n)')

title('Under sampled signal');

subplot(3,1,3);

plot(t,xt,'b',n,xn,'r*-');

xlabel('t')

ylabel('x(t) & xr(t)')

title('Reconstructed analog signal after under sampling');

legend('original analog signal','reconstructed signal after sampling')

%condition for Nyquist plot

fs=2*fm;

Ts=1/fs;

n=0:Ts:tfinal;

%Generate the nyquist sampled signal

xn=cos(2*pi*f1*n)+cos(2*pi*f2*n);

%plot the analog & sampled signals

figure(2)

subplot(3,1,1);

plot(t,xt)

xlabel('t')

ylabel('x(t)')

title('Original analog signal');

subplot(3,1,2);

stem(n,xn)

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 48


REVA University School of ECE

xlabel('n')

ylabel('x(n)')

title('Nyquist sampled signal');

subplot(3,1,3);

plot(t,xt,'b',n,xn,'r*-');

xlabel('t')

ylabel('x(t) & xr(t)')

title('Reconstructed analog signal after nyquist sampling');

legend('original analog signal','reconstructed signal after sampling')

%condition for oversampling

fs=5*fm;

Ts=1/fs;

n=0:Ts:tfinal;

%Generate the oversampled signal

xn=cos(2*pi*f1*n)+cos(2*pi*f2*n);

%plot the analog & sampled signals

figure(3)

subplot(3,1,1);

plot(t,xt)

xlabel('t')

ylabel('x(t)')

title('Original analog signal');

subplot(3,1,2);

stem(n,xn)

xlabel('n')

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 49


REVA University School of ECE

ylabel('x(n)')

title('Over sampled signal');

subplot(3,1,3);

plot(t,xt,'b',n,xn,'r*-');

xlabel('t')

ylabel('x(t) & xr(t)')

title('Reconstructed analog signal after 0ver sampling');

legend('original analog signal','reconstructed signal after sampling')

Output:

Enter first analog frequency 100


Enter second analog frequency 200

Fig 1 : Under Sampling

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 50


REVA University School of ECE

Fig 2: Nyquist Rate Sampling

Fig 3: Over Sampling

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 51


REVA University School of ECE

TMS320C6713 DSK

The C6713 DSK has a TMS320C6713 DSP onboard that allows full-speed verification of code
with Code Composer Studio. The C6713 DSK provides:
 A USB Interface
 SDRAM and ROM
 An analog interface circuit for Data conversion (AIC)
 An I/O port
 Embedded JTAG emulation support

Connectors on the C6713 DSK provide DSP external memory interface (EMIF) and peripheral
signals that enable its functionality to be expanded with custom or third party daughter boards.
The DSK provides a C6713 hardware reference design that can assist you in the development
of your own C6713-based products. In addition to providing a reference for interfacing the
DSP to various types of memories and peripherals, the design also addresses power, clock,
JTAG, and parallel peripheral interfaces.
The C6713 DSK includes a stereo codec. This analog interface circuit (AIC) has the following
characteristics:

High-Performance Stereo Codec


 90-dB SNR Multibit Sigma-Delta ADC (A-weighted at 48 kHz)
 100-dB SNR Multibit Sigma-Delta DAC (A-weighted at 48 kHz)
 1.42 V – 3.6 V Core Digital Supply: Compatible With TI C54x DSP Core
Voltages
 2.7 V – 3.6 V Buffer and Analog Supply: Compatible Both TI C54x DSP
Buffer Voltages
 8-kHz – 96-kHz Sampling-Frequency Support

Software Control Via TI McBSP-Compatible Multiprotocol Serial Port


 I 2 C-Compatible and SPI-Compatible Serial-Port Protocols
 Glueless Interface to TI McBSPs

Audio-Data Input/output Via TI McBSP-Compatible Programmable Audio Interface


 I 2 S-Compatible Interface Requiring Only One McBSP for both ADC and
DAC
 Standard I 2 S, MSB, or LSB Justified-Data Transfers
 16/20/24/32-Bit Word Lengths

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 52


REVA University School of ECE

The C6713DSK has the following features:


The 6713 DSK is a low-cost standalone development platform that enables customers to
evaluate and develop applications for the TI C67XX DSP family. The DSK also serves as a
hardware reference design for the TMS320C6713 DSP. Schematics, logic equations and
application notes are available to ease hardware development and reduce time to market.
The DSK uses the 32-bit EMIF for the SDRAM (CE0) and daughter card expansion interface
(CE2 and CE3). The Flash is attached to CE1 of the EMIF in 8-bit mode.
An on-board AIC23 codec allows the DSP to transmit and receive analog signals. McBSP0 is
used for the codec control interface and McBSP1 is used for data. Analog audio I/O is done
through four 3.5mm audio jacks that correspond to microphone input, line input, line output
and headphone output. The codec can select the microphone or the line input as the active input.
The analog output is driven to both the line out (fixed gain) and headphone (adjustable gain)
connectors. McBSP1 can be re-routed to the expansion connectors in software.
A programmable logic device called a CPLD is used to implement glue logic that ties the board
components together. The CPLD has a register based user interface that lets the user configure
the board by reading and writing to the CPLD registers. The registers reside at the midpoint of
CE1.

The DSK includes 4 LEDs and 4 DIP switches as a simple way to provide the user with
interactive feedback. Both are accessed by reading and writing to the CPLD registers.
An included 5V external power supply is used to power the board. On-board voltage regulators
provide the 1.26V DSP core voltage, 3.3V digital and 3.3V analog voltages. A voltage
supervisor monitors the internally generated voltage, and will hold the board in reset until the
supplies are within operating specifications and the reset button is released. If desired, JP1 and
JP2 can be used as power test points for the core and I/O power supplies.
Code Composer communicates with the DSK through an embedded JTAG emulator with a
USB host interface. The DSK can also be used with an external emulator through the external
JTAG connector.

TMS320C6713 DSP Features

 Highest-Performance Floating-Point Digital Signal Processor (DSP):


 Eight 32-Bit Instructions/Cycle
 32/64-Bit Data Word
 300-, 225-, 200-MHz (GDP), and 225-, 200-, 167-MHz (PYP) Clock Rates
 3.3-, 4.4-, 5-, 6-Instruction Cycle Times
 2400/1800, 1800/1350, 1600/1200, and 1336/1000 MIPS /MFLOPS
 Rich Peripheral Set, Optimized for Audio
 Highly Optimized C/C++ Compiler
 Extended Temperature Devices Available

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 53


REVA University School of ECE

 Advanced Very Long Instruction Word (VLIW) TMS320C67x™ DSP Core


 Eight Independent Functional Units:
 Two ALUs (Fixed-Point)
 Four ALUs (Floating- and Fixed-Point)
 Two Multipliers (Floating- and Fixed-Point)
 Load-Store Architecture With 32 32-Bit General-Purpose Registers
 Instruction Packing Reduces Code Size
 All Instructions Conditional
 Instruction Set Features
 Native Instructions for IEEE 754
 Single- and Double-Precision
 Byte-Addressable (8-, 16-, 32-Bit Data)
 8-Bit Overflow Protection
 Saturation; Bit-Field Extract, Set, Clear; Bit-Counting; Normalization
 L1/L2 Memory Architecture
 4K-Byte L1P Program Cache (Direct-Mapped)
 4K-Byte L1D Data Cache (2-Way)
 256K-Byte L2 Memory Total: 64K-Byte L2 Unified Cache/Mapped RAM, and 192K-
Byte Additional L2 Mapped RAM
 Device Configuration
 Boot Mode: HPI, 8-, 16-, 32-Bit ROM Boot
 Endianness: Little Endian, Big Endian
 32-Bit External Memory Interface (EMIF)
 Glueless Interface to SRAM, EPROM, Flash, SBSRAM, and SDRAM
 512M-Byte Total Addressable External Memory Space
 Enhanced Direct-Memory-Access (EDMA) Controller (16 Independent Channels)
 16-Bit Host-Port Interface (HPI)
 Two Multichannel Audio Serial Ports (McASPs)
 Two Independent Clock Zones Each (1 TX and 1 RX)
 Eight Serial Data Pins Per Port:
Individually Assignable to any of the Clock Zones
 Each Clock Zone Includes:
 Programmable Clock Generator
 Programmable Frame Sync Generator
 TDM Streams From 2-32 Time Slots

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 54


REVA University School of ECE

 Support for Slot Size:


8, 12, 16, 20, 24, 28, 32 Bits
 Data Formatter for Bit Manipulation
 Wide Variety of I2S and Similar Bit Stream Formats
 Integrated Digital Audio Interface Transmitter (DIT) Supports:
 S/PDIF, IEC60958-1, AES-3, CP-430 Formats
 Up to 16 transmit pins
 Enhanced Channel Status/User Data
 Extensive Error Checking and Recovery
 Two Inter-Integrated Circuit Bus (I2C Bus™) Multi-Master and Slave Interfaces
 Two Multichannel Buffered Serial Ports:
 Serial-Peripheral-Interface (SPI)
 High-Speed TDM Interface
 AC97 Interface
 Two 32-Bit General-Purpose Timers
 Dedicated GPIO Module With 16 pins (External Interrupt Capable)
 Flexible Phase-Locked-Loop (PLL) Based Clock Generator Module
 IEEE-1149.1 (JTAG ) Boundary-Scan-Compatible
 Package Options:
 208-Pin PowerPAD™ Plastic (Low-Profile) Quad Flatpack (PYP)
 272-BGA Packages (GDP and ZDP)
 0.13-µm/6-Level Copper Metal Process
 CMOS Technology

 3.3-V I/Os, 1.2 -V Internal (GDP & PYP)


 3.3-V I/Os, 1.4-V Internal (GDP)(300 MHz only)

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 55


REVA University School of ECE

TMS320C6713 DSK Overview Block Diagram

INTRODUCTION TO CODE COMPOSER STUDIO


Code Composer is the DSP industry's first fully integrated development environment (IDE)
with DSP-specific functionality. With a familiar environment liked MS-based C++TM, Code
Composer lets you edit, build, debug, profile and manage projects from a single unified
environment. Other unique features include graphical signal analysis, injection/extraction of
data signals via file I/O, multi-processor debugging, automated testing and customization via a
C-interpretive scripting language and much more.

CODE COMPOSER FEATURES INCLUDE:


 IDE
 Debug IDE
 Advanced watch windows
 Integrated editor
 File I/O, Probe Points, and graphical algorithm scope probes
 Advanced graphical signal analysis
 Interactive profiling
 Automated testing and customization via scripting
 Visual project management system
 Compile in the background while editing and debugging
 Multi-processor debugging
 Help on the target DSP

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 56


REVA University School of ECE

Procedure for interfacing programs using CODE COMPOSER STUDIO6.1.3


2. Open Code Composer Studio 6.1.3 icon which is created on the desktop.

3. You will get workspace Launcher window in workspace select the drive other than
‘C’ and create a new folder by your SRN and click OK.

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 57


REVA University School of ECE

4. Click on project and select New CCS Project in that select the desired properties as
given in the picture and click on Finish button.

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 58


REVA University School of ECE

NOTE:
For real time programs select hello.cmd file and for non-real programs select C6713.cmd

5. Once you click on finish button you will get a CCS editor window, in that type the C
program and at the end click on SAVE button.

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 59


REVA University School of ECE

6. To rename the file name instead of main.c Right click on main.c which is in project
explorer window and select Rename icon or press F2 button.

7. You will get a new Rename Resource window there you give a new file name with
extension ‘.C’ and click ‘OK’.

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 60


REVA University School of ECE

8. Now to build the project click on HAMMER symbol which is on the top left
of editor window.

Note:
If any error occurs in the program that will be displayed in the console window which is at
the bottom of editor window. Clear that error again click on save button and repeat the same
above step.

9. After building the project to debug the program click on BUG symbol which is
on the top left of editor window.

10. Now to RUN the program click on Resume or F8 button which is on the top left
of editor window.

11. In the console window you can observe the output values.

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 61


REVA University School of ECE

For the very first time after installation of CCS software the following properties has to be
modified.

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 62


REVA University School of ECE

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 63


REVA University School of ECE

C PROGRAM TO GENERATE A SINE WAVE USING CCS STUDIO


AND TI PROCESSOR KIT

#include <stdio.h>
#include<math.h>

#define FREQ 500


float m[127];
void main()
{
int i=0;

for(i=0;i<127;i++)
{
m[i]=sin(2*3.14*FREQ*i/24000);
printf("%f\n",m[i]);
}
}

NOTE:

Procedure is given in page number 48 to run code composer studio v6.1.3. Follow the steps.

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 64


REVA University School of ECE

C PROGRAM TO COMPUTE THE LINEAR CONVOLUTION OF THE


GIVEN INPUT SEQUENCE x(n) & THE IMPULSE RESPONSE OF THE
SYSTEM h(n) USING USING CCS STUDIO AND TI PROCESSOR KIT

Linear Convolution Involves the following operations.


1. Folding 2. Multiplication 3. Addition 4. Shifting

These operations can be represented by a Mathematical Expression as follows:

x[ ]= Input signal Samples


h[ ]= Impulse response co-efficient.
y[ ]= Convolution output.
n = No. of Input samples
h = No. of Impulse response co-efficient.

Algorithm to implement ‘C’ or Assembly program for Convolution:


Eg: x[n] = {1, 2, 3, 4}
h[k] = {1, 2, 3, 4}
Where: n=4, k=4. : Values of n & k should be a multiple of 4.
If n & k are not multiples of 4, pad with zero’s to make multiples
of 4
r= n+k-1 : Size of output sequence.
= 4+4-1
= 7.
r= 0 1 2 3 4 5 6
n= 0 x[0]h[0] x[0]h[1] x[0]h[2] x[0]h[3]
1 x[1]h[0] x[1]h[1] x[1]h[2] x[1]h[3]
2 x[2]h[0] x[2]h[1] x[2]h[2] x[2]h[3]
3 x[3]h[0] x[3]h[1] x[3]h[2] x[3]h[3]

Output: y[r] = { 1, 4, 10, 20, 25, 24, 16}.


NOTE: At the end of input sequences pad ‘n’ and ‘k’ no. of zero’s

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 65


REVA University School of ECE

/* C program to implement linear convolution */


#include<stdio.h>
int y[20];

main()
{
int m=3; /*Length of i/p samples sequence*/
int n=4; /*Length of impulse response Co-efficient */
int i=0,j;
int x[15]={1,2,3,4,0,0,0,0,0,0}; /*Input Signal Samples*/
int h[15]={1,2,3,0,0,0,0,0,0}; /*Impulse Response Co-efficient*/
for(i=0;i<m+n-1;i++)
{
y[i]=0;
for(j=0;j<=i;j++)
y[i]+=x[j]*h[i-j];
}
for(i=0;i<m+n-1;i++)
printf("%d\n",y[i]);
}

Calculations:
x[n] = [1 2 3 4]—> L1=4 h[n] = [1 2 3]—> L2=3
L=L1+L2-1 => 4+3-1=>6 L=6
y[n]=x[n].h[n]

y[n]= Σ x[n].h[n]
-∞
Now,
5
y[n]= Σ x[n].h[n]
K=0

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 66


REVA University School of ECE

5
n=0, y[0] = Σ x[k].h[0-k]
K=0

y[0] = 1
5
n=1, y[1] = Σ x[0].h[1-k]
K=0

=>(1)(2)+(2)(1) =>2+2
y[1] = 4
5
n=2, y[2] = Σ x[0].h[2-k]
K=0

=> (1)(3)+(2)(2)+(3)(1) => 3+4+3


y[2]= 10

5
n=3, y[3] = Σ x[0].h[3-k]
K=0

=>(2)(3)+(3)(2)+(4)(1) => 6+6+4


y[3]= 16

5
n=4, y[4] = Σ x[0].h[4-k]
K=0

=>(3)(3)+(4)(2) =>9+8 => 17


y[4] = 17

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 67


REVA University School of ECE

5
n=5, y[5] = Σ x[0].h[5-k]
K=0

=>(4)(3) =>12
y[5]= 12

y[n] = [1 4 10 16 17 12]

LINEAR CONVOLUTION GRAPH PROPERTIES SETTING:

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 68


REVA University School of ECE

Result: y(n) = {1 4 10,16,17,12}

NOTE:

Procedure is given in page number 48 to run code composer stu dio v6.1.3.
Follow the steps.

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 69


REVA University School of ECE

SAMPLE VIVA QUESTIONS

1. What is the function of ‘clc’ in matlab tool? CLC


clears the command window and homes the cursor.

2. What is the function of ‘clear all’ in matlab tool?


CLEAR removes all variables from the workspace.

3. What is the function of ‘close all’ in matlab tool?


CLOSE ALL closes all the open figure windows.

4. What is the function of ‘figure’ in matlab tool?


FIGURE, by itself, creates a new figure window, and returns its handle.

5. What is the function of ‘subplot’ in matlab tool?


Subplot divides the figure window into rows, columns and position For example
subplot(3,1,1) means the figure window divides into 3 rows, 1column and 1st position.

6. What is the function of ‘plot’ in matlab tool?


PLOT Linear plot.
PLOT(X,Y) plots vector Y versus vector X. If X or Y is a matrix, then the vector is plotted
versus the rows or columns of the matrix, which ever line up. If X is a scalar and Y is a
vector, length (Y) disconnected points are plotted.

7. What is the function of ‘stem’ in matlab tool?


STEM Discrete sequence or "stem" plot.
STEM(Y) plots the data sequence Y as stems from the x axis terminated with circles for the
data value. STEM(X,Y) plots the data sequence Y at the values specified in X.

8. What is the function of ‘xlabel’ in matlab tool?


XLABEL X-axis label. XLABEL('text') adds text beside the X-axis on the current axis.

9. What is the function of ‘ylabel’ in matlab tool?


YLABEL Y-axis label. YLABEL('text') adds text beside the Y-axis on the current axis.

10. What is the function of ‘title’ in matlab tool?


TITLE Graph title. TITLE('text') adds text at the top of the current axis.

11. What is the function of ‘conv’ in matlab tool?


CONV Convolution and polynomial multiplication.
C = CONV(A, B) convolves vectors A and B. The resulting vector is
LENGTH(A)+LENGTH(B)-1

Signals and Systems Lab Manual - B20EN0502 Sem:V P a g e | 70


Rukmini Knowledge Park, Kattigenahalli
Yelahanka, Bengaluru - 560 064 Karnataka,
India.

Ph: +91- 90211 90211, +91 80 4696 6966


E-mail: [email protected]

Follow us on

/REVAUniversity

You might also like