Basic SImulation Lab
Basic SImulation Lab
Basic
Simulation Lab
Manual 2022
Basic Simulation Lab with MATLAB Written for under
graduate students in the fields of electronics and
communication, this Manual is meant to supplement the
theoretical concepts taught in an introductory course on
A Guide to
signals and systems. Each Simulation contains all the Student for BS
theoretical background information needed for the LAB
simulations as well as the required MATLAB code. Topics
include an introduction to vectors and matrices, operations
on signals and sequences, and the Fourier transform etc.
LABORATORY MANUAL
BASIC SIMULATION
II B. TECH -I Semester (ECE-R22)
PEO 1 Practice Technical skills widely in industrial, societal and real time
applications.
PEO 2 Engage in the pursuit of higher education, delve into extensive research
and development endeavours, and explore creative and innovative
ventures in the domains of science, engineering, technology.
PEO 3 Exhibit professional ethics and moral values and capability of working
with professional skills to contribute towards the need of industry and
society.
2. Problem analysis: Identify, formulate, review research literature, and analyze complex
engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences, and engineering sciences.
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.
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.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and
norms of engineering practice.
11. Project management and finance: Demonstrate knowledge and understanding of the
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.
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.
PSO 1 Carry out the Analysis and Design different Analog & Digital circuits
with given specifications.
3. While coming to the lab bring the lab manual cum observation book, record etc.
4. Take only the lab manual, calculator (if needed) and a pen or pencil to the work area.
5. Before coming to the lab, prepare the prelab questions. Read through the lab
experiment to familiarize yourself with the components and assembly sequence.
6. Utilize 2 hours time properly to perform the experiment (both in software and
hardware) and note down the readings properly. Do the calculations, draw the graph
and take signature from the instructor.
7. If the experiment is not completed in the prescribed time, the pending work has tobe
done in the leisure hour or extended hours.
8. You have to submit the completed record book according to the deadlines set up by
your instructor.
9. For practical subjects there shall be a continuous evaluation during the semester for 30
sessional marks and 70 end examination marks.
10. Of the 30 marks for internal, 20 marks shall be awarded for day-to-day work and 10
marks to be awarded by conducting an internal laboratory test.
AIM: - To write a MATLAB program to perform some basic operation on matrices such as addition,
subtraction, multiplication.
SOFTWARE REQURIED: -
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY: -
Built in Functions:
1. Scalar Functions:
Certain MATLAB functions are essentially used on scalars, but operate element-wise
whenapplied 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)
5. acos - trigonometric inverse cosine (arccosine)
6. atan - trigonometric inverse tangent (arctangent)
7. exp - exponential
8. log - natural logarithm
9. abs - absolute value
2. Vector Functions:
3. Matrix Functions:
Much of MATLAB‟ s power comes from its matrix functions. These can be further
separatedinto two sub-categories.
The first one consists of convenient matrix building functions, some of which are
givenbelow.
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
matrixeg:
diag([0.9092;0.5163;0.2661])
ans =
0.9092 0 0
0 0.5163 0
0 0 0.2661
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
7. poly characteristic polynomial
Department of Electronics and Communication Engineering Page 9
BKM
PROGRAM:-
clc;
close
all;clear
all;
a=[1 2 -9 ; 2 -1 2; 3 -4 3];
b=[1 2 3; 4 5 6; 7 8 9];
disp('The matrix a= ');
a
disp('The matrix b= ');
b
% to find sum of a and b
c=a+b;
disp('The sum of a and b is ');
c
% to find difference of a and b
d=a-b;
disp('The difference of a and b is ');
d
%to find multiplication of a and b
e=a*b;
disp('The product of a and b is ');
e
The matrix
a=a =
1 2 -9
2 -1 2
3 -4 3
The matrix
b=b =
1 2 3
4 5 6
7 8 9
2 4 -6
6 4 8
10 4 12
0 0 -12
-2 -6 -4
-4 -12 -6
-54 -60 66
12 15 18
8 10 12
RESULT:-
Finding addition, subtraction, multiplication using MATLAB
wasSuccessfully completed.
has areflection, or distortion effects such as light passing through rippling water.
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
One of the more useful functions in the study of linear systems is the "unit impulse
function." An ideal impulse function is a function that is zero everywhere but at the
origin, where it is infinitely high. However, the area of the impulse is finite. This is, at first
hard to visualize butwe can do so by using the graphs shown below.
If b>a, then
Solution:
and
The unit step function and the impulse function are considered to be fundamental
functions in engineering, and it is strongly recommended that the reader becomes very
familiar with both of these functions.
The unit step function, also known as the Heaviside function, is defined as such:
Sometimes, u(0) is given other values, usually either 0 or 1. For many applications, it
isirrelevant what the value at zero is. u(0) is generally written as undefined.
Derivative
The unit step function is level in all places except for a discontinuity at t = 0. For this
reason, the derivative of the unit step function is 0 at all points t, except where t = 0. Where
t = 0, the derivative of the unit step function is infinite.
The derivative of a unit step function is called an impulse function. The impulse function
willbe described in more detail next.
Integral
and Sinc(0)=1
Then, since cos(0) = 1, we can apply the Squeeze Theorem to show that the sinc function
approaches one as x goes to zero. Thus, defining sinc(0) to be 1 makes the sinc function
continuous.
Also, the Sinc function approaches zero as x goes towards infinity, with the envelope of
sinc(x) tapering off as 1/x.
Rect Function
The Rect Function is a function which produces a rectangular-shaped pulse with a width of
1 centered at t = 0. The Rect function pulse also has a height of 1. The Sinc function and the
rectangular function form a Fourier transform pair.
where the pulse is centered at X and has width Y. We can define the impulse function above
in terms of the rectangle function by centering the pulse at zero (X = 0), setting it's
height to 1/Aand setting the pulse width to A, which approaches zero:
We can also construct a Rect function out of a pair of unit step functions
Here, both unit step functions are set a distance of Y/2 away from the center point of (t - X).
SAW TOOTH:-
The sawtooth wave (or saw wave) is a kind of non-sinusoidal waveform. It is named a
sawtooth based on its resemblance to the teeth on the blade of a saw. The convention is
that a sawtooth wave ramps upward and then sharply drops. However, there are also
sawtooth waves in which the wave ramps downward and then sharply rises. The latter
type of sawtooth wave is called a 'reverse sawtooth wave' or 'inverse sawtooth wave'. As
audio signals, the two orientations of sawtooth wave sound identical. The piecewise linear
function based on the floor function of time t, is an example of a sawtooth wave with period
1.
Triangle wave
A triangle wave is a non-sinusoidal waveform named for its triangular shape.A bandlimited
triangle wave pictured in the time domain (top) and frequency domain (bottom). The
fundamental is at 220 Hz (A2).Like a square wave, the triangle wave contains only odd
harmonics. However, the higher harmonics roll off much faster than in a square wave
(proportional to the inverse square of the harmonic number as opposed to just the
inverse).It is possible to approximate a triangle wave with additive synthesis by adding odd
harmonics of the fundamental, multiplying every (4n−1)th harmonic by −1 (or changing its
phase by π), and rolling off the harmonics by the inverse square of their relative frequency
to the fundamental.This infinite Fourier series converges to the triangle wave:
The sine wave or sinusoid is a mathematical function that describes a smooth repetitive
oscillation. It occurs often in pure mathematics, as well as physics, signal processing,
electrical engineering and many other fields. Its most basic form as a function of time (t) is:
where:
• A, the amplitude, is the peak deviation of the function from its center position.
• ω, the angular frequency, specifies how many oscillations occur in
a unit timeinterval, in radians per second
• φ, the phase, specifies where in its cycle the oscillation begins at t = 0. A sampled sinusoid
may be written as:
where f is the signal frequency, fs is the sampling frequency, θis the phase
and A is theamplitude of the signal.
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc;
clear all;close
all;N=100;
t=1:100;
x=ones(1,N);
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 discreat function');
%sinusoidal function%clc;
clear all; close
all; t=0:0.01:2;
x=sin(2*pi*t);
subplot(2,1,1);
plot(t,x,'g');
xlabel('time');
%square function%clc;
clear all; close
all; t=0:0.01:2;
x=square(2*pi*t);
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'); ylabel('amplitude');
title('square sequence');
%sawtooth function%clc;
clear all; close
all; t=0:0.01:2;
x=sawtooth(2*pi*5*t);
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');
clc;
clear all; close
all; t=0:0.01:2;
x=sawtooth(2*pi*5*t,0.5);subplot(2,1,1);
plot(t,x,'g');
xlabel('time'); ylabel('amplitude');
title('trianguler signal');subplot(2,1,2);
stem(t,x,'r');
xlabel('time'); ylabel('amplitude');
title('trianguler sequence');
%sinc function%clc;
clear all;close
all;
t=linspace(-5,5);
x=sinc(t);
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');
Simulations:
unit impulse Discrete function
1
amplitude
0.5
0
-10 -8 -6 -4 -2 0 2 4 6 8 10
time
1.5
amplitude
0.5
0
0 10 20 30 40 50 60 70 80 90 100
time
unit step discreat function
1
amplitude
0.5
0
0 10 20 30 40 50 60 70 80 90 100
time
15
amplitude
10
0
0 2 4 6 8 10 12 14 16 18 20
time
unit ramp discreat function
20
15
amplitude
10
0
0 2 4 6 8 10 12 14 16 18 20
time
Sinusoidal function
sinusoidal signal
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
sinusoidal sequence
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
Square function
square signal
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
square sequence
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
Sawtooth function
sawtooth signal
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
sawtooth sequence
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
trianguler signal
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
trianguler sequence
1
0.5
amplitude
-0.5
-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
Sinc Function
sinc signal
1
0.5
amplitude
-0.5
-5 -4 -3 -2 -1 0 1 2 3 4 5
time
sinc sequence
1
0.5
amplitude
-0.5
-5 -4 -3 -2 -1 0 1 2 3 4 5
time
RESULT: -
Thus the Generation of continuous time signals like unit step, sawtooth, triangular,
sinusoidal, ramp and sinc functions are successfully completedby using MATLAB.
1. Define Signal?
2. Define deterministic and Random Signal?
3. Define Delta Function?
4. What is Signal Modeling?
5. Define Periodic and a periodic Signal?
6.Write the relation between Step and Impulse signals?
7. Write the relation between Ramp and impulse signals?
8. Write the relation between Ramp and Step signals?9.Define Standard signals?
10. Give examples of Standard signals?
EXERCISE QUESTIONS
5.
SOFTWARE REQURIED: -
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY: -
Time shifting: y(t)=x(t-T) The effect that a time shift has on the appearance of a
signalIf T is a positive number, the time shifted signal, x (t -T ) gets shifted to the
right, otherwise it gets shifted left.
Multiplication/Division:
folding:
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
clc;
clear all; close all;
t=0:0.001:2;
s1=6*sin(2*pi*5*t);
subplot(4,1,1);
plot(t,s1,'g');
xlabel('time');
ylabel('amplitude');
clc; clc;
clear all; close all; t=0:0.001:3; clear all; close all; t=0:0.001:2;
s1=6*sin(2*pi*5*t);subplot(3,1,1); s=sin(2*pi*5*t);m=length(s);
plot(t,s1,'g'); n=[-m:m];
xlabel('time'); ylabel('amplitude'); y=[0,zeros(1,m),s];
title('sinusoidal signal');t1=t+10; subplot(2,1,1);
subplot(3,1,2); plot(n,y,'g');
plot(t1,s1,'r'); xlabel('time'); ylabel('amplitude');
xlabel('time'); ylabel('amplitude'); title('original signal');
title('right shift of the signal');t2=t-10; y1=[fliplr(s),0,zeros(1,m)];
subplot(3,1,3); subplot(2,1,2);
plot(t2,s1,'g'); plot(n,y1,'r');
xlabel('time'); ylabel('amplitude'); xlabel('time'); ylabel('amplitude');
title('left shift of the signal'); title('folded signal');
first signal
amplitude
10
0
-10
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
second signal
amplitude
10
0
-10
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
sum of two signals
amplitude
20
0
-20
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
multiplication of two signals
amplitude
50
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
sinusoidal signal
10
amplitude
-10
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
amplified signal
20
amplitude
-20
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
attenuated signal
2
amplitude
-2
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
sinusoidal signal
10
amplitude
-10
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
time
compressed signal
10
amplitude
-10
0 1 2 3 4 5 6
time
enlarged signal
10
amplitude
-10
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
time
sinusoidal signal
10
amplitude
-10
0 0.5 1 1.5 2 2.5 3
time
right shift of the signal
10
amplitude
-10
10 10.5 11 11.5 12 12.5 13
time
left shift of the signal
10
amplitude
-10
-10 -9.5 -9 -8.5 -8 -7.5 -7
time
original signal
1
0.5
amplitude
-0.5
-1
-2500 -2000 -1500 -1000 -500 0 500 1000 1500 2000 2500
time
folded signal
1
0.5
amplitude
-0.5
-1
-2500 -2000 -1500 -1000 -500 0 500 1000 1500 2000 2500
time
RESULT: -
In this experiment the various oprations on signals have beenPerformed Using MATLAB have been
demonstrated.
VIVA QUESTIONS: -
1. Define Symmetric and Anti-Symmetric Signals?
2. Define Continuous and Discrete Time Signals?
3. What are the Different types of representation of discrete time signals?
4. What are the Different types of Operation performed on signals?
5. What is System?
6.Explain Even Signals?
7.Explain Odd signals?
8.Define Periodic signals?
9.Define Aperiodic
signals?
10.Differentiate Energy and Power signals with examples?
FINDING EVEN AND ODD & REAL AND IMAGINARY PARTS OF SEQUENCES
AIM: -
Program for finding even and odd parts of sequences Using MATLAB Software& Program
for finding real and imaginary parts of sequences Using MATLAB Software
SOFTWARE REQURIED: -1. MATLAB R2010a.
2.Windows XP SP2.
THEORY: -
Even and Odd Signal
One of characteristics of signal is symmetry that may be useful for signal analysis. Even
signals are symmetric around vertical axis, and Odd signals are symmetric about origin.
Even Signal: A signal is referred to as an even if it is identical to its time-reversed
counterparts; x(t) = x(-t).
Odd Signal: A signal is odd if x(t) = -x(-t).
An odd signal must be 0 at t=0, in other words, odd signal passes the origin.
Using the definition of even and odd signal, any signal may be decomposed into a sum of
its even part, xe(t), and its odd part, xo(t), as follows:
x(t)=xe(t)+xo(t);
x(t)=1/2{x(t)+x(-t)} +1/2{x(t)-x(-t)}where
xe(t)=1/2{x(t)+x(-t)} &xo(t)=1/2{x(t)-x(-t)}
contains only the non-negative frequency components of X(f). And the operation is
reversible,due to the Hermitian property of X(f):
where x^(t) is the Hilbert transform of x(t) and J is the imaginary unit.
PROCEDURE: -
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
Even,odd,real,imaginary parts of a
original sequence
amplitude
0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
time
folded sequence
amplitude
0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
time
even part of sequence
amplitude
4
2
0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
time
odd part of sequence
amplitude
2
0
-2
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
time
5i]real values of y
yimag =
6 -5 0 3 5
RESULT: -
xlabel('t');ylabel('x(t)');title('even part
signal x(t)'); subplot(2,2,4);
plot(t,xo);
xlabel('t');ylabel('x(t)');title('odd part
signal x(t)');
EXERCISE PROGRAM
1. Write a MATLAB program to find even part of a signal by considering 10 input samples.
2. Write a MATLAB program to find odd part of a signal by considering atleast 7 samples.
3. Write a MATLAB program to add even an odd part of a signal and see how matlab
reacts forthe above program.
4. Write a matlab program to get the out put as [-5, 3, 0, 8] as imaginary values and [2 4 6 8 0] as
real values.
5. Write a MATLAB program to subtract even an odd part of a signal and see how matlab
reactsfor the above program.
6. Write a MATLAB program to find real & imaginary values of complex numbers
[1+6i 2-5i 34+3i 5i].
7. Write a MATLAB program to find real & imaginary values of complex numbers
[2+6i 7+5i3 9+3i 5i].
8. Write a MATLAB program to find real & imaginary values of complex numbers
[7+6i 2-5i 38+3i 7i].
9. Write a MATLAB program to find even & odd part of the sequence [5 6 3 2 3 4 7].
10. Write a MATLAB program to find even & odd part of the sequence [7 5 8 6 7].
11.Write a MATLAB program to find even part of a signal by considering 8 input
samples.
12. Write a MATLAB program to find odd part of a signal by considering 10 samples.
13. Write a MATLAB program to multiply even and odd part of a signal and see how
matlabreacts for the above program.
14. Write a matlab program to get the output as [2, 5, -1, 6] imaginary values and
[4, 2, 8, 0] asreal values.
15. Write a MATLAB program to divide even an odd part of a signal and see how matlab
reactsfor the above program.
16. Write a MATLAB program to find real & imaginary values of complex numbers
[2+4i 1-6i4+2i 8i].
17. Write a MATLAB program to find real & imaginary values of complex numbers
[4+8i 6+4i2 6+4i 6i].
Linear Convolution
AIM: -
To find the output with linear convolution operation Using MATLAB Software.
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
%Convolution of two
signals%
clc;
clear all;
close all; t=0:0.001:10;
x=sin(t); h=square(t); subplot(3,1,1);
plot(t,x,'g');
xlabel('time');
ylabel('amplitude');
title('sinusoidal
signal');
subplot(3,1,2);
plot(t,h,'r');
xlabel('time');
ylabel('amplitude');
title('square
function');
y=conv(x,h);
subplot(3,1,3); plot(y); xlabel('time'); ylabel('amplitude');
title('convolution signal');
OUTPUT:-
sinusoidal signal
1
amplitude
-1
0 1 2 3 4 5 6 7 8 9 10
time
square function
1
amplitude
-1
0 1 2 3 4 5 6 7 8 9 10
time
4
x 10 convolution signal
1
amplitude
-1
0 0.5 1 1.5 2 2.5
time 4
x 10
1st sequence
4
x(n)
0
1 1.5 2 2.5 3 3.5 4
discrete time
second sequence
4
h(n)
0
1 1.5 2 2.5 3 3.5 4
discrete time
convolution of two sequences
40
y(n)
20
0
1 2 3 4 5 6 7
discrete time
RESULT:-
1. Define Convolution?
2. Define Properties of Convolution?
3. What is the Difference Between Convolution& Correlation?
4. What are Dirchlet Conditions of Fourier
Series?5.What is Half Wave Symmetry?
6. Define Linear Convolution?
7. Define Properties of Convolution in time domain?
8. What is the Difference Between Linear Convolution& Circular Correlation?
9. What are Dirchlet Conditions for Fourier
Transform?10.What is Full Wave Symmetry?
EXERCISE PROGRAMS
AIM: -
To compute auto correlation and cross correlation between signals and Sequences.
SOFTWARE REQURIED: -
1. MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
signal%
clc;
clear all;
close all; t=0:0.001:1;
x=cos(2*pi*3*t);a=xcorr(x); subplot(2,1,1);
plot(t,x,'g');
xlabel('time'); ylabel('amplitude');title('input signal');subplot(2,1,2);
plot(a,'r');
xlabel('time'); ylabel('amplitude');
title('auto correlation signal');
clc;
clear
all;close
all;
x=input('enter first sequence'); y=input('enter second sequence');a=xcorr(x,y);
subplot(3,1,1);
stem(x,'g');
xlabel('time'); ylabel('amplitude');title('1st sequence');subplot(3,1,2);
stem(y,'r');
xlabel('time'); ylabel('amplitude'); title('2nd sequence');subplot(3,1,3);
stem(a,'r');
xlabel('time'); ylabel('amplitude');
title('cross correlation sequence');
OUTPUT:-
input signal
1
0.5
amplitude
-0.5
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time
auto correlation signal
1000
500
amplitude
-500
0 500 1000 1500 2000 2500
time
1st signal
1
amplitude
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time
2nd signal
1
amplitude
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time
cross correlation signal
100
amplitude
-100
0 500 1000 1500 2000 2500
time
x=
1 2 3 4
input sequence 61
4
3
amplitude
0
1 1.5 2 2.5 3 3.5 4
time
auto correlation sequence
30
20
amplitude
10
0
1 2 3 4 5 6 7
time
1st sequence
4
amplitude
0
1 1.5 2 2.5 3 3.5 4
time
2nd sequence
4
amplitude
0
1 1.5 2 2.5 3 3.5 4
time
cross correlation sequence
40
amplitude
20
0
1 2 3 4 5 6 7
time
VIVA QUESTIONS: -
1. Define Correlation?
2. Define Auto-Correlation?
3. Define Cross-Correlation?
4. What is the importance of correlation?
5. What is the difference b/w correlation and convolution?
6. Explain two Properties of Auto-Correlation?
7. Explain two Properties of Cross-Correlation?
8. What is the difference b/w Auto-correlation and Cross-
Correlation?9.Define ESD?
10.Define PSD?
EXERCISE PROGRAMS
1. Write a MATLAB program to compute auto correlation between signals and Sequences.
x=cos(2*pi*10*t),y=cos(2*pi*15*t).
2. Write a MATLAB program to compute cross correlation between signals and Sequences.
x=cos(2*pi*7*t),y=cos(2*pi*14*t).
3. Write a MATLAB program to compute the cross correleation between signals and
Sequences. x=cos(2*pi*10*t),y=cos(2*pi*15*t) by increasing the amplitude of the signal by 3
times and verify how matlab reacts to it.
4. Write a MATLAB program to compute the auto correleation between signals and Sequences.
x=cos(2*pi*15*t),y=cos(2*pi*10*t) by increasing the amplitude of the signal by 2 times and
verify how matlab reacts to it.
5. Write a MATLAB program to compute auto correlation between x =sin(2*pi*5*t) ,
y = sin(2*pi*10*t). and see how matlab reacts to it.
6. Write a MATLAB program to compute cross correlation between x =sin(2*pi*5*t) ,
y = cos(2*pi*10*t). and see how matlab reacts to it.
7. Write a MATLAB program to compute cross correlation between two signals
x=9*cos(2*pi*7*t), y=5*cos(2*pi*14*t).
SOFTWARE REQURIED: -
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
LINEARITY PROPERTY
a) Homogeneity
b) Superposition
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
%Program1:%
clc;
clear all; close all;
n=0:40; a=2; b=1;
x1=cos(2*pi*0.1*n);
x2=cos(2*pi*0.4*n);
x=a*x1+b*x2;
y=n.*x;
y1=n.*x1;
y2=n.*x2;
yt=a*y1+b*y2;
d=y-yt;
d=round(d)
if d
disp('Given system is not
satisfy linearity property');
else
disp('Given system is satisfy
linearity property');
end
subplot(3,1,1), stem(n,y);
grid;
subplot(3,1,2), stem(n,yt);
grid;
subplot(3,1,3), stem(n,d);
grid;
%Program2:%
clc;
clear all; close all;
n=0:40;
a=2; b=-3;
x1=cos(2*pi*0.1*n);
x2=cos(2*pi*0.4*n);
x=a*x1+b*x2;
y=x.^2;
y1=x1.^2;
y2=x2.^2;
yt=a*y1+b*y2;
d=y-yt;
d=round(d);
if d
disp('Given system is
not satisfy linearity
property'); else
disp('Given system is
satisfy linearity
property'); end
subplot(3,1,1),
stem(n,y); grid;
subplot(3,1,2),
stem(n,yt); grid;
subplot(3,1,3),
stem(n,d);
grid;
EXSERCISE QUESTIONS
AIM: -
To Unit Step and Sinusoidal Response of The Given LTI System And Verifying Its
Physical Reliability And Stability Properties.
SOFTWARE REQURIED: -
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY: -
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
PROGRAM: -
%calculate and plot the
impulse response and step
response%
clc;
clear all;
close all;
b=[1];
a=[1,-1,.9];
x=impseq(0,-20,120);
n = [-20:120];
h=filter(b,a,x);
subplot(3,1,1);
stem(n,h);
title('impulse response');
xlabel('n');
ylabel('h(n)');
=stepseq(0,-20,120);
s=filter(b,a,x);
s=filter(b,a,x);
subplot(3,1,2);
stem(n,s);
title('step response');
xlabel('n');
ylabel('s(n)');
t=0:0.1:2*pi;
x1=sin(t);
%impseq(0,-20,120);
n = [-20:120];
h=filter(b,a,x1);
subplot(3,1,3);stem(h);
title('sin response');
xlabel('n');
ylabel('h(n)'); figure;
zplane(b,a);
RESULT: -
In this experiment computation of unit sample, unit step and sinusoidal response of the
given LTI system and verifying its physical Reliability and Stability Properties using MATLAB.
VIVA QUESTIONS: -
1.What operations can be performed on signals and sequence?
2.Define causality?
3. Define scaling property and give its importance?
4.Define shifting property and give its importance?
5.Define folding property and give its importance?
6.Define stability?
7.Give the importance of Causality?
8.Give the importance of Stability?
9. Define Impulse Response?
10.Define Step Response?
SOFTWARE REQURIED: -
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY: -
Gibbs Phenomenon:
The peculiar manner in which the Fourier series of a piecewise continuously differentiable
periodic function behaves at a jump discontinuity: the nth partial sum of the Fourier series has
large oscillations near the jump, which might increase the maximum of the partial sum above
that of the function itself. The overshoot does not die out as the frequency increases, but
approaches a finite limit. The Gibbs phenomenon involves both the fact that Fourier sums
overshoot at a jump discontinuity, and that this overshoot does not die out as the frequency
increases.
The best known version of the Gibbs phenomenon is the overshoot that arises when a
discontinuous function is represented by a truncated set of Fourier expansion terms. The
situation is similar if the truncated Fourier expansion is instead obtained by means of
interpolation on an equi spaced grid.
PROCEDURE: -
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
%Gibbs phenomenon%
clc;
clear all;
close all; t=0:0.01:1;
N=input('enter no of harmonics');
x=square(2*pi*t);
plot(t,x);
hold on;
gp=0;
for n=1:2:N;
gp=gp+(4/(n*pi))*sin(2*pi*n*t);
end; plot(t,gp); hold off;
xlabel('time');
ylabel('amplitude');
title('gibbs phenomenon');
OUTPUT: -
Gibbs phenomenon
enter no of harmonics 5
Gibbs Phenomenon
1.5
0.5
amplitude
-0.5
-1
-1.5
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time
VIVA QUESTIONS: -
1. Define Gibb’s Phenomenon?
2. What is the importance of Gibb’s Phenomenon?
3. What is Static and Dynamic System?
4. What is Causal Signal?
5. What is Causality Condition of the Signal?
6. Define Noise?
7. What is the importance of FS?
8. What is the importance of FT?
9. Define LTV system?
10.Define LTI system?
Real Time Applications:
The Gibbs phenomenon, discovered by Henry Wilbraham and rediscovered by J.
Willard Gibbs (1899), is the peculiar manner in which the Fourier series of a
piecewise continuously differentiable periodic function behaves at a jump discontinuity.
To Eliminate noise in Filters.
SOFTWARE REQURIED: -
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY: -
Fourier Transform Theorems:
We may use Fourier series to motivate 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
PROCEDURE: -
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
%Fourier Transform%
clc;
clear all;
close all;
syms t;
x=exp(-2*t)*heaviside(t);
y=fourier(x);
disp('Fourier Transform of input signal'); y
z=ifourier(y);
disp('Inverse Fourier Transform of input signal'); z
mg=abs(y);
subplot(2,1,1);
ezplot(mg); xlabel('time'); ylabel('amplitude');
title('magnitude spectrum of a input signal'); grid;
pha=atan(imag(y)/real(y)); subplot(2,1,2); ezplot(pha);
xlabel('time'); ylabel('amplitude');
title('phasespectrum of a input signal'); grid;
OUTPUT:-
Fourier Transform
Fourier Transform of input signal Y=
1/(2+w*i)
Inverse Fourier Transform of input signal Z=
Heaviside(x)/exp(2*x)
0.4
amplitude
0.3
0.2
-6 -4 -2 0 2 4 6
time
phasespectrum of a input signal
1
amplitude
-1
-6 -4 -2 0 2 4 6
Time
RESULT: -
In this experiment the Fourier transform of a given signal and plotting its magnitude
and phase spectrum have been demonstrated using MATLAB.
Magnitude and Phase Spectrum of Fourier Transform
PROGRAM:-
clc; clear all; close all; syms t s ;
syms w float;
f=3*exp(-t)*heaviside(t);
F=fourier(f);
disp('the fourier transform of ……..
………..3*exp(-t)*u(t) =');
disp(F);
w=-2*pi:pi/50:2*pi;
F1=subs(F,w);
Fmag=abs(F1); % to find magnitude
Fphas=angle(F1); % to find phase
subplot(2,1,1);
plot(w,Fmag); xlabel('w >');
ylabel('Magnitude>');
title('Magnitude spectrum'); grid;
subplot(2,1,2); plot(w,Fphas);
xlabel('w>');
ylabel('Phase in radians>');
title('Phase spectrum'); grid;
EXERCISE PROGRAMS
1. Write a MATLAB program to find the cross correlation using FFT.
2. Write a MATLAB program to find F.T of the causal signal x(t)=t
3. Write a MATLAB program to find F.T of the causal signal x(t)=e^-at
4. Write a MATLAB program to find F.T of the causal signal x(t)=e^at
5. Write a MATLAB program to find F.T of the causal signal x(t)=te^at
6. Write a MATLAB program to find F.T of the causal signal x(t)=te^-at
7. Write a MATLAB program to find F.T of the causal signal x(t)=cost
8. Write a MATLAB program to find F.T of the causal signal x(t)=sint
9. Write a MATLAB program to find F.T of the causal signal x(t)=e^atcos(t)
10. Write a MATLAB program to find F.T of the causal signal x(t)= e^atsin(t)
11. Write a MATLAB program to find the cross correlation using DFT.
12. Write a MATLAB program to find F.T of the causal signal x(t)=at
13. Write a MATLAB program to find F.T of the causal signal x(t)=10e^-at
14. Write a MATLAB program to find F.T of the signal x(t)=1
15. Write a MATLAB program to find F.T of the causal signal x(t)=impulse function
16. Write a MATLAB program to find F.T of the causal signal x(t)=Delta function
17. Write a MATLAB program to find F.T of the causal signal x(t)=cos(at)
18. Write a MATLAB program to find F.T of the causal signal x(t)=sin(at)
19. Write a MATLAB program to find F.T of the causal signal x(t)=e^atcos(at)
20. Write a MATLAB program to find F.T of the causal signal x(t)= e^atsin(at)
21. .Write a MATLAB program to find the auto correlation using FFT.
22. Write a MATLAB program to find F.T of the causal signal x(t)=5t
23. Write a MATLAB program to find F.T of the causal signal x(t)=5e^-at
24. Write a MATLAB program to find F.T of the causal signal x(t)=5e^at
25. Write a MATLAB program to find F.T of the causal signal x(t)=5te^at
26. Write a MATLAB program to find F.T of the causal signal x(t)=e^-2t
27. Write a MATLAB program to find F.T of the causal signal x(t)=e^5t
Department of Electronics and Communication Engineering Page 89
BKM
MATLAB R2010a.
2.Windows XP SP2.
THEORY: -
The inverse Laplace transform is given by the following complex integral, which is known by
various names (the Bromwich integral, the Fourier-Mellin integral, and Mellin's inverse formula):
The integral converges if s>1. The functions exp(t) and 1/(s-1) are partner functions.
PROGRAM:-
%Laplace Transform%
clc
clear all;close all;syms t;
x=exp(-2*t)*heaviside(t);y=laplace(x);
disp('Laplace Transform of input
signal');y
z=ilaplace(y);
disp('Inverse Laplace Transform of input signal');z
OUTPUT: -
Laplace Transform
RESULT: -
Laplace and inverse laplace transforms were verified using MATLAB functions.
VIVA QUESTIONS: -
1. Define Laplace-Transform?
2. What is the Condition for Convergence of the L.T?
3. What is the Region of Convergence(ROC)?
4. State the Shifting property of L.T?
5. State convolution Property of L.T?6.Define Scaling Property of L.T?
7. Explain Time Convolution Property of L.T?
8. Explain Frequency Convolution Property of L.T?
9. Explain the linearity property of L.T?10.Describe the advantages of L.T?
EXPERMENT NO:12
GAUSSIAN NOISE
AIM: -
To Generate Gaussian Noise and to Compute its Mean, M.S. Values, Skew,
kurtosis,PS and PDF.
SOFTWARE REQURIED: -
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
OUTPUT:-
Gaussion noise
enter no of samples50
6
amplitude
total
0.5 4
0 0
0 20 40 60 0 0.5 1
sample numbers sample numbers
psd of a normal random signal
10
8
amplitude
0
0 5 10 15 20 25 30
sample numbers
RESULT: -
Additive White Gaussian noise was generated and its PSD and PDF were plotted and its
Mean, Standard Deviation, Kurtosis, Skew were Computed using MATLABfunctions.
VIVA QUESTIONS: -
SAMPLING THEORM
AIM: -
SOFTWARE REQURIED: -
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY: -
Sampling Theorem:
The theorem shows that a band limited analog signal that has been sampled can be perfectly
reconstructed from an infinite sequence of samples if the sampling rate exceeds 2B samples
per second, where B is the highest frequency in the original signal.
If a signal contains a component at exactly B hertz, then samples spaced at exactly 1/(2B)
seconds do not completely determine the signal, Shannon's statement notwithstanding.
Let gs(t) be the sampled signal. Its Fourier Transform Gs(w) isgiven by
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
%sampling
theorem%
clc;
clear all; close all;
t=0:0.001:1;f=5;
x=cos(2*pi*f*t);
plot(t,x);
%when fs>2fm%
fs1=3*f; ts1=1/fs1;
n1=0:ts1:1;
xs1=cos(2*pi*f*n1);
figure;
plot(n1,xs1,'r');
hold on;
plot(t,x);
hold off;
%when fs=2fm%
fs2=2*f;
ts2=1/fs2;
n2=0:ts2:1;
xs2=cos(2*pi*f*n2);
figure; plot(n2,xs2,'r');
hold on;
plot(t,x);
hold off;
%when fs<2fm%
fs3=1.5*f;
ts3=1/fs3;
n3=0:ts3:1;
xs3=cos(2*pi*f*n3);
figure;
plot(n3,xs3,'r');
hold on;
plot(t,x);
hold off;
sampling theorem
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
when fs>2fm
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
when fs<2fm
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
VIVA QUESTIONS: -
EXERCISE PROGRAM: -
AIM: -
SOFTWARE REQURIED: -
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY: -
Detection of a periodic signal masked by random noise is of greate importance The noise signal
encountered in practice is a signal with random amplitude variations. A signal is uncorrelated with
any periodic signal. If s(t) is a periodic signal and n(t) is anoise signal then
T/2 1/T
Lim ∫S(t)n(t-T) dt=0 for all T
-T/2
T/2
Qff(T)= Lim 1/T ∫f(t)f(t-T) dt
T->∞ -T/2
T/2
= Lim 1/T ∫[s(t)+n(t)][s(t-T)+n(t-T)]
dtT--∞ -T/2
=Qss(T)+Qnn(T)+Qsn(T)+Qns(T)
uncorrelatedQsn(t)=Qns(t)=0 ;Then
Qff(t)=Qss(t)+Qnn(t)
The Auto correlation function of a periodic signal is periodic of the same frequency and the Auto
correlation function of a non periodic signal is tends to zero for large value of T since s(t) is a
periodic signal and n(t) is non periodic signal so Qss(T) is a periodic where
as aQnn(T) becomes small for large values of T Therefore for sufficiently large
values ofT Qff(T) is equal to Qss(T).
f(t)=s(t)+n(t)
S(t)T/2
Qfc (t) = Lim 1/T ∫[s(t)+n(t)] [ c(t-T)] dt
T--∞-T/2
= Qsc(T)+Qnc(T)
C(t) is periodic function and uncorrelated with the random noise signal n(t).
HenceQnc(T0=0) Therefore Qfc(T)=Qsc(T)
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
%auto
correlation%clc;
clear all; close all; t=0:0.1:pi*4;
s=sin(t); k=2;
subplot(6,1,1) plot(s);
title('signal s');xlabel('t');
ylabel('amplitude');n = randn([1 126]);
f=s+n; subplot(6,1,2) plot(f);
title('signal f=s+n');
xlabel('t');
ylabel('amplitude');
as=xcorr(s,s);
subplot(6,1,3);
plot(as);
title('auto correlation of s');
xlabel('t');
ylabel('amplitude'); an=xcorr(n,n);
subplot(6,1,4)
plot(an);
title('auto correlation of n');xlabel('t');
ylabel('amplitude');
cff=xcorr(f,f);
subplot(6,1,5);
plot(cff);
title('auto correlation of f');
xlabel('t');
ylabel('amplitude');
hh=as+an;
subplot(6,1,6);
;plot(hh);
title('addition of as+an');
xlabel('t');
ylabel('amplitude');
OUTPUT: -
auto correlation
CROSS CORRELATION
RESULT:-
VIVA QUESTIONS:-
EXERCISE PROGRAMS
AIM: -
To generate a periodic sequence, corrupt it with zero mean White noise and extract the
sequence using periodic circular cross correlation.
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY: -
Removal of noise by Filtering is not the solution because noise contains power
at allfrequencies. Hence we use correlation techniques.
The theorem is useful for analyzing linear time-invariant systems, LTI systems, when the
inputs and outputs are not square integrable, so their Fourier transforms do not exist. A
corollary is that the Fourier transform of the autocorrelation function of the output of an LTI
system is equal to the product of the Fourier transform of the autocorrelation function of the
input of the system times the squared magnitude of the Fourier transform of the system
impulse response. This works even when the Fourier transforms of the input and output
signals do not exist because these signals are not square integrable, so the system inputs and
outputs cannot be directly related by the Fourier transform of the impulse response. Since the
Fourier transform of the autocorrelation function of a signal is the power spectrum of the
signal, this corollary is equivalent to saying that the power spectrum of the output is equal to
the power spectrum of the input times the power transfer function. This corollary is used in
the parametric method for power spectrum estimation.
PROGRAM:-
clc;
clear
all;close
all;
n=256;
k1=0:n-1;
x=cos(32*pi*k1/n)+sin(48*pi*k1/n);
plot(k1,x);
%Module to find period of input
signalk=2;
xm=zeros(k,1);ym=zeros(k,1);hold on;
for i=1:k
[xm(i) ym(i)]=ginput(1);
plot(xm(i),
ym(i),'r*');end;
period=abs(xm(2)-xm(1));
rounded_p=round(period); m=rounded p;
% Adding noise and plotting noisy
signaly=x+randn(1,n);
figure; plot(k1,y);
% To generate impulse train with the period as that of input
signal%d=zeros(1,n);
for i=1:n
if (rem(i-1,m)==0)d(i)=1;
end; end;
% correlating noisy signal and impulse
traincir=cxcorr1(y,d);
%plotting the original and reconstructed
signalm1=0:n/4;
figure
plot(m1,x(m1+1),'r',m1,m*cir(m1+1));
RESULT:-
Using Cross- correlation the periodic signal from noise was estimated
usingMATLAB.
EXERCISE PROGRAM:-
AIM: -
Verification of wiener–khinchine relation.
SOFTWARE REQURIED: -
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
The Wiener–Khinchin theorem (also known as the Wiener–Khintchine theorem and sometimes
as the Wiener–Khinchin–Einstein theorem or the Khinchin–Kolmogorov theorem) states that the
power spectral density of a wide-sense-stationary random process is the Fourier transform of
the corresponding autocorrelation function.
Continuous case:
Where
Discrete case:
and where is the power spectral density of the function with discrete values. Being a sampled and
discrete-time sequence, the spectral density is periodic in the frequencydomain.
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
% wiener–khinchine relation%
clc;
clear all; t=0:0.1:2*pi; x=sin(2*t); subplot(3,2,1);
plot(x); au=xcorr(x,x);
subplot(3,2,2);
plot(au);
v=fft(au); subplot(3,2,3);
plot(abs(v)); fw=fft(x);
subplot(3,2,4); plot(fw);
fw2=(abs(fw)).^2;
subplot(3,2,5);
plot(fw2);
OUTPUT:-
wiener–khinchine relation
RESULT:-
VIVA QUESTIONS: -
1. What is mean wiener–khinchine relation?
2. Define fourier transform and its inverse?
3. What is the difference b/w convolution and correlation?
4. What is the importance of power spectrum?
5. What is the importance of correlation?
6. Write the relation between Step and Impulse signals?
7. Write the relation between Ramp and impulse signals?
8. Write the relation between Ramp and Step signals?
9. Define Standerd signals?
10. Give examples of Standerd signals?
EXERCISE PROGRAMS
SOFTWARE REQURIED:-
1.MATLAB R2010a.
2.Windows XP SP2.
THEORY:-
The first property implies that the mean function m x(t) must be constant. The second
property implies that the correlation function depends only on the difference between t1 and
t2 and only needs to be indexed by one variable rather than two variables. Thus, instead of
writing,
Rx(t1-t2,0)we usually abbreviate the notation and write
This also implies that the auto covariance depends only on _ = t1 − t2, since
A random X(t) is stationary if its statistical properties are unchanged by a time shift in the time
Department of Electronics and Communication Engineering Page 128
BKM
1) E[X(t)]=μX(t)= μX(t+T)
If the statistical properties like mean value or moments depends on time then the random
processis said to be non-stationary.
When dealing with two random process X(t) and Y(t), we say that they are jointly wide-
sensestationary if each process is stationary in the wide-sense.
Rxy(t,t+T)=E[X(t)Y(t+T)]=Rxy(T).
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
PROGRAM:-
Clc; Close all;
clear all
y = randn([1 40]) my=round(mean(y));
z=randn([1 40]) mz=round(mean(z));
vy=round(var(y));
vz=round(var(z));
t = sym('t','real');h0=3;
x=y.*sin(h0*t)+z.*cos(h0*t);
mx=round(mean(x));
k=2;
xk=y.*sin(h0*(t+k))+z.*cos(h0*(t+k));x1=sin(h0*t)*sin(h0*(t+k)); x2=cos(h0*t)*cos(h0*(t+k));
c=vy*x1+vz*x1;
RESULT:-
VIVA QUESTIONS:-
EXERCISE PROGRAMS
AIM: -
To locating the zeros and poles and plotting the pole zero maps in s-plane and z-plane
for the given transfer function.
SOFTWARE REQURIED: -
1.MATLAB R2010a.
2.Windows XP SP2.
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 onein
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 zero2. The
complex frequencies that make the overall gain of the filter transfer functionzero.
Poles: 1. The value(s) for z where the denominator of the transfer function equals zero 2. The
complex frequencies that make the overall gain of the filter transfer functioninfinite.
the Z-transform converts a discrete time-domain signal, which is a sequence of real or complex
numbers, into a complex frequency-domain representation. The Z-transform, likemany other
integral transforms, can be defined as either a one-sided or two-sided transform.
Bilateral Z-transform
The bilateral or two-sided Z-transform of a discrete-time signal x[n] is the function X(z)defined
as
Unilateral Z-transform
Alternatively, in cases where x[n] is defined only for n ≥0, the single-sided or unilateralZ-
transform is defined as
The roots of the equation P(z) = 0 correspond to the 'zeros' of X(z)The roots of the equation
Q(z) = 0 correspond to the 'poles' of X(z)
PROCEDURE:-
Open MATLAB
Open new M-file
Type the program
Save in current directory
Compile and Run the program
For the output see command window\ Figure window
clc;
clear all;
close all;
num=input('enter numerator co-efficients');
den=input('enter denominator co-efficients');h=tf(num,den);
poles=roots(den); zeros=roots(num);sgrid;
pzmap(h);
grid on;
title('locating poles of zeros on s-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');
1.5 1.4
0.5 0.36 0.27 0.19 0.12 0.06
1.2
0.66
1
1
0.8
0.6
0.88
0.5 0.4
0.2
0.2
0.4
-0.5 0.88
0.6
0.8
-1 1
0.66
1.2
0.5 0.36 0.27 0.19 0.12 0.06
1.4
-1.5
-1 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0
0.5
Imaginary Part
-0.5
-1
-1.5
-1.5 -1 -0.5 0 0.5 1 1.5
Real Part
RESULT: -
In this experiment the zeros and poles and plotting the pole
zeromaps in s-plane and z-plane for the given transfer
function using MATLAB.
VIVA QUESTIONS: -
1.Study the details of ztrans() and iztrans() functions?
2.What are poles and zeros?
3.How you specify the stability based on poles and zeros?
4.Define S-plane and Z-plane?
5.What is the difference b/w S-plane and Z-plane?6.Define Scaling Property of Z-plane?
7. Explain Time Convolution Property of Z-plane?
8. Explain Frequency Convolution Property of Z-plane
9. Explain the linearity property of Z-plane?10.Describe the advantages of Z-plane?
1. Write a MATLAB program to find the impulse response of the following difference
equation3y(n)-5y(n-1)+4y(n-2)=x(n)-2x(n-1).
2. Write a MATLAB program to find the impulse response of the following difference
equation6y(n)-9y(n-1)-4y(n-2)=x(n)-5x(n-1).
3. Write a MATLAB program to find the impulse response of the following difference
equation8y(n)-6y(n-1)+4y(n-2)=x(n)+2x(n-1).
4. Write a MATLAB program to find the impulse response of the following difference
equation3y(n)+5y(n-1)+9y(n-2)=x(n)-9x(n-1).
5. Write a MATLAB program to find the impulse response of the following difference
equation6y(n)-5y(n-1)+4y(n-2)=x(n)-2x(n-1).
6. Write a MATLAB program to find the impulse response of the following difference
equation7y(n)-5y(n-1)+4y(n-2)=x(n)-9x(n-1).
7. Write a MATLAB program to find the impulse response of the following difference
equation3y(n)-5y(n-1)+4y(n-2)=x(n)-6x(n-1).
8. Write a MATLAB program to find the impulse response of the following difference
equation5y(n)-5y(n-1)+5y(n-2)=x(n)-2x(n-1).
9. Write a MATLAB program to find the impulse response of the following difference
equation3y(n)-6 y(n-1)+4y(n-2)=x(n)-7x(n-1).
10. Write a MATLAB program to find the impulse response of the following difference
equation2y(n)-5y(n-1)+4y(n-2)=x(n)-2x(n-1).
11. Write a MATLAB program to find the impulse response of the following difference
equation3y(n)-5y(n-1)+4y(n-2)=5x(n)-6x(n-1).
12. Write a MATLAB program to find the impulse response of the following difference
equation6y(n)-8y(n-1)-4y(n-2)=7x(n)-5x(n-1).
13. Write a MATLAB program to find the impulse response of the following difference
equation8y(n)-8y(n-1)+9y(n-2)=x(n)+5x(n-1).
14. Write a MATLAB program to find the impulse response of the following difference
equation3y(n)+9y(n-1)+9y(n-2)=9x(n)-5x(n-1).
15. Write a MATLAB program to find the impulse response of the following difference
equation6y(n)-5y(n-1)+4y(n-2)=7x(n)-2x(n-1).
16. Write a MATLAB program to find the impulse response of the following difference
equation7y(n)-5y(n-1)+4y(n-2)=x(n)-7x(n-1).
17. Write a MATLAB program to find the impulse response of the following difference
equation3y(n)-5y(n-1)+4y(n-2)=x(n)-6x(n-1).
18. Write a MATLAB program to find the impulse response of the following difference
equation5y(n)-5y(n-1)+5y(n-2)=7x(n)-2x(n-1).
19. Write a MATLAB program to find the impulse response of the following difference
equation3y(n)-6 y(n-1)+4y(n-2)=4x(n)-x(n-1).
20. Write a MATLAB program to find the impulse response of the following difference
equation2y(n)-5y(n-1)+4y(n-2)=x(n)-2x(n-1).
21. Write a MATLAB program to find the impulse response of the following difference equation