0% found this document useful (0 votes)
22 views53 pages

Signals & Systems Lab Manual ECE

The document is a student manual for the Signals & Systems Lab for II B.Tech (ECE) II Semester at Raghu Engineering College. It outlines course details, objectives, outcomes, and a list of experiments to be conducted, along with evaluation criteria and instructions for students. The lab focuses on understanding signals and systems through practical applications and various transform techniques.

Uploaded by

mukeshbalaga2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views53 pages

Signals & Systems Lab Manual ECE

The document is a student manual for the Signals & Systems Lab for II B.Tech (ECE) II Semester at Raghu Engineering College. It outlines course details, objectives, outcomes, and a list of experiments to be conducted, along with evaluation criteria and instructions for students. The lab focuses on understanding signals and systems through practical applications and various transform techniques.

Uploaded by

mukeshbalaga2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SIGNALS & SYSTEMS LAB

Student Manual

II [Link] (ECE) II Semester


AR20 Regulation

Prepared by
Dr. [Link] Babu
Professor
Mr.P. Jagan Mohan
Asst Professor
Dept of ECE

Lab Incharge
[Link] Bhavani
Asst Professor
Dept of ECE

Department of Electronics and Communication Engineering


RAGHU ENGINEERING COLLEGE (Autonomous)
(Approved by AICTE, New Delhi & Permanently Affiliated to JNTU, Kakinada)
NBA and NAAC ‘A’ grade accredited Institute.
Dakamarri, Bheemili Mandal, Visakhapatnam – 531162, A.P.
Phone: 08922-248001 / 221122/9963981111, [Link]
RAGHU ENGINEERING COLLEGE (Autonomous)
(Approved by AICTE, New Delhi & Permanently Affiliated to JNTU, Kakinada)
Dakamarri, Bheemili Mandal, Visakhapatnam – 531162, A.P.
Phone: 08922-248001 / 221122/9963981111, [Link]

Course Details

Laboratory Name : SIGNALS &SYSTEMS LAB

Lab Code : 20EC4106

Regulation : AR20

Year : II [Link]

Semester : II

Program : Electronics & Communication Engineering

Periods/week : 3

Credits : 2

Faculty In-charge : Dr. [Link] Babu


Professor
[Link]
Assoc Professor
Dept of ECE

Prepared by Checked by

Dr. [Link] Babu [Link]


Professor IQAC Member
Dept of ECE Associate Professor
Dept of ECE

Approved by

Mr. K. Phaninder Vinay


Professor & Head
Dept of ECE
Department of Electronics & Communication Engineering
Vision

To grow into a premier engineering department with excellence in teaching, research, and innovation in
the field of Electronics and Communication Engineering at par with the global industrial standards
catering to the needs of the stakeholders while keeping up with the advancing technology.

Mission
To provide excellence in education, research and public services; to provide a creative environment
through structured teaching and learning process; to impart employability-focused education while
imbibing the spirit of entrepreneurship; to inculcate self learning attitude, management skillsand
professional ethics.

Program Educational Objectives (PEOs):

Domain To have the knowledge and technical skills required to be and to


PEO I
Knowledge remain productive.

Communication To apply technical knowledge and skills as electronics and


PEO II Skills & communication engineers to provide effective solutions in industrial
Employability and governmental organizations.
To achieve success with awareness of entrepreneurship skills and
Life Long
have the ability for lifelong learning by pursuing professional
PEO III Learning & Social
development to meet the emerging and evolving demands to have a
Concern
successful career.

Program Specific Outcomes (PSOs):

Understand and apply the fundamental concepts of Basic and Engineering Sciences for
appropriate up-skilling in the fast-emerging fields of Signal Processing, Image
PSO: 1
Processing, Communication, Networking, VLSI, Embedded Systems, Analog and Digital
Technologies to meet the futuristic industrial achievements.

Apply latest hardware and software tools to solve complex electronics and
communication engineering problems along with analytical skills to derive appropriate
PSO: 2
solutions in the real time applications across varied business and administrative functions.

Signals & Systems Lab, Dept of ECE, Raghu Engineering College, Visakhapatnam i
Program Outcomes (POs)

Engineering knowledge: Apply the knowledge of mathematics, science, engineering


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

Signals & Systems Lab, Dept of ECE, Raghu Engineering College, Visakhapatnam ii
RAGHU ENGINEERING COLLEGE (AUTONOMOUS)
(Approved by AICTE, New Delhi & Permanently Affiliated to JNTU Kakinada, Accredited by
NBA, NAAC 'A' grade)

II Year – II SEMESTER L T P C
0 0 3 2
SIGNALS &SYSTEMS LABORATORY

LIST OF EXPERIMENTS:

List of Experiments:

1. To generate sinusoidal signal, delta function, unit step function and periodic signals.
2. To perform arithmetic operations: addition, subtraction and multiplication on continuous-time signals.
3. To perform continuous-time signal operations: time shifting, time scaling, and computation of energy and power.
4. To synthesize periodic signals using Fourier series.
5. To write a program to find the trigonometric and exponential Fourier series coefficients of a periodic rectangular
signal. Plot the discrete spectrum of the signal.
6. To Find Fourier Transform and Inverse Fourier Transform of a given signal and plot its Magnitude and Phase
Spectra.
7. To compute and plot the impulse response and pole-zero diagram of transfer function
using Laplace transform.
8. To compute the linear convolution of continuous-time signals and verify its properties.
9. To compute auto correlation and cross correlation between continuous-time signals and verify its properties.
10. To verify the sampling theorem.
11. To compute and plot the impulse response and pole-zero diagram of transfer function
using Z-transform.
ADDITIONAL EXPERIMENT
12. Write a program to generate Complex Gaussian noise and find its mean, variance, Probability Density Function
(PDF) and Power Spectral Density (PSD).
13. Write a program to find response of a low pass filter and high pass filter, when a speech signal is
passed through these filters.

Equipment required:
1. MATLAB / SCI Lab / EquivalentIndustrialStandardLicensedsimulationsoftware tool.
2. Computer Systems with required specifications
Note: - Minimum of 10 experiments has to be conducted.

Signals & Systems Lab, Dept of ECE, Raghu Engineering College, Visakhapatnam iii
Course Objectives:
• Understand the basic ideas of the signals and systems encountered in engineering.
• Learn various transform techniques that are useful for the understanding of spectral characteristics of
signals.
• Characterize and analyze continuous time signals and systems
Course Outcomes (CO):
1. Generate and characterize various continuous and discrete time signals.
2. Perform basic arithmetic operations on the signals.
3. Analyze the spectral characteristics of signals using Fourier analysis
4. Compute the output response of a LTI system.
5. Analyze the systems using Laplace transform and Z-transform.
Course Pre-requisites:
1. Engineering Mathematics
Books Recommended:

A student who successfully fulfils this course requirement will be able to:
[Link] Course Outcome BTL
1. Generate and characterize various continuous and discrete time signals. L5
2. Perform basic arithmetic operations on the signals. L3
3. Analyze the spectral characteristics of signals using Fourier analysis L4
4. Compute the output response of a LTI system. L3
5. Analyze system characteristics using Laplace transform and Z-transform. L4

CO-PO Mapping(with weightage)

COURSE PO
OUTCOME PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
CO-1 3 1 - - 1 - - - 3 - - -

CO-2 3 2 - - 2 - - - 3 - - -
CO-3 3 3 1 1 2 - - - 3 - - -
CO-4 3 3 1 1 2 - - - 3 - - -
CO-5 3 2 1 1 2 - - - 3 - - -

Signals & Systems Lab, Dept of ECE, Raghu Engineering College, Visakhapatnam iv
CO-PSO Mapping (with weightage)

Course PSO
Outcome PSO1 PSO2
CO-1 3 3
CO-2 3 3
CO-3 3 3
CO-4 3 3
CO-5 3 3

Mapping of each Lab experiment with POs:


[Link]. Name of the Experiment Relevance to Relevance to Mapping of POs
theoretical concept other courses
1. To generate sinusoidal signal, Classification of Digital 1,2,5,9
delta function, unit step Signals Signal
function and periodic signals. Processing,
2. To perform arithmetic operations: Operation of Digital 1,2,5,9
addition, subtraction and signals Signal
multiplication on continuous-time Processing,
signals. Digital
image
processing
3. To perform continuous-time signal Operations on Digital 1,2,5,9
operations: time shifting, time signals: time- Signal
scaling, and computation of energy shifting, time- Processing,
and power. scaling, amplitude-
shifting, amplitude-
scaling
4. To synthesize periodic signals using Fourier Digital 1,2,3,4,5,9
Fourier series. series Signal
analysis of Processing
CT Signals
5. To write a program to find the Fourier series Digital 1,2,3,4,5,9
trigonometric and exponential analysis of CT Signal
Fourier series coefficients of a Signals Processing
periodic rectangular signal. Plot
the discrete spectrum of the
signal.

Signals & Systems Lab, Dept of ECE, Raghu Engineering College, Visakhapatnam v
6. To Find Fourier Transform and Fourier transform Digital 1,2,3,4,5,9
Inverse Fourier Transform of a of arbitrary signals Signal
given signal and plot its Processing
Magnitude and Phase Spectra.
7. To compute and plot the Transfer function Digital Signal 1,2,3,4,5,9
impulse response and pole- Laplace transform Processing
zero diagram of transfer
function using Laplace
transform.
8. To compute the linear convolution Types of Digital 1,2,3,4,5,9
of continuous-time signals and Convolution Signal
verify its properties. between the Processing.
signals Digital
image
processing
9. To compute auto correlation and Circular Digital 1,2,3,4,5,9
cross correlation between convolution of a Signal
continuous-time signals and signal Processing.
verify its properties. Digital
image
processing
10. To verify the sampling theorem. Sampling Theorem Digital 1,2,3,4,5,9
Signal
Processing.
Digital
image
processing
11. To compute and plot the Z-Transform (ZT) Digital Signal 1,2,3,4,5,9
impulse response and pole- & its ROC Processing.
zero diagram of transfer
function
using Z-transform.
12. Write a program to generate Signal Probability 1,2,5,9
Complex Gaussian noise and find approximation thoery
its mean, variance, Probability Stochstic
Density Function (PDF) and process
Power Spectral Density (PSD).
13 Write a program to find response LTI systems Digital 1,2,3,4,5,9
of a low pass filter and high pass analysis Signal
filter, when a speech signal Processing
is passed through these filters

Signals & Systems Lab, Dept of ECE, Raghu Engineering College, Visakhapatnam vi
Evaluation of Marks for the Laboratory Exam:
a) For Laboratory Courses there should be continuous evaluation during the semester for 15
Internal Marks. The distribution of Internal Marks is given below.

[Link] Criteria Marks


1 Day-wise Performance 5
2 Record Submission 5
3 Internal Examination 5
Total Marks 15
b) Each semester end lab examination shall be evaluated by an external examiner along with an
internal examiner for 35 Marks.
c) Final lab examination marks are the sum of marks obtained in both internal and external exams
for a total of 50 Marks.

Instructions to the Students:


1. Do not handle any equipment without reading the instructions /Instruction manuals.
2. Strictly observe the instructions given by the Teacher/ Lab Instructor.
3. It is mandatory to come to lab in a formal dress (Shirts, Trousers, ID card, and Shoes for boys).
Strictly no Jeans for both Girls and Boys.
4. It is mandatory to come with observation book and lab record in which previous experiment
should be written in Record and the present lab’s experiment in Observation book.
5. Observation book of the present lab experiment should be get corrected on the same day and
Record should be corrected on the next scheduled lab session.
6. Mobile Phones should be Switched OFF in the lab session.
7. Students have to come to lab in-time. Late comers are not allowed to enter the lab.
8. Prepare for the viva questions. At the end of the experiment, the lab faculty will ask the viva
questions and marks are allotted accordingly.
9. Bring all the required stationery like graph sheets, pencil & eraser, different color pens etc. for
the lab class.

Signals & Systems Lab, Dept of ECE, Raghu Engineering College, Visakhapatnam vii
INDEX

[Link] Description Page No.

1 To generate sinusoidal signal, delta function, unit step function ………....12


and periodic signals.
2 To perform arithmetic operations: addition, subtraction and multiplication
on continuous-time signals……………………………………………………… ..17
3 To perform continuous-time signal operations: time shifting, time
scaling, and computation of energy and power……………………………………20

4 To synthesize periodic signals using Fourier series………………………………..26

5 To write a program to find the trigonometric and exponential Fourier series


coefficientsof a periodic rectangular signal. Plot the discrete spectrum of the
signal……………………………………………………………………………….29

6 To Find Fourier Transform and Inverse Fourier Transform of a given signal


and plot its Magnitude and Phase Spectra………………………………………….32

7 To compute and plot the impulse response and pole-zero diagram of


transfer functionusing Laplace transform…………………………………………..35

8 To compute the linear convolution of continuous-time signals and


verify its properties…………………………………………………………………38

9 To compute auto correlation and cross correlation between continuous-time signals


and verify its properties………………………………………………………… …41

10 To verify the sampling theorem……………………………………………………44

11 To compute and plot the impulse response and pole-zero diagram of


transfer functionusing Z-transform…………………………………………………46

ADDITIONAL EXPERIMENTS:

12 Write a program to generate Complex Gaussian noise and find its mean, variance,
Probability Density Function (PDF) and Power Spectral Density (PSD)………….48

13 Write a program to find response of a low pass filter and high pass filter, when a speech
signal is passed through these filters………………………………………………… ……50

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 8
MATLAB INTRODUCTION

MATLAB, which stands for Matrix Laboratory, is a state-of-the-art mathematical software


package, which is used extensively in both academia and industry. It is an interactive program for
numerical computation and data visualization, which along with its programming capabilities provides
a very useful tool for almost all areas of science and engineering. Unlike other mathematical packages,
such as MAPLE or MATHEMATICA, MATLAB cannot perform symbolic manipulations without the
use of additional Toolboxes. It remains however, one of the leading software packages for numerical
computation. As you might guess from its name, MATLAB deals mainly with matrices. A scalar is a
1-by-1 matrix and a row vector of length say 5, is a 1-by-5 matrix.. One of the many advantages of
MATLAB is the natural notation used. It looks a lot like the notation that you encounter in a linear
algebra. This makes the use of the program especially easy and it is what makes MATLAB a natural
choice for numerical computations. The purpose of this experiment is to familiarize MATLAB, by
introducing the basic features and commands of the program. MATLAB is case-sensitive, which means
that a + B is not the same as a + b. The MATLAB prompt (») in command window is where the
commands are entered.
Operators:
1. + addition
2. -subtraction
3. * multiplication
4. ^ power
5. ' transpose
6. \ left division
7. / right division
Remember that the multiplication, power and division operators can be used in conjunction with
a period to specify an element-wise operation.
Built in Functions:
1. Scalar Functions:
Certain MATLAB functions are essentially used on scalars, but operate element-wise when
applied to a matrix (or vector). They are summarized below.
1. sin -trigonometric sine
2. cos -trigonometric cosine
3. tan -trigonometric tangent
4. asin -trigonometric inverse sine (arcsine)

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 9
5. acos -trigonometric inverse cosine (arccosine)
6. atan -trigonometric inverse tangent (arctangent)
7. exp -exponential
8. log -natural logarithm
9. abs -absolute value 10. sqrt -square root
11. rem -remainder 12. round -round towards nearest integer
13. floor -round towards negative infinity 14. ceil -round towards positive infinity
2. Vector Functions:
Other MATLAB functions operate essentially on vectors returning a scalar value. Some of
these functions are given below.
1. max largest component : get the row in which the maximum element lies
2. min smallest component
3. length length of a vector
4. sort sort in ascending order
5. sum sum of elements
6. prod product of elements
7. median median value
8. mean mean value std standard deviation
3. Matrix Functions:
Much of MATLAB’s power comes from its matrix functions. These can be further separated into
two sub-categories. The first one consists of convenient matrix building functions, some of
which are given below.
1. eye -identity matrix
2. zeros -matrix of zeros
3. ones -matrix of ones
4. diag -extract diagonal of a matrix or create diagonal matrices
5. triu -upper triangular part of a matrix
6. tril -lower triangular part of a matrix
7. rand -randomly generated matrix
eg: diag([0.9092;0.5163;0.2661])
ans =
0.9092 0 0
0 0.5163 0
0 0 0.2661

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 10
Commands in the second sub-category of matrix functions are
1. size size of a matrix
2. det determinant of a square matrix
3. inv inverse of a matrix
4. rank rank of a matrix
5. rref reduced row echelon form
6. eig eigenvalues and eigenvectors

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 11
EXPERIMENT-1: GENERATION OF BASIC SIGNALS

Aim: To write a MATLAB program to generate sinusoidal signal, delta function, unit step function and periodic
signals.
Software Required: MATLAB
Theory
Unit Impulse
A unit impulse signal is defined by the equation (2.1)

1, n = 0
( n ) =  ` (1.1)
0 , otherwise

Unit Step Function


A unit step function is as defined in equation (2.2)
1, n  0
u[ n ] =  (1.2)
0, n  0
Sinusoidal Signal
A sinusoidal signal is defined in equation (2.3)
x[ n ] = A sin( 2 n +  ), −   n   (1.3)
Exponential Signal
An exponential is defined in equation (2.4)

x[ n] = C exp an (1.4)
Unit Ramp
A unit ramp function is defined in equation (2.5)

n, n  0
r( n ) =  (1.5)
0 , n  0
Procedure
1. Launch MATLAB and set the desktop layout to ‘default’
2. Open a new MATLAB script from the tool bar
3. Edit the MATLAB program
4. Save and Run the script using the play button or F5 key
5. Verify the results in the figure window

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 12
6. Save the figure window using the option “save as *.jpg”

MATLAB Program
% unit impulse function %
clc;
clear all;
close all;
t=-[Link];
x=(t==0);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('unit impulse function');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('unit impulse discrete function');

% unit step function %


% clc;
% clear all;
% close all;
N=100;
t=1:100;
x=ones(1,N);
figure; subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('unit step function');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('unit step discrete function');

% sinusoidal function %
% clc;
% clear all;

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 13
% close all;
t=0:0.01:2;
x=sin(2*pi*t);
figure; subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('sinusoidal sequence');

% unit ramp function %


% clc;
% clear all;
% close all;
t=0:20;
x=t;
figure; subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('unit ramp function');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('unit ramp discrete function');

% square function %
% clc;
% clear all;
% close all;
t=0:0.01:2;
x=square(2*pi*t);
figure; subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('square signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 14
ylabel('amplitude');
title('square sequence');

% sawtooth function %
% clc;
% clear all;
% close all;
t=0:0.01:2;
x=sawtooth(2*pi*5*t);
figure; subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sawtooth signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('sawtooth sequence');

% sinc function %
% clc;
% clear all;
% close all;
t=linspace(-5,5);
x=sinc(t);
figure; subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sinc signal');
subplot(2,1,2);
stem(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('sinc sequence');

% Aperiodic rectangular pulse %


% clc;
% clear all;
% close all;
t=-10:0.5:10;
pulse = rectpuls(t,2); %pulse of width 2 time units
figure; subplot(2,1,1);
plot(t,pulse,'g');
Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 15
xlabel('Time (sec)');
ylabel('Amplitude');
title('continuous rectangular pulse Aperiodic Wave');
subplot(2,1,2);
stem(t,pulse','r');
xlabel('Time (sec)');
ylabel('Amplitude');
title('Discrete rectangular pulse Aperiodic Wave');

% signum function %
% clc;
% clear all;
% close all;
t=-10:0.5:10;
pulse = sign(t);
figure; subplot(2,1,1);
plot(t,pulse,'g');
xlabel('time ');
ylabel('amplitude');
title('continuous signum Wave');
subplot(2,1,2);
stem(t,pulse,'r');
xlabel('time ');
ylabel('amplitude');
title('Discrete signum Sequence');

Expected Output:

Result:

Viva Questions:

1. Define signal.
2. Give few examples of DT signals.
3. Define Random signal.
4. Define power and energy signals.
5. Define odd and even signal.

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 16
EXPERMENT NO-2
ARITHMETIC OPERATIONS ON SIGNALS

AIM : To perform arithmetic operations: addition, subtraction and multiplication on continuous-time


signals

APPARATUS REQUIRED:

HARDWAR: Personal

ComputerSOFTWARE:

MATLAB

Theory:
Basic Operation on Signals:

Addition: Any two signals (𝑋(𝑡) 𝑎𝑛𝑑 𝑌(𝑡) ) can be added to form a third signal (𝑍(𝑡)) and it is given
by equation (2.1)
𝑍 (𝑡 ) = 𝑋 (𝑡 ) + 𝑌 (𝑡 ) (2.1)
Multiplication: Any two signals (𝑋(𝑡) 𝑎𝑛𝑑 𝑌(𝑡) ) can be multiplied to form a third signal (𝑍(𝑡)) and
it is given by equation (2.2)
𝑍 (𝑡 ) = 𝑋 (𝑡 ) × 𝑌 (𝑡 ) (2.2)

PROCEDURE:
1. Start the MATLAB program.

2. Open new M-file

3. Type the program

4. Save in current directory

5. Compile and Run the program

6. If any error occurs in the program correct the error and run it again

7. For the output see command window\ Figure window

8. Stop the program.

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 17
MATLAB Program
clear all;
close all;
t=0:.01:1;
% generating two input signals
x1=sin(2*pi*4*t);
x2=sin(2*pi*8*t);
subplot(2,2,1);
plot(t,x1);
xlabel('time');
ylabel('amplitude');
title('signal1:sine wave of frequency 4Hz');
subplot(2,2,2);
plot(t,x2);
xlabel('time');
subplot(4,1,3);
ylabel('amplitude');
title('signal2:sine wave of frequency 8Hz');

% addition of signals
y1=x1+x2;
subplot(2,2,3);
plot(t,y1);
xlabel('time');
ylabel('amplitude');
title('resultant signal:signal1+signal2');

% multiplication of signals
y2=x1.*x2;
subplot(2,2,4);
plot(t,y2);
xlabel('time');
ylabel('amplitude');
title('resultant signal: dot product of signal1 and signal2');

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 18
Expected Result:

RESULT:

VIVA QUESTIONS:

1. Define shift invariance.


2. Define Causal and non-Causal systems.
3. What is the periodicity of x(t) = ej100Πt + 30o?
4. Is the discrete time system describe by the equation y (n) = x(-n) causal or non causal ? Why?
5. Define impulse.

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 19
EXPERMENT NO-3
To perform continuous-time signal operations: time shifting, time scaling, and
computation of energy and power.

1. AIM : To perform continuous-time signal operations: time shifting, time scaling, and computation of energy
and power.

APPARATUS REQUIRED:

HARDWAR: Personal

ComputerSOFTWARE:

MATLAB

Theory:
Scaling (Amplification): The amplification of the signal 𝑋 (𝑡) yields 𝑎𝑋(𝑡) and it is given by equation
(3.1)
𝑍(𝑡) = 𝑎𝑋(𝑡) (3.1)
Time shifting: If 𝑇 is a positive number, the time shifted signal, 𝑋(𝑡 − 𝑇) gets shifted to the right,
otherwise it gets shifted left.
Time shifting is as defined in equation (3.2)
𝑍(𝑡) = 𝑋(𝑡 − 𝑇) (3.2)

Time reversal or folding: The time reversal of the signal 𝑋 (𝑡) yields𝑋(−𝑡). The mirror image of the
𝑋(𝑡) about the vertical axis is 𝑋(−𝑡)and it is given by equation (3.3).
𝑍(𝑡) = 𝑋(−𝑡) (3.3)
Energy and Power signal:

A signal can be categorized into energy signal or power signal: An energy signal has a
finite energy, 0 < E < ∞. In other words, energy signals have values only in the limited
time duration. For example, a signal having only one square pulse is energy signal. A
signal that decays exponentially has finite energy, so, it is also an energy signal. The
power of an energy signal is 0, because of dividing finite energy by infinite time (or
length).

On the contrary, the power signal is not limited in time. It always exists from beginning to
end and it never ends. For example, sine wave in infinite length is power signal. Since the
Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 20
energy of a power signal is infinite, it has no meaning to us. Thus, we use power
(energy per given time) for power signal, because the power of power signal is
finite, 0 < P < ∞.

PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file

3. Type the program

4. Save in current directory

5. Compile and Run the program

6. If any error occurs in the program correct the error and run it again

7. For the output see command window\ Figure window

8. Stop the program.

MATLAB Program
clear all;
close all;
t=0:.01:1;
% generating two input signals
x1=sin(2*pi*4*t);
x2=sin(2*pi*8*t);
subplot(2,2,1);
plot(t,x1);
xlabel('time');
ylabel('amplitude');
title('signal1:sine wave of frequency 4Hz');
subplot(2,2,2);
plot(t,x2);
xlabel('time');
subplot(4,1,3);
ylabel('amplitude');
title('signal2:sine wave of frequency 8Hz');

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 21
% scaling of a signal1
A=10;
y3=A*x1;
figure;
subplot(2,2,1);
plot(t,x1);
xlabel('time');
ylabel('amplitude');
title('sine wave of frequency 4Hz')
subplot(2,2,2);
plot(t,y3);
xlabel('time');
ylabel('amplitude');
title('amplified input signal1 ');

% folding of a signal1
l1=length(x1);
nx=0:l1-1;
subplot(2,2,3);
plot(nx,x1);
xlabel('nx');
ylabel('amplitude');
title('sine wave of frequency 4Hz')
y4=fliplr(x1);
nf=-fliplr(nx);
subplot(2,2,4);
plot(nf,y4);
xlabel('nf');
ylabel('amplitude');
title('folded signal');

%shifting of a signal
figure;
t1=0:.01:pi;
x3=8*sin(2*pi*2*t1);
subplot(3,1,1);
plot(t1,x3);
xlabel('time t1');
ylabel('amplitude');
title('sine wave of frequency 2Hz');
subplot(3,1,2);
plot(t1+10,x3);

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 22
xlabel('t1+10');
ylabel('amplitude');
title('right shifted signal');
subplot(3,1,3);
plot(t1-10,x3);
xlabel('t1-10');
ylabel('amplitude');
title('left shifted signal');

%operations on sequences
n1=[Link];
s1=[1 2 3 0 5 8 0 2 4];
figure;
subplot(2,2,1);
stem(n1,s1);
xlabel('n1');
ylabel('amplitude');
title('input sequence1');
n2=-[Link];
s2=[1 1 2 4 6 0 5 3 6];
subplot(2,2,2);
stem(n2,s2);
xlabel('n2');
ylabel('amplitude');
title('input sequence2');

% scaling of a sequence
figure;
subplot(2,2,1);
stem(n1,s1);
xlabel('n1');
ylabel('amplitude');
title('input sequence1');
s5=4*s1;
subplot(2,2,2);
stem(n1,s5);
xlabel('n1');
ylabel('amplitude');
title('scaled sequence1');
subplot(2,2,3);
stem(n1-2,s1);
xlabel('n1');

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 23
ylabel('amplitude');
title('left shifted sequence1');
subplot(2,2,4);
stem(n1+2,s1);
xlabel('n1');
ylabel('amplitude');
title('right shifted sequence1');

% folding of a sequence
l2=length(s1);
nx1=0:l2-1;
figure;
subplot(2,1,1);
stem(nx1,s1);
xlabel('nx1');
ylabel('amplitude');
title('input sequence1');
s6=fliplr(s1);
nf2=-fliplr(nx1);
subplot(2,1,2);
stem(nf2,s6);
xlabel('nf2');
ylabel('amplitude');
title('folded sequence1');

% Energy and power of a signal

clc; clear all; close all;


%energy of a signal
N=input('enter the value of N');
n=-N:N; x=cos((pi*n)/2);
E=sum(norm(x)^2);
disp('energy is');
disp(E);
%power of a signal p=E/((2*N)+1);
disp('power is'); disp(p);

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 24
Expected Result:

RESULT:

VIVA QUESTIONS:

1. What is the difference between power signal and energy signal in terms of energy and power?
2. How can you differentiate signal and wave?
3. What is the basic difference between amplitude and magnitude?

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 25
EXPERIMENT-4: SIGNAL SYNTHESIS USING FOURIER SERIES

AIM: - To write a MATLAB program to synthesize periodic signals using Fourier series.

SOFTWARE REQURIED: MATLAB

THEORY:-
According to the important theorem formulated by the French mathematician Jean Baptiste
Joseph Baron Fourier, any periodic function, no matter how trivial or complex, can be expressed
in terms of converging series of combinations of sines and/or cosines, known as Fourier series.
Therefore, any periodic signal is a sum of discrete sinusoidal components
The Fourier theorem is fairly general and also applies to periodic functions that have
discontinuities and cannot be represented by a single analytical expression. For a periodic
function f(x), provided that the following conditions are satisfied (Dirichlet conditions):

(a) f(x) is defined and single-valued except (perhaps) at a finite number in (-T, T),
(b) f(x) is periodic outside (-T, T) with period 2T,
(c) f(x) and f΄(x) are piecewise continuous in (-T, T), then f(x) can be expressed by the
following series:

where

Procedure
1. Launch MATLAB and set the desktop layout to ‘default’
2. Open a new MATLAB script from the tool bar
3. Edit the MATLAB program
4. Save and Run the script using the play button or F5 key
5. Verify the results in the figure window
6. Save the figure window using the option “save as *.jpg”

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 26
MATLAB Program
clc;
clear all;
close all;

% Time period entries


t1 = input('Enter from time: ');
t2 = input('Enter to time: ');

% Number of coefficients is set to 32(-[Link].it can be changed it if more are required


% Time period
T = t2 - t1;
% Range of the function variable
k = (t1):0.001:(t2);

% Function
f = (3.*cos(k));

% Fourier Series Coefficients


%Cn

Cn = zeros(1, 31); % Number of fourier series coefficients


C = 0;
j = 1;
for n = -[Link] % Number of coefficients
c = zeros(1, length(k));
for u = [Link]length(k)
c(u) = f(u)* exp( (-1i*2*pi*n*k(u)) / T );
end
C = (1/T) * trapz(k, c); % Using trapizoidal form of integration
Cn(j) = C;
j = j+1;
end

% Using the fourier series coefficients fourier series can be written


% Reconstruction of the function using the fourier series coefficients
S = zeros(1, length(k));
for h = [Link]length(k)
n = 1;
Su = 0;
for b = -[Link] % Number of coefficients
Su = Su + (Cn(n)* exp( (1i*2*pi*b*k(h)) / T ));
n = n+1;
end
Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 27
S(h) = Su;
end

% plotting function
subplot(2,2,1);
plot(k*(180/pi),f);
title('original signal');
grid on;

% plotting coefficients
% real
v = -[Link]; % Number of fourier series coefficients
subplot(2,2,2);
plot(v, real(Cn));
grid on;
xlim([-16, 16]);
title('real coefficients ');

%imaginary
v = -[Link]; % Number of fourier series coefficients
subplot(2,2,3);
plot(v, imag(Cn));
grid on;
title('imaginary coefficients ');

% plotting reconstruction
subplot(2,2,4);
plot(k*(180/pi),S);
title('reconstructed signal');
grid on;

% Displaying coefficients, real values, imaginary values, magnitude, phase


disp(Cn);
disp(real(Cn));
disp(imag(Cn));
disp(abs(Cn));
disp(angle(Cn));

Expected Output:
Result:

Vi va Questions:
1. Define Gibb’s Phenomenon?
2. What are Dirichlet’s condition?
3. Why do we do Fourier Transform?

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 28
EXPERIMENT-5: FINDING TFS AND EFS COEFFICIENTS

AIM: - Write a program to find the trigonometric & exponential Fourier series coefficients of a
rectangular periodic signal. Reconstruct the signal by combining the Fourier series coefficients with
appropriate weightages - Plot the discrete spectrum of the signal

SOFTWARE REQUIRED: MATLAB

THEORY:-

Theory: to compute the trigonometric fourier series coefficients of a periodic square wave time signal that has
a value of 2 from time 0 to 3 and a value of -12 from time 3 to 6. It then repeats itself. I am trying to calculate
in MATLAB the fourier series coefficients of this time signal and am having trouble on where to begin.

The equation is x(t) = a0 + sum(bk*cos(2*pi*f*k*t)+ck*sin(2*pi*f*k*t))


The sum is obviously from k=1 to k=infinity. a0, bk, and ck are the coefficients

Procedure
1. Launch MATLAB and set the desktop layout to ‘default’
2. Open a new MATLAB script from the tool bar
3. Edit the MATLAB program
4. Save and Run the script using the play button or F5 key
5. Verify the results in the figure window
6. Save the figure window using the option “save as *.jpg”

MATLAB Program

clear all
close all
clc
fs=10;
T=2;
w0=2*pi/T;
k=0:1/fs:5-1/fs;
%k=0:1/fs:10-1/fs;
y=square(w0*k,50);
figure
plot(k,y)
xlabel('t (seconds)'); ylabel('y(t)');
syms t
Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 29
N=10;

n=1:N;
a0=(2/T)*(int(1,t,0,1)+int(-1,t,1,2));
an=(2/T)*(int(1*cos(n*w0*t),t,0,1)+int(-
1*cos(n*w0*t),t,1,2));
bn=(2/T)*(int(1*sin(n*w0*t),t,0,1)+int(-
1*sin(n*w0*t),t,1,2));
F=a0/2;
for i=1:N
F=F+an(i)*cos(i*w0*k)+bn(i)*sin(i*w0*k);
end
figure
hold on
plot(k,y)
plot(k,F,'r')
xlabel('t (seconds)'); ylabel('y(t)');
title('Truncated Trigonometric Fourier Series');

hold off
grid on

mag=abs(F);
figure;
stem(k,mag)
xlabel('time')
ylabel('Magnitude')
title('Magnitude response')
phase=angle(F);
figure
plot(k,phase)
xlabel('time')
ylabel('Phase')
title('Phase response')

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 30
Expected Output:

Result:

Viva Questions:

1. Define fundamental frequency.

2. Define Fourier series?

3. What are mutually orthogonal functions?

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 31
EXPERIMENT-6: FOURIER TRANSFORM

AIM: -To write a MATLAB program to find Fourier Transform and Inverse Fourier Transform of a given
signal and to plot its Magnitude and Phase Spectra.

SOFTWARE REQURIED: MATLAB

THEORY:-
Fourier Transform:
The Fourier transform as follows. Suppose that ƒ is a function which is zero outside of some interval [−L/2, L/2].
Then for any T ≥ L we may expand ƒ in a Fourier series on the interval [−T/2,T/2], where the "amount" of the
wave e2πinx/T in the Fourier series of ƒ is given by By definition Fourier Transform of signal f(x) is defined as

− jt
F ( ) =  f (t ) e
−
dt

Inverse Fourier Transform of signal F(w) is defined as



1 j t
f (t ) =
2  F ( ) e
−
d

Procedure
1. Launch MATLAB and set the desktop layout to ‘default’
2. Open a new MATLAB script from the tool bar
3. Edit the MATLAB program
4. Save and Run the script using the play button or F5 key
5. Verify the results in the figure window
6. Save the figure window using the option “save as *.jpg”

Program:
clc;
clear all;
close all;
syms x a b
X = input('Fourier Transform of a function ....:: ');
disp('is ......:: ');
Xf = fourier(X)

fs=1000;
N=1024; % length over which plot of signal and spectrum are needed
t=[0:N-1]*(1/fs);
% input signal
y=0.8*cos(2*pi*100*t);

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 32
subplot(3,1,1);
plot(t,y);
axis([0 0.05 -1 1]);
grid;
xlabel('t');
ylabel('amplitude');
title('input signal');
% magnitude spectrum
x1=fft(y);
k=0:N-1;
Xmag=abs(x1);
subplot(3,1,2);
plot(k,Xmag);
grid;
xlabel('k');
ylabel('amplitude');
title('magnitude of fft signal')
% phase spectrum
Xphase=angle(x1)*(180/pi);
subplot(3,1,3);
plot(k,Xphase);
grid;
xlabel('k');
ylabel('angle in degrees');
title('phase of fft signal');
% % ******************* % %
% clc;
% close all;
% clear all;
x=input('enter the sequence');
N=length(x);
n=[Link]N-1;
y=fft(x,1024);
figure; subplot(3,1,1);
stem(n,x);
title('input sequence');
xlabel('time ');
ylabel('amplitude ');
% magnitude spectrum
Xmag=abs(y);
k=1:1024;
Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 33
subplot(3,1,2);
plot(k,Xmag);
grid;
xlabel('k');
ylabel('amplitude');
title('magnitude of fft signal')
% phase spectrum
Xphase=angle(y)*(180/pi);
subplot(3,1,3);
plot(k,Xphase);
grid;
xlabel('k');
ylabel('angle in degrees');
title('phase of fft signal');

Expected Output:

Result:

Viva Questions:

1. Why do we do Fourier Transform?

2. Where are Fourier transforms used?

3. Find the Fourier transform of u(-t).

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 34
EXPERIMENT NO-7

AIM: To compute and plot the impulse response and pole-zero diagram of transfer function using
Laplace transform.

APPARATUS REQUIRED:

SOFTWARE: MATLAB

Theory : A Transfer Function is the ratio of the output of a system to the input of a system, in

the Laplace domain considering its initial conditions to be zero. If we have an input function of

X(s), and an output function Y(s), we define the transfer function H(s) to be

Given a continuous-time transfer function in the Laplace domain, H(s) or a discrete-time one
in the Z-domain, H(z), a zero is any value of s or z such that the transfer function is zero,
and a pole is any value of s or z such that the transfer function is infinite

Zeros:1. The value(s) for z where the numerator of the transfer function equals [Link]
complex frequencies that make the overall gain of the filter transfer function zero.

Poles: 1. The value(s) for z where the denominator of the transfer function equals zero

The complex frequencies that make the overall gain of the filter transfer function infinite.

PROCEDURE:
1. Start the MATLAB program.
2. Open new M-file

3. Type the program

4. Save in current directory

5. Compile and Run the program

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 35
6. If any error occurs in the program correct the error and run it again

7. For the output see command window\ Figure window

8. Stop the program.

PROGRAM:

clc;
clear all;
close all;
num=input('enter numerator co-efficients');
den=input('enter denominator co-efficients');

h= tf2zp(num,den)

h=tf(num,den);
poles=roots(den);
zeros=roots(num);
sgrid;
pzmap(h);
grid on;
title('locating poles of zeros on s-plane');
%locating poles &zeros on z-plane%
clc;
clear all;
close all;
num=input('enter numerator coefficient');
den=input('enter denominator coefficient');
p=roots(den);
z=roots(num);
zplane(p,z);
grid;
title('locating poler and zeros on s-plane');

subplot(2,1,1)
step(h)
subplot(2,1,2)
impulse(h)

OUTPUT:-
locating poles of zero on s-plane
enter numerator coefficient[1 2 3]
enter denominator coefficient[7 6 5]

Expected output:

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 36
Expected out put:

Result:

Viva Questions:

1. Define z-transform and inverse z-transform.

2. Find the Laplace transform of δ(t).

3. What is the main purpose of Laplace transforms?

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 37
EXPERIMENT-8: LINEAR CONVOLUTION OF SIGNALS

Aim: To write a MATLAB program to compute linear convolution of continous time signals and
discrete time sequences.

Software Required: MATLAB

Theory:
Convolution is a mathematical tool to combining two signals to form a third signal. Therefore,
in signals and systems, the convolution is very important because it relates the input signal and
the impulse response of the system to produce the output signal from the system. In other
words, the convolution is used to express the input and output relationship of an LTI system.
Consider a continuous-time LTI system which is relaxed at t = 0, i.e., initially,no input is
applied to it. Now, if the impulse signal [δ(t)] is input to the system, then output of the system
is called the impulse response h(t) of the system and is given by,

h(t)=T[δ(t)]
As any arbitrary signal x(t) can be represented as x(t)=∫∞−∞x(τ)δ(t−τ)dτ
Then, the output of the system corresponding to x(t) is given by,
y(t)=T[x(t)]
Therefore, the convolution of two continuous-time signals x(t) and h(t) is represented as,
y(t)=x(t)∗h(t)=∫∞−∞x(τ)h(t−τ)dτ

Procedure
1. Launch MATLAB and set the desktop layout to ‘default’
2. Open a new MATLAB script from the tool bar
3. Edit the MATLAB program
4. Save and Run the script using the play button or F5 key
5. Verify the results in the figure window
6. Save the figure window using the option “save as *.jpg”

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 38
MATLAB Program

% linear convolution of two sequences with and without using function


clc;
clear all;
close all;

x=input('enter the seq1 :: ');


h=input('enter the seq2 :: ');

subplot(2,2,1);
stem(x);
title('Sequence 1');

subplot(2,2,2);
stem(h);
title('Sequence 2');
o=zeros(1,length(x)+length(h)-1);

for m=1:length(x),
for n=1:length(h),
y(m,n)=x(m)*h(n);
end;
end;
for n=1:length(x)+length(h)-1,
for i=1:length(x),
for j=1:length(h),
if(i+j==n+1)
o(n)=o(n) + y(i,j)
end;
end;
end;
end;

subplot(2,2,3);
stem(o);
title('output without using function');

o1 = conv(x,h)
subplot(2,2,4);
stem(o1);
title('output by using function');

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 39
Expected Output:

Result:

VIVA QUESTIONS:

1. What is the difference between convolution and correlation?


2. What are the applications of convolution?
3. What are the tools used in a graphical method of finding convolution of discrete time signals?

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 40
EXPERIMENT-9: CORRELATION OF SIGNALS

Aim: To compute auto correlation and cross correlation between signals and Sequences using
MATLAB.

Software Required: MATLAB


Theory:
Cross Correlation Function (CCF) is a measure of similarity between a signal and time
delayed version of the different signal. Given two real-valued sequences 𝑿(𝒏) and 𝒀(𝒏)of
finite energy, cross correlation operation can be represented by a mathematical expression is
as follows
𝑹𝑿,𝒀 (𝒍) = ∑∞
𝒏=−∞ 𝑿(𝒏) 𝒀(𝒏 − 𝒍) (6.1)
Where the index 𝒍is called the shift or lag parameter.
Auto correlation function (ACF) is a measure of similarity between a signal and time
delayed version of the same signal. Given real-valued sequence 𝑿(𝒏) of finite energy, auto
correlation operation can be represented by a mathematical expression is as follows
𝑹𝑿,𝒀 (𝒍) = ∑∞
𝒏=−∞ 𝑿(𝒏) 𝑿(𝒏 − 𝒍) (6.2)

Procedure
1. Launch MATLAB and set the desktop layout to ‘default’
2. Open a new MATLAB script from the tool bar
3. Edit the MATLAB program
5. Save and Run the script using the play button or F5 key
6. Enter the inputs from the command window
7. Verify the results in the command and figure windows
8. Save the figure window using the option “save as *.jpg”

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 41
MATLAB Program

% cross correlation between two sequences

clc;
close all;
clear all;
x=input('enter input sequence');
h=input('enter the impulse sequence');
subplot(2,2,1);
stem(x);
xlabel('n');
ylabel('x(n)');
title('input sequence');
subplot(2,2,2);
stem(h);
xlabel('n');
ylabel('h(n)');
title('impulse signal');

% cross correlation between two sequences


y=xcorr(x,h);
subplot(2,2,3);
stem(y);
xlabel('n');
ylabel('y(n)');
title(' cross correlation between two sequences ');

% auto correlation of input sequence


z=xcorr(x,x);
subplot(2,2,4);
stem(z);
xlabel('n');
ylabel('z(n)');
title('auto correlation of input sequence');

% cross correlation between two signals

% generating two input signals


t=0:0.2:10;
x1=3*exp(-2*t);
h1=exp(t);
figure;
subplot(2,2,1);
plot(t,x1);
xlabel('t');
ylabel('x1(t)');

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 42
title('input signal');
subplot(2,2,2);
plot(t,h1);
xlabel('t');
ylabel('h1(t)');
title('impulse signal');

% cross correlation
subplot(2,2,3);
z1=xcorr(x1,h1);
plot(z1);
xlabel('t');
ylabel('z1(t)');
title('cross correlation ');

% auto correlation
subplot(2,2,4);
z2=xcorr(x1,x1);
plot(z2);
xlabel('t');
ylabel('z2(t)');
title('auto correlation ');

Expected Results

Result:

VIVA QUESTIONS:

1. What is autocorrelation?
2. What is the convolution of a signal with an impulse?
3. What is the commutative property?

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 43
EXPERIMENT-10: SAMPLING THEOREM

Aim: To write a MATLAB program to verify Sampling Theorem.

Software Required: MATLAB

Theory
A band limited signal of finite energy which has no frequency components higher than W hertz
is completely recovered from the knowledge of its samples taken at the rate of 2W samples per
second, where W = 2fm. These statements can be combinedly stated as A bandlimited signal x(t)
with X(j ω) = 0 for |ω| > ωm is uniquely determined from its samples x(nT), if the sampling
frequency fs ≥ 2fm, ie., sampling frequency must be atleast twice the highest frequency present
in the signal.

Procedure
1. Launch MATLAB and set the desktop layout to ‘default’
2. Open a new MATLAB script from the tool bar
3. Edit the MATLAB program
4. Save and Run the script using the play button or F5 key
5. Verify the results in the figure window
6. Save the figure window using the option “save as *.jpg”

MATLAB Program

clc;
clear all;
close all;

Fs = input('Enter Sampling Frequency in Hz ....:: ');


Fm = input('Enter Message Frequency in Hz .....:: ');

t = 0:0.01:2;
msg = sin(2*pi*t);

k = 2*Fs/Fm;
step = ceil(201/k);
samp_msg = [];
for i = 1:201,
if (mod(i,step) == 0)
Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 44
samp_msg = [samp_msg,msg(i)];
else
samp_msg = [samp_msg,zeros(1)];
end;
end;

subplot(2,1,1);
plot(msg);
xlabel('---> Time');
ylabel('---> Amplitude');
title('Msg signal');

subplot(2,1,2);
stem(samp_msg);
xlabel('---> Time');
ylabel('---> Amplitude');
if Fs < 2*Fm
title('Under Sampling');
else if Fs == 2*Fm
title('Critical Sampling');
else
title('Over Sampling');
end;
end;

Expected Output:

Result:

Viva Questions:

[Link] sampling theorm

2. Define Nyquist rate and Nyquist interval.

3. Define aliasing.

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 45
EXPERIMENT-11: POLE-ZERO DIAGRAM OF TRANSFER FUCTION USING Z-TRANSFORM

Aim: To write a MATLAB program to plot Pole-Zero diagram of given transfer function using Z-Transform.

Software Required: MATLAB

Theory
Introduction to Poles and Zeros of the Z-Transform

It is quite difficult to qualitatively analyze the Laplace transform and Z-transform, since mappings of their
magnitude and phase or real part and imaginary part result in multiple mappings of 2-dimensional surfaces
in 3-dimensional space. For this reason, it is very common to examine a plot of a transfer function's poles
and zeros to try to gain a qualitative idea of what a system [Link] the Z-transform of a system has been
determined, one can use the information contained in function's polynomials to graphically represent the
function and easily observe many defining characteristics. The Z-transform will have the below structure,
based on Rational Functions

X(z)=P(z)/Q(z)

The two polynomials, P(z) and Q(z), allow us to find the poles and zeros of the Z- Transform.

Definition: zeros :
1. The value(s) for z where P(z)=0.
2. The complex frequencies that make the overall gain of the filter transfer function zero.
Definition: poles:
1. The value(s) for z where Q(z)=0.
2. The complex frequencies that make the overall gain of the filter transfer function infinite.

Procedure
1. Launch MATLAB and set the desktop layout to ‘default’
2. Open a new MATLAB script from the tool bar
3. Edit the MATLAB program
4. Save and Run the script using the play button or F5 key
5. Verify the results in the figure window
6. Save the figure window using the option “save as *.jpg”

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 46
MATLAB Program

clc;
clear all;
close all;
num=input('enter numerator coefficient');
den=input('enter denominator coefficient');
p=roots(den);
z=roots(num);
zplane(p,z);
grid;
title('locating poler and zeros on s-plane');

subplot(2,1,1)
step(h)
subplot(2,1,2)
impulse(h)

Expected Output:

Result:

Viva Questions:

1. Define z-transform and inverse z-transform.

2. List the properties of region of convergence for the z-transform.

3. List the properties of z-transform

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 47
ADDITIONAL EXPERIMENTS:

EXPERIMENT-12: Write a program to generate Complex Gaussian noise and find its mean,
Variance, Probability Density Function (PDF) and Power Spectral Density (PSD).

Aim: Write the program for generation of Gaussian noise and computation of its mean, mean square
value, standard deviation, variance, and skewness.
Software Required: Matlab software.
Theory:
Gaussian noise is statistical noise that has a probability density function (abbreviated pdf) of the
normal distribution (also known as Gaussian distribution). In other words, the values the noise can take
on are Gaussian-distributed. It is most commonly used as additive white noise to yield additive white
Gaussian noise (AWGN).Gaussian noise is properly defined as the noise with a Gaussian amplitude
distribution. says nothing of the correlation of the noise in time or of the spectral density of the noise.
Labeling Gaussian noise as 'white' describes the correlation of the noise. It is necessary to use the term
"white Gaussian noise" to be correct. Gaussian noise is sometimes misunderstood to be white Gaussian
noise, but this is not the case.

MATLAB Program
clc;
clear all;
close all;
%generates a set of 2000 samples of Gaussian distributed random
numbers
x=randn(1,2000);
%plot the joint distribution of both the sets using dot.
subplot(211)
plot(x,'.');
title('scatter plot of gaussian distributed random numbers');
ymu=mean(x)
ymsq=sum(x.^2)/length(x)
ysigma=std(x)
yvar=var(x)
yskew=skewness(x)
p=normpdf(x,ymu,ysigma);
subplot(212);
stem(x,p);
title(' gaussian distribution');

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 48
Expected Output:

Result:

VIVA QUESTIONS:-

1..What are the advantages of digital filter over analog filters?

[Link] is Gaussian noise characteristics?

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 49
EXPERIMENT-13: Write a program to find response of a low pass filter and high pass filter,
when a speech signal is passed through these filters. Aim: To find response of a low pass filter
and high pass filter, when a speech signal is passed through these filters

Aim: Write a program to find response of a low pass filter and high pass filter, when a speech
signal is passed through these filters. Aim: To find response of a low pass filter and high pass
filter, when a speech signal is passed through these filters.

Software Required: MATLAB


Theory:
y = lowpass(x,wpass) filters the input signal x using a lowpass filter with normalized
passband frequency wpass in units of π rad/sample. lowpass uses a minimum-order filter with
a stopband attenuation of 60 dB and compensates for the delay introduced by the filter. If x is a
matrix, the function filters each column independently.
y = lowpass(x,fpass,fs) specifies that x has been sampled at a rate of fs hertz. fpass is the
passband frequency of the filter in hertz.
y = lowpass(xt,fpass) lowpass-filters the data in timetable xt using a filter with a passband
frequency of fpass hertz.
The function independently filters all variables in the timetable and all columns inside each
variable. y = lowpass(___,Name,Value) specifies additional options for any of the previous
syntaxes using name-value pair arguments.

You can change the stopband attenuation, the transition band steepness, and the type of impulse
response of the filter.
[y,d] = lowpass(___) also returns the digitalFilter object d used to filter the input.
lowpass(___) with no output arguments plots the input signal and overlays the filtered signal

Program :
% Read standard sample tune that ships with MATLAB.
[dataIn, Fs] = audioread('[Link]');
% Filter the signal
fc = 800; % Make higher to hear higher frequencies.
% Design a Butterworth filter.
[b, a] = butter(6,fc/(Fs/2));
freqz(b,a)
Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 50
% Apply the Butterworth filter.
filteredSignal = filter(b, a, dataIn);
% Play the sound.
player = audioplayer(filteredSignal, Fs);
play(player);

Expected output:

Result:

Viva Questions:

1. Which is the example of audio signal?

2. What is low pass and bandpass signal?

3. What is the human being audible frequency?

Sigtnals and SystemsLab, Dept of ECE, Raghu Engineering College, Visakhapatnam Page 51

You might also like