0% found this document useful (0 votes)
3 views37 pages

Lab EE

Uploaded by

namavijay292
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)
3 views37 pages

Lab EE

Uploaded by

namavijay292
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
You are on page 1/ 37

JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR

DEPARMENT OF ELECTRONICS & COMMUNICATION

JAIPUR ENGINEERING COLLEGE


RESEARCH CENTRE

Electronics and Communication


Engineering Signal Processing Lab
3EC4-23

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Vision of Institute

To become a renowned Centre of outcome based learning, and work towards academic,
professional, cultural and social enrichment of the lives of individuals and communities.
Mission of Institute

M1. Focus on evaluation of learning outcomes and motivate students to inculcate research
aptitude by project based learning.
M2. Identify, based on informed perception of Indian, regional and global needs, areas of
focus and provide platform to gain knowledge and solutions.
M3. Offer opportunities for interaction between academia and industry.
M4. Develop human potential to its fullest extent so that intellectually capable and
imaginatively gifted leaders can emerge in a range of professions.

Vision of Department

To contribute to the society through excellence in scientific and technical education, teaching and
research aptitude in Electronics & Communication Engineering to meet the needs of Global
Industry.

Mission of Department

M1. To equip the students with strong foundation of basic sciences and domain knowledge
of Electronics & Communication Engineering, so that they are able to creatively apply
their knowledge to design solution of problems arising in their career path.
M2. To induce the habits of lifelong learning in order to continuously enhance overall
performance.
M3. Students are able to communicate their ideas clearly and concisely so that they can work
in team as well as an individual.
M4. To make the students responsive towards the ethical, social, environmental and
economical growth of the society.

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Program Educational Objectives (PEO’s)

PEO1. To provide students with the fundamentals of engineering sciences with more emphasis
in Electronics & Communication Engineering by way of analyzing and exploiting
electronics & communication challenges.

PEO2. To train students with good scientific and Electronics & Communication Engineering
knowledge so as to comprehend, analyze, design and create electronics & communication
based novel products and solutions for the real life problems.

PEO3. To inculcate professional and ethical attitude, effective communication skills, teamwork
skills, multidisciplinary approach, entrepreneurial thinking and an ability to relate
Electronics & Communication Engineering with social issues.

PEO4. To provide students with an academic environment aware of excellence, leadership,


written ethical codes and guidelines, and the self-motivated life-long learning needed for
a successful Electronics & Communication Engineering professional career.

PEO5. To prepare students to excel in electronics & communication based industry and higher
education by educating students in Electronics & Communication Engineering field along
with high moral values and knowledge.

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Program Outcomes (PO’s)


PO1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals, and Electronics &
Communication Engineering specialization to the solution of complex Electronics & Communication Engineering
problems.

PO2. Problem analysis: Identify, formulate, research literature, and analyze complex Electronics & Communication
Engineering problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and
engineering sciences.

PO3. Design/development of solutions: Design solutions for complex Electronics & Communication Engineering problems
and design system components or processes that meet the specified needs with appropriate consideration for the public
health and safety, and the cultural, societal, and environmental considerations.

PO4. Conduct investigations of complex problems: Use research-based knowledge and research methods including design of
Electronics & Communication Engineering experiments, analysis and interpretation of data, and synthesis of the
information to provide valid conclusions.

PO5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern electronic engineering and
IT tools including prediction and modeling to complex Electronics & Communication Engineering activities with an
understanding of the limitations.

PO6. 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 Electronics & Communication
Engineering practice.

PO7. Environment and sustainability: Understand the impact of the professional Electronics & Communication Engineering
solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable development.

PO8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the Electronics &
Communication Engineering practice

PO9. Individual and team work: Function effectively as an individual, and as a member or leader in diverse teams, and in
multidisciplinary settings.

PO10. Communication: Communicate effectively on complex Electronics & Communication Engineering activities with the
engineering community and with society at large, such as, being able to comprehend and write effective reports and design
documentation, make effective presentations, and give and receive clear instructions.

PO11. Project management and finance: Demonstrate knowledge and understanding of the Electronics & Communication
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.

PO12. 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 Electronics & Communication Engineering changes.

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

COURSE OUTCOME:
Course Course Course Detail
Code Name Outcome s

CO1 Able to generate different Continuous and


Processing

Discrete
time signals.
CO2 Understand the basics of signals and different
3EC4-23

operations on signals.
Lab

CO3 Develop simple algorithms for signal processing


Signal

and test them using MATLAB


CO4 Able to generate the random signals having
different distributions, mean and variance.

CO-PO MAPPING:

Cours P P P P P P P P P P P P
e O O O O O O O O O O O O
Subje

Code

Outc 1 2 3 4 5 6 7 8 9 10 11 12
o me
ct

CO M L M
1
CO H L
2
3EC4-23

CO L M H L H
3
CO M L L M
4

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Detailed Syllabus

Class: III Sem. B.Tech. Evaluatio


n
Branch: ECE Examination Time = Two (2)
Schedule per Hours Maximum Marks =
Week 50
Practical Hrs : 2 [Sessional (30) & End-term (20)]
hr/week

S. No. List of Experiments as per RTU


Syllabus
Generation of continuous and discrete elementary signals (periodic and non-
1. periodic) using mathematical expression.

Generation of Continuous and Discrete Unit Step Signal.


2.

3. Generation of Exponential and Ramp signals in Continuous & Discrete


domain.

4. Continuous and discrete time Convolution (using basic definition).


Adding and subtracting two given signals. (Continuous as well as Discrete
5. signals)
To generate uniform random numbers between (0, 1).
6.

7. To generate a random binary wave.


To generate and verify random sequences with arbitrary distributions, means
8. and variances for following: (a) Rayleigh distribution (b) Normal distributions:
N (0, 1). (c) Gaussion distributions: N (m, x).

9. To plot the probability density functions. Find mean and variance for the
above distributions.

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

PROGRAM 1

AIM: Generation of continuous and discrete elementary signals (Periodic and non periodic)
using mathematical expression.

Software requirement: - SCI LAB

Theory: A wave is a disturbance that transfers energy from one place to another without requiring
any net flow of mass. Waves can be broadly separated into pulses and periodic waves. A pulse is
a single disturbance while a periodic wave is a continually oscillating motion. There is a close
connection between simple harmonic motion and periodic waves; in most periodic waves, the
particles in the medium experience simple harmonic motion.
Waves can also be separated into transverse and longitudinal waves. In a transverse wave, the
motion of the particles of the medium is at right angles (i.e., transverse) to the direction the wave
moves. In a longitudinal wave, such as a sound wave, the particles oscillate along the direction of
motion of the wave.
Surface waves, such as water waves, are generally a combination of a transverse and a longitudinal
wave. The particles on the surface of the water travel in circular paths as a wave moves across the
surface.
Periodic waves
A periodic wave generally follows a sine wave pattern, as shown in the diagram.

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Program code

//continous time cosine signal //discrete time cosine signal


t=-5:0.0001:5; n = -20:1:20;
F=1; f = 1/20;
y1=cos(2*F*t*3.14); y4=cos(2*f*n*3.14);
subplot(3,2,1); subplot(3,2,2);
plot(t,y1); xlabel('Time'); plot2d3(n,y4);
ylabel('Magnitude'); xlabel('Time');
title('continous time cosine signal'); ylabel('Magnitude');
title('discrete time cosine signal');

//continous time sine signal


y2=sin(2*F*t*3.14); //discrete time sine signal
subplot(3,2,3); y5=sin(2*f*n*3.14);
subplot(3,2,4);
plot(t,y2); xlabel('Time');
plot2d3(n,y5);
ylabel('Magnitude');
xlabel('Time');
title('continous time sine signal');
ylabel('Magnitude');
title('discrete time sine signal');
//continous time aperiodic signal
y3=sin(2*F*t*3.14).*t; //discrete time aperiodic signal
subplot(3,2,5); y6=cos(2*f*n*3.14).*n;
plot(t,y3); subplot(3,2,6);
xlabel('Time'); plot2d3(n,y6);
ylabel('Magnitude'); xlabel('Time');
title('continous time aperiodic ylabel('Magnitude');
signal'); title('discrete time aperiodic
signal');

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Figure (Expected output):

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

PROGRAM 2

AIM: Generation of Continuous and Discrete Unit Step Signal.

Software requirement: - SCI LAB

Unit step: A signal with magnitude one for time greater than zero. We can assume it as a dc
signal which got switched on at time equal to zero.
Unit step function is denoted by u (t). It is defined as u (t) =

• It is used as best test signal.


• Area under unit step function is unity.

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Program code
t=-10:0.001:10; n=-10:1:10;
x0=0; x0=0;
x1=1; x1=1;
y1=x1*(t>=0)+x0*(t<0); y7=x1*(n>=0)+x0*(n<0);
subplot(4,3,1); subplot(4,3,7);
plot(t,y1); plot2d3(n,y7);
xlabel('Time'); xlabel('Time');
ylabel('Magnitude'); ylabel('Magnitude');
title('Continuous Unit Step Function'); title('discrete Unit Step u(n) Function');

y2=x1*(t>=6)+x0*(t<6); y8=x1*(n>=6)+x0*(n<6);
subplot(4,3,2); subplot(4,3,8);
plot(t,y2); plot2d3(n,y8);
xlabel('Time'); xlabel('Time');
ylabel('Magnitude'); ylabel('Magnitude');
title('Continuous Unit Step u(t-6) title('discrete Unit Step u(n-6)
Function'); Function');

y3=x1*(t>=-6)+x0*(t<-6); y9=x1*(n>=-6)+x0*(n<-6);
subplot(4,3,3); subplot(4,3,9);
plot(t,y3); plot2d3(n,y9);
xlabel('Time'); xlabel('Time');
ylabel('Magnitude'); ylabel('Magnitude');
title('Continuous Unit Step u(t+6) title('discrete Unit Step u(n+6)
Function'); Function');

y4=x0*(t>=4)+x1*(t<4); y10=x0*(n>=4)+x1*(n<4);
subplot(4,3,4); subplot(4,3,10);
plot(t,y4); plot2d3(n,y10);
xlabel('Time'); xlabel('Time');
ylabel('Magnitude'); ylabel('Magnitude');
title('Continuous Unit Step u(-t+4) title('discrete Unit Step u(-n+4)
Function'); Function');

y5 = y3 - y2; y11 = y9 - y8;


subplot(4,3,5); subplot(4,3,11);
plot(t,y5); plot2d3(n,y11);
xlabel('Time'); xlabel('Time');
ylabel('Magnitude'); ylabel('Magnitude');
title('Continuous Unit Step u(t+6)-u(t-6) title('discrete Unit Step u(n+6)-u(n-6)
Function'); Function');

y6 = y3 + y2; y12 = y9 + y8;


subplot(4,3,6); subplot(4,3,12);
plot(t,y6); plot2d3(n,y12);
xlabel('Time'); xlabel('Time');
ylabel('Magnitude'); ylabel('Magnitude');
title('Continuous Unit Step u(t+6)+u(t-6) title('discrete Unit Step u(n+6)+u(n-6)
Function'); Function');

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Figure (Expected output):

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

PROGRAM 3

AIM: Generation of Exponential and Ramp signals in Continuous & Discrete domain.

Software requirement: - SCI LAB

Ramp signal: A signal whose magnitude increases same as time. It can be obtained by
integrating unit step.Ramp signal is denoted by r (t), and it is defined as r (t) =

Area under unit ramp is unity.

Exponential signal: Exponential signal is in the form of x (t) = eαt. The shape of exponential can
be defined by α.
Case i: if α= 0 → x(t) =e0= 1

Case ii: if α< 0 i.e. -ve then x (t) = e-αt.


The shape is called decaying exponential.

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Case iii: if α> 0 i.e. +ve then x (t) = eαt .


The shape is called rising exponential.

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Program code

t=-2:0.01:2;
a=2; //discrete time //continous ramp signal
//continous time increasing exponential x0=0;
increasing exponential signal y5=t.*(t>=0)+x0.*(t<0);
signal n=-5:1:5; subplot(3,2,5);
y1=exp(a*t); a = 1/4; plot(t,y5);
subplot(3,2,1); y3=exp(a*n); xlabel('time');
plot(t,y1); subplot(3,2,3); ylabel('amplitude');
xlabel('time'); plot2d3(n,y3); title('continous ramp
ylabel('amplitude'); xlabel('time'); signal');
title('continous time ylabel('amplitude');
increasing exponential title('discrete time //discrete ramp signal
signal'); increasing exponential y6=n.*(n>=0)+x0*(n<0);
signal'); subplot(3,2,6);
//continous time plot(n,y6);
decreasing exponential //discrete time xlabel('time');
signal decreasing exponential ylabel('amplitude');
y2=exp(-a*t); signal title('discrete ramp
subplot(3,2,2); y4=exp(-a*n); signal');
plot(t,y2); subplot(3,2,4);
xlabel('time'); plot2d3(n,y4);
ylabel('amplitude'); xlabel('time');
title('continous time ylabel('amplitude');
decreasing exponential title('discrete time
signal'); decreasing exponential
signal');

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Figure (Expected output):

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

PROGRAM 4

AIM: Continuous and Discrete Time Convolution (Using Basic Definition).

Software requirement: - SCI LAB

Theory: A convolution is an integral that expresses the amount of overlap of one function as it is
shifted over another function.It therefore "blends" one function with another. For example, in
synthesis imaging, the measured dirty map is a convolution of the "true" CLEAN map with the
dirty beam (the FOURIER TRANSFORM of the sampling distribution). The convolution is
sometimes also known by its German name, faltung ("folding").
Abstractly, a convolution is defined as a product of functions and that are objects in the algebra
of SCHWARTZ FUNCTIONS in. Convolution of two functions and over a finite range is given
by

Where the symbol denotes convolution of and .


Convolution is more often taken over an infinite range,

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Program code

(4A) (4B) (4C)


x=input('enter first sequence'); x = input('enter the
b1=input('enter the lower limit'); first seq');
u1=input('enter the upper limit'); t1=-5:1:0 N1 = length(x);
x1=b1:1:u1; t2=0:1:2; n1 = 0:1:N1-1;
h=input('enter second sequence'); t3=2:1:5; subplot(2,2,1);
b2=input('enter the lower limit'); plot2d3(n1,x);
u2=input('enter the upper limit'); h1=zeros(size(t1)) xlabel('time');
h1=b2:1:u2; ; ylabel('mag');
b=b1+b2; h2=ones(size(t2)); title('seq of x');
u=u1+u2; h3=zeros(size(t3))
a=b:1:u; ; h = input('enter the
m=length(x); second seq');
n=length(h); t=[t1 t2 t3]; N2 = length(h);
X=[x,zeros(1,n)]; h=[h1 h2 h3]; n2 = 0:1:N2-1;
subplot(2,2,1); subplot(3,1,1); subplot(2,2,2);
disp('x(n) is:'); plot(t,h); plot2d3(n2,h);
disp(x); xlabel('time'); xlabel('time');
plot2d3(x1,x); ylabel('magnitude' ylabel('mag');
xlabel('n'); ); title('seq of h');
ylabel('x(n)');
title('first squence'); a1=-5:1:0; y=conv(x,h);
grid on; a2=0:1:4; n = 0:1:N1+N2-2;
H=[h,zeros(1,m)]; a3=4:1:6; subplot(2,2,[3 4]);
subplot(2,2,2); plot2d3(n,y);
disp('h(n) is;'); x1=zeros(size(a1)) xlabel('time');
disp(h); ; ylabel('mag');
plot2d3(h1,h); x2=ones(size(a2)); title('convolution')
xlabel('n'); x3=zeros(size(a3)) ;
ylabel('h(n)'); ;
title('second sequence');
grid on; a=[a1 a2 a3];
for i=1:n+m-1 x=[x1 x2 x3];
Y(i)=0; subplot(3,1,2);
for j=1:m; plot(a,x);
if((i-j+1)>0) xlabel('time');
Y(i)=Y(i)+(X(j)*H(i-j+1)); ylabel('magnitude'
else );
end
end
end c=conv(x2,h2);
subplot(2,2,[3 4]); subplot(3,1,3);
disp('y(n) is:'); plot(c);
disp(Y); xlabel('time');
plot2d3(a,Y); ylabel('magnitude'
xlabel('n'); );
ylabel('Y(n)');
title('output sequence');
grid on;

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Figure (Expected output):


Figure 4(c):

Input:
enter the first seq:=[0 1 2 3]
enter the second seq:=[2 3 4]

Output
y(n)= [0 2 7 16 17 12]

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Figure 4(b):

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Figure 4(a):

Input & Output


Enter first sequence: = [-2 -4 5 6]
Enter the lower limit: =-1
Enter the upper limit: =2
Enter second sequence: = [3 4 5]
Enter the lower limit: =0
Enter the upper limit: =2
X (n) is:
-2 -4 5 6

H (n) is;
3 4 5

Y (n) is:
-6 -20 -11 18 49 30 38 24

Result:-I have performed convolution on mat lab successfully.


(ECE/LAB FILE/3EC4-23 SP LAB)
JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

PROGRAM 5

AIM: Adding and subtracting two given signals (continuous as well as discrete
signals).
Software requirement: - SCI LAB

Program Code
clc; //discrete signal
//continuous signal n=0:1:30;
t = 0:0.001:30; a=n;
y1 = t; b=2*n;
y2 = 2*t; //First Signal
//First Signal subplot(4,2,5);
subplot(4,2,1); plot2d3(n,a);
plot(t,y1); xlabel('time');
xlabel('time'); ylabel('magnitude');
ylabel('magnitude'); title('First Signal');
title('First Signal'); //Second Signal
//Second Signal subplot(4,2,6);
subplot(4,2,2); plot2d3(n,b);
plot(t,y2); xlabel('time');
xlabel('time'); ylabel('magnitude');
ylabel('magnitude'); title('Second Signal');
title('Second Signal'); c=a+b;
y3 = y1+y2; d=a-b;
y4 = y1-y2; //Addition
//Addition subplot(4,2,7);
subplot(4,2,3); plot2d3(n,c);
plot(t,y3); xlabel('time');
xlabel('time'); ylabel('magnitude');
ylabel('magnitude'); title('Addition');
title('Addition'); //subtraction
//subtraction subplot(4,2,8);
subplot(4,2,4); plot2d3(n,d);
plot(t,y4); xlabel('time');
xlabel('time'); ylabel('magnitude');
ylabel('magnitude'); title('Subtraction');
title('Subtraction');

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Figure (Expected output):

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

PROGRAM 6

AIM: To generate uniform random numbers between (0, 1).


Software requirement: - SCI LAB
Theory:
Two Classes Signals
Signals are subdivided into two classes, namely,
(1)Deterministic signals
(2) Random signals
Deterministic Signals & Random Signals
Signals that can be modelled exactly by a mathematical formula are known as deterministic signals.
Deterministic signals are not always adequate to model real-world situations. Random signals, on
the other hand, cannot be described by a mathematical equation; they are modeled in probabilistic
terms.
It’s fairly easy to generate uncorrelated pseudo- random sequences. MATLAB has two built-in
functions to generate pseudo-random numbers, namely rand and randn. The rand function
generates pseudo-random numbers whose elements are uniformly distributed in the interval (0,1).
You can view this as tossing a dart at a line segment from 0 to 1, with the dart being equally likely
to hit any point in the interval [0,1]. The randn function generates pseudo-random numbers whose
elements are normally distributed with mean 0 and variance 1 (standard normal). Both functions
have the same syntax. For example, rand(n) returns a n-by- n matrix of random numbers, rand(n,m)
returns a n-by-m matrix with randomly generated entries distributed uniformly between 0 and 1.,
and rand(1) returns a single random number.
- Random Number Generation: Pseudo-random Numbers -
>> %Generate one thousand uniform pseudo-random numbers
% return a row vector of 1000
>>rand(1,1000) entries
>>%Generate one thousand gaussian pseudo-random numbers
% return a row vector of 1000
>>randn(1,1000); entries

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Program Code
clc;
n=input('Enter the number which is generated:');
y=rand(n);
//continuous signal
subplot(2,1,1);
plot(y);
xlabel('n');
ylabel('magnitude');
title('continuous signal');
//discrete signal
subplot(2,1,2);
plot2d3(y);
xlabel('n');
ylabel('magnitude');
title('discrete signal;');

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Figure (Expected output):

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

PROGRAM 7

AIM: To generate a random binary wave.


Software requirement: - SCI LAB

Program Code
n = input('enter the total number which is generated N=');
j = 0;
y1 = rand(1,n);
y = round(y1);
for i= 1:n
if y(i) == 1;
j(i) = ones;
else
j(i) = zeros;
end
end
plot2d3(j);
xlabel('no. of random signal');
ylabel('amplitude');
title('plot of random in ones and zeros 0-1');

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Figure (Expected output):

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

PROGRAM 8

AIM: To generate and verify random sequences with arbitrary distributions, means and
Variances for following:
(a) Rayleigh distribution
(b) Normal distributions: N(0,1)
(c) Poisson distributions: N(m, x)

Software requirement: - SCI LAB


Theory:
(a) The Rayleigh distribution- it is a special case of the WEIBULL DISTRIBUTION. If A and B are
the parameters of the Weibull distribution, then the Rayleigh distribution with parameter b is
equivalent to the Weibull distribution with parametersA=21/2 b and B = 2.
If the component velocities of a particle in the x and y directions are two independent normal
random variables with zero means and equal variances, then the distance the particle travels per
unit time is distributed Rayleigh.
In communications theory NAKAGAMI DISTRIBUTION, RICIAN DISTRIBUTION, and Rayleigh
distributions are used to model scattered signals that reach a receiver by multiple paths. Depending
on the density of the scatter, the signal will display different fading characteristics. Rayleigh and
Nakagami distributions are used to model dense scatters, while Rician distributions model fading
with a stronger line-of-sight. Nakagami distributions can be reduced to Rayleigh distributions, but
give more control over the extent of the fading.
The Rayleigh pdf is
y= f(x) =
(b) The Normal distributions-

A normal distribution in a VARIATE with MEAN and VARIANCE is a statistic distribution


with probability density function

(1)

on the domain . While statisticians and mathematicians uniformly use the term "normal
distribution" for this distribution, physicists sometimes call it a Gaussian distribution and, because

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

of its curved flaring shape, social scientists refer to it as the "bell curve."
The so-called "standard normal distribution" is given by taking and in a general normal
distribution. An arbitrary normal distribution can be converted to a standard normal distribution
by changing variables to , so , yielding

(c) The Poisson distributions-


A Poisson random variable is the number of successes that result from a Poisson experiment. The
probability distribution of a Poisson random variable is called a Poisson distribution.
Given the mean number of successes (μ) that occur in a specified region, we can compute the Poisson
probability based on the following formula:
Poisson Formula. Suppose we conduct a Poisson experiment, in which the average number of successes
within a given region is μ. Then, the Poisson probability is:
P(x; μ) = (e-μ) (μx) / x!
Where x is the actual number of successes that result from the experiment and e is approximately equal
to 2.71828.
The Poisson distribution has the following properties:
• The mean of the distribution is equal to μ .
• The variance is also equal to σ.

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Program code
//normal distribution //rayleigh distribution //poission distribution
x = -5:0.01:5; x = -5:1:15; x = -5:1:15;
y1 = (normpdf(x,0,1)); y1 = (poisspdf(x,4)); y1 = (raylpdf(x,4));
y2 = (normpdf(x,0.1,2)); y2 = (poisspdf(x,2)); y2 = (raylpdf(x,2));
y3 = (normpdf(x,0,0.5)); y3 = (poisspdf(x,1)); y3 = (raylpdf(x,1));
subplot(3,1,1); subplot(3,1,2); subplot(3,1,3);
plot(x,y1,'.',x,y2,'- plot(x,y1,'.',x,y2,'- plot(x,y1,'.',x,y2,'-
',x,y3,'*'); ',x,y3,'*'); ',x,y3,'*');
xlabel('value of x'); xlabel('value of x'); xlabel('value of x');
ylabel('value of y'); ylabel('value of y'); ylabel('value of y');
title('normal title('rayleigh title('poission
distribution'); distribution'); distribution');

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Figure (Expected output):

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

PROGRAM 9

AIM: To plot the probability density functions. Find mean and variance for the above
Distributions

Software requirement: - SCI LAB


Theory: PDF: in probability theory, a probability density function (PDF), or density of a
continous random variable, is a function, whose value at any given sample (or point) in the sample
space (the set of possible values taken by the random variable) can be interpreted as providing a
relative likelihood that the value of the random variable would equal that sample.In other words,
while the absolute likelihood for a continuous random variable to take on any particular value is 0
(since there are an infinite set of possible values to begin with), the value of the PDF at two different
samples can be used to infer, in any particular draw of the random variable, how much more likely
it is that the random variable would equal one sample compared to the other sample.
In a more precise sense, the PDF is used to specify the probability of the random variable falling
within a particular range of values, as opposed to taking on any one value. This probability is given
by the integral of this variable’s PDF over that range—that is, it is given by the area under the
density function but above the horizontal axis and between the lowest and greatest values of the
range. The probability density function is nonnegative everywhere, and its integral over the entire
space is equal to one.
The terms "probability distribution functions" and "probability function" have also sometimes been
used to denote the probability density function. However, this use is not standard among
probability and statisticians. In other sources, "probability distribution function" may be used when
the probability distribution is defined as a function over general sets of values, or it may refer to
the cumulative distribution function, or it may be a probability mass function (PMF) rather than
the density. "Density function" itself is also used for the probability mass function, leading to
further confusion. In general though, the PMF is used in the context of discrete random variables
(random variables that take values on a discrete set), while PDF is used in the context of continuous
random variables.

CDF: (Cumulative Distribution Function)As the name cumulative suggests, this is simply the
probability up to a particular value of the random variable, say x. Generally denoted by F, F= P
(X<=x) for any value of x in the X space. It is defined for both discrete and continuous random

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

variables.

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Program code
//pdf //cdf
mu = 100; mu = 100;
sigma = 15; sigma = 15;
xmin = 70; xmin = 70;
xmax = 130; xmax = 130;
n = 100; n = 100;
k = 10000; k = 10000;
x = linspace(xmin,xmax,n); x = linspace(xmin,xmax,n);
p = normpdf(x,mu,sigma); c = normcdf(x,mu,sigma);
subplot(2,1,1); subplot(2,1,2);
plot(x,p); plot(x,c);
xlabel('x'); xlabel('x');
ylabel('pdf'); ylabel('pdf');
title('probability density function'); title('cumulative distribution
function');

(ECE/LAB FILE/3EC4-23 SP LAB)


JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE, JAIPUR
DEPARMENT OF ELECTRONICS & COMMUNICATION

Figure (Expected output):

(ECE/LAB FILE/3EC4-23 SP LAB)

You might also like