SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
JNU/ECE/SPL-01/EC507
1 Signal Processing Lab-I Created By Jitendra Jangid
EXPERIMENT-01
Aim:- Generation of Continuous and Discrete Elementary signals (Periodic and Non-
periodic) using mathematical expression.
Software Requirement-Matlab 7.0
Theory-
Continuous-Time and Discrete-Time Signals: A signal x(t) is a continuous-time signal if t is a
continuous variable. If t is a discrete variable, that is, x(t) is defined at discrete times, then x(t) is
a discrete-time signal.
Periodic and Non periodic Signals: A continuous-time signal x(t) is to be periodic with period T
if there is a positive nonzero value of T for which
X(t+T)=x(t) all t
Any continuous-time signal which is not periodic is called a non-periodic signal.
Periodic discrete-time signal are defined analogously. A sequence x[n] is periodic with period N
if there is a positive integer N for which
X[n+N]=x[n] all n
Coding:-
Continuous periodic time signal
time= input('Enter The time duration = ')
t=0:0.1:time ;
F=1;
y=cos(2*F*t*pi);
plot(t,y); %plot command to plot the graph%
xlabel('TIME');
ylabel('amplitude y(t)=cos(2*F*t*pi)');
title('continuous periodic signal') %title of the signal
y2=sin(2*F*t*pi);
figure;
plot(t,y2); %plot command to plot the graph%
xlabel('TIME');
ylabel('amplitude y2(t)=sin(2*F*t*pi)');
title('continuous periodic signal'); %title of the signal
JNU/ECE/SPL-01/EC507
2 Signal Processing Lab-I Created By Jitendra Jangid
Discrete periodic time signal
time= input('Enter The time duration = ')
t=0:0.1:time ;
F=1;
y=cos(2*F*t*pi);
stem(t,y); %plot command to plot the graph%
xlabel('TIME');
ylabel('amplitude y(t)=cos(2*F*t*pi)');
title('discrete periodic signal') %title of the signal
y2=sin(2*F*t*pi);
figure;
stem(t,y2); %plot command to plot the graph%
xlabel('TIME');
ylabel('amplitude y2(t)=sin(2*F*t*pi)');
title('discrete periodic signal'); %title of the signal
Non periodic continuous signal
JNU/ECE/SPL-01/EC507
3 Signal Processing Lab-I Created By Jitendra Jangid
t=0:2:50;
y=cos(t/2).*cos(t*pi/4)
plot(y)
xlabel('time')
ylabel('amplitude')
title('aperiodical continous signal ')
Non periodic Discrete signal
t=0:2:50;
y=cos(t/2).*cos(t*pi/4)
stem(y)
xlabel('time')
ylabel('amplitude')
title('aperiodical discrete signal ')
JNU/ECE/SPL-01/EC507
4 Signal Processing Lab-I Created By Jitendra Jangid
Result:- Various periodic and non-periodic signals has been studied.
JNU/ECE/SPL-01/EC507
5 Signal Processing Lab-I Created By Jitendra Jangid
EXPERIMENT-02
AIM: Generation of various continuous and discrete unit step signals.
Software Requirement- Matlab 7.0
Theory- Continuous time unit step signals is also a basic continuous time signal and is denoted
by u(t) this function is defined as.
U(t)= 1 t>0
0 t<0
Discrete time unit step signal:-
U(n) = 1 n>=0
0 n<0
Coding:-
Continuous unit step signal
t1=0:5:50
t2=-50:5:0
y1=ones(size(t1))
y2=zeros(size(t2))
t=[t2 t1]
y=[y2 y1]
plot(t,y)
xlabel('t')
title('cont. unit step')
JNU/ECE/SPL-01/EC507
6 Signal Processing Lab-I Created By Jitendra Jangid
Discrete Unit Step Signal:-
n1=0:5:30
n2=-50:5:0
y1=ones(size(n1))
y2=zeros(size(n2))
n=[n2 n1]
y=[y2 y1]
stem(n,y)
xlabel('n')
title('discrete unit step')
Result:-
JNU/ECE/SPL-01/EC507
7 Signal Processing Lab-I Created By Jitendra Jangid
EXPERIMENT NO:3
Aim: Generation of Exponential and Ramp signals in Continuous & Discrete domain.
Software used: Matlab 7.0
Theory:
Continuous-time complex exponential and sinusoidal signals:
x(t) = C*eat
where C and a are in general complex numbers.
The case a > 0 represents exponential growth. Some signals in unstable systems exhibit
exponential
growth.
The case a < 0 represents exponential decay. Some signals in stable systems exhibit exponential
decay
Ramp signal : The ramp function ( ) may be defined analytically in several ways and
definitions are:
JNU/ECE/SPL-01/EC507
8 Signal Processing Lab-I Created By Jitendra Jangid
Continuous exponential signal
n= input('Enter the value of N=');
t=0:1:n;
M=2;
y1=M*exp(t*1); %multiplication factor m =1;
y2=M*exp(t*2); %multiplication factor m =1;
subplot(211)
plot(t,y1)
xlabel('time ')
ylabel('ampitude');
title('Continuous exponential signal with m = 1 ');
subplot(212)
plot(t,y2)
xlabel('time ')
ylabel('ampitude');
title('Continuous exponential signal with m = 2');
JNU/ECE/SPL-01/EC507
9 Signal Processing Lab-I Created By Jitendra Jangid
Discrete exponent signal:
n= input('Enter the value of N=');
t=0:1:n;
M=2;
y1=M*exp(t*1); %multiplication factor m =1;
y2=M*exp(t*2); %multiplication factor m =1;
subplot(211)
stem(t,y1)
xlabel('time ')
ylabel('ampitude');
title('discrete exponential signal with m = 1 ');
subplot(212)
stem(t,y2)
xlabel('time ')
ylabel('ampitude');
title('discrete exponential signal with m = 2');
JNU/ECE/SPL-01/EC507
10 Signal Processing Lab-I Created By Jitendra Jangid
Continuous ramp signal
n= input('Enter the value of N=');
t=0:1:n;
y1=t; %multiplication factor m =1;
y2=t*2; %multiplication factor m =1;
subplot(211)
plot(t,y1)
xlabel('time ')
ylabel('ampitude');
title('continuous ramp signal with m = 1 ');
subplot(212)
plot(t,y2)
xlabel('time ')
ylabel('ampitude');
title('continuous ramp signal with m = 2');
JNU/ECE/SPL-01/EC507
11 Signal Processing Lab-I Created By Jitendra Jangid
Discrete ramp signal
n= input('Enter the value of N=');
t=0:1:n;
y1=t; %multiplication factor m =1;
y2=t*2; %multiplication factor m =1;
subplot(211)
stem(t,y1)
xlabel('time ')
ylabel('ampitude');
title('discrete ramp signal with m = 1 ');
subplot(212)
stem(t,y2)
xlabel('time ')
ylabel('ampitude');
title('discrete ramp signal with m = 2');
Result:
JNU/ECE/SPL-01/EC507
12 Signal Processing Lab-I Created By Jitendra Jangid
EXPERIMENT NO:4
Aim: To generate continuous and discrete convolution time signal
Software used: Matlab 7.0
Theory:
Convolution theorem for continuous system:If the impulse response of an analog or continuous
time system be h(t), it means that for an input δ(t) its output is h(t). Hence for all linear system its
output for a shifted impulse δ(t-T) is h(t-T). The following are the mathematical representation
of these operations:
δ(t) h(t)
δ(t-T)  h(t-T)
x(t) δ(t-T)  x(T) h(t-T)
∫ x(T) δ(t-T) dT  ∫ x(T) h(t-T) dT
From the last two statements, we can say that an input x(T) δ(t-T) the output is x(T) h(t-T) and
for an input of continuous summation or integration of x(T) δ(t-T), the output is also continuous
summation of x(T) h(t-T). Therefore, we can write by the linearity of the system
y(t)= ∫ x(T) h(t-T) dT
The right hand side of the above equation is defined as convolution of x(t) with h(t) and now we
can write it as follow:
y(t)= convolution of x(t) and h(t)
= x(t) * h(t)
= ∫ x(T) h(t-T) dT
The symbol ‘*’ stands for convolution.
Convolution for discrete time function:
If x(n) is applied as an input to a discret time system, the response y(n) of the system is given by
y(n)= T[x(n)]=t[∑ x(k) δ(n-k)]
to study LTI systems linear convolution plays an important role.
JNU/ECE/SPL-01/EC507
13 Signal Processing Lab-I Created By Jitendra Jangid
Continuous convolution time system:
t1=[-10:1:0];
t2=[0:1:2];
t3=[2:1:10];
x=zeros(size(t1));
y=ones(size(t2));
z=zeros(size(t3));
t=[t1,t2,t3];
a=[x,y,z];
subplot(2,2 ,1);
plot(t,a,'m');
xlabel('time-->');
ylabel('u(t)-u(t-2)');
u1=[-11:1:0];
u2=[0:1:3];
u3=[3:1:11];
v1=zeros(size(u1));
v2=ones(size(u2));
v3=zeros(size(u3));
u=[u1,u2,u3];
b=[v1,v2,v3];
subplot(2,2,2);
plot(u,b,'m')
xlabel('time-->');
ylabel('u(t)-u(t-3)');
c=conv(y,v2);
subplot(2,2,3);
plot(c);
xlabel('time-->');
ylabel('(u(t)-u(t-2))*(u(t)-u(t-3))');
JNU/ECE/SPL-01/EC507
14 Signal Processing Lab-I Created By Jitendra Jangid
-10 -5 0 5 10
0
0.2
0.4
0.6
0.8
1
time-->
u(t)-u(t-2)
-15 -10 -5 0 5 10 15
0
0.2
0.4
0.6
0.8
1
time-->
u(t)-u(t-3)
1 2 3 4 5 6
1
1.5
2
2.5
3
time-->
(u(t)-u(t-2))*(u(t)-u(t-3))
Result:
JNU/ECE/SPL-01/EC507
15 Signal Processing Lab-I Created By Jitendra Jangid
EXPIREMENT: 5
Aim: Adding and subtracting two given signals. (Continuous as well as Discrete signals)
Software used: Matlab 7.0
Theory:
Addition of two ram signal in continuous and discrete n manner
Code:
n= input('Enter the value of N=');
t=0:1:n;
y1=t; %multiplication factor m =1;
y2=t*2; %multiplication factor m =2;
y3=y1+y2;
subplot(221)
plot(t,y1);
xlabel('time ')
ylabel('ampitude');
title('continuous ramp signal with m = 1 ');
subplot(222)
plot(t,y2)
xlabel('time ')
ylabel('ampitude');
title('continuous ramp signal with m =2');
subplot(223);
plot(t,y3);
xlabel('time ')
ylabel('ampitude');
title('addition of two continuous ramp signal with m = 1 and m =2');
subplot(224)
stem(t,y3)
xlabel('time ')
ylabel('ampitude');
title('addition of ramp signal in DISCRETE in time');
JNU/ECE/SPL-01/EC507
16 Signal Processing Lab-I Created By Jitendra Jangid
Addition and Subtraction of two discrete different signals
a=[0 1 1 1 2 1 ]
b=[1 0 1 1 1 2 ]
c=a+b;
d=a-b;
subplot(221)
plot(a);
xlabel('time');
ylabel('amplitude');
title('first a signal ')
subplot(222)
plot(b);
xlabel('time');
ylabel('amplitude');
title('second b signal ')
subplot(223)
plot(c);
xlabel('time');
ylabel('amplitude');
title('addition of a and b signal ')
subplot(224)
plot(d);
JNU/ECE/SPL-01/EC507
17 Signal Processing Lab-I Created By Jitendra Jangid
xlabel('time');
ylabel('amplitude');
title('substraction of a and b signal ')
Addition and Subtraction of two discrete different signals
a=[0 1 1 1 2 1 ]
b=[1 0 1 1 1 2 ]
c=a+b;
d=a-b;
subplot(221)
stem(a);
xlabel('time');
ylabel('amplitude');
title('first a signal ')
subplot(222)
stem(b);
xlabel('time');
ylabel('amplitude');
title('second b signal ')
subplot(223)
stem(c);
JNU/ECE/SPL-01/EC507
18 Signal Processing Lab-I Created By Jitendra Jangid
xlabel('time');
ylabel('amplitude');
title('addition of a and b signal ')
subplot(224)
stem(d);
xlabel('time');
ylabel('amplitude');
title('substraction of a and b signal ')
Result :
JNU/ECE/SPL-01/EC507
19 Signal Processing Lab-I Created By Jitendra Jangid
EXPERIMENT: 6
Aim :To generate uniform random numbers between (0, 1).
Software used: Matlab 7.0
Theory:
r = rand(n) returns an n-by-n matrix containing pseudorandom values drawn from the standard
uniform distribution on the open interval (0,1). r = rand(m,n) or r = rand([m,n]) returns an m-by-
nmatrix. r = rand(m,n,p,...) or r = rand([m,n,p,...]) returns an m-by-n-by-p-by-... array. r =
rand returns a scalar. r = rand(size(A)) returns an array the same size as A.
r = rand(..., 'double') or r = rand(..., 'single') returns an array of uniform values of the specified
class.
r = rand(n)
r = rand(m,n)
r = rand([m,n])
r = rand(m,n,p,...)
r = rand([m,n,p,...])
r = rand
r = rand(size(A))
r = rand(..., 'double')
r = rand(..., 'single')
Random number generation in continuous and discrete manner
n=input('Enter the tota number which is generated N=');
y=rand(1,n)
subplot(211)
plot(y);
xlabel('random numbers');
ylabel('amplitude');
title('continuous plot of Random Number 0-1')
subplot(212)
stem(y)
xlabel('random numbers');
ylabel('amplitude');
title('discrete plot of Random Number 0-1')
JNU/ECE/SPL-01/EC507
20 Signal Processing Lab-I Created By Jitendra Jangid
Result:
JNU/ECE/SPL-01/EC507
21 Signal Processing Lab-I Created By Jitendra Jangid
EXPERIMENT: 7
Aim: To generate a random binary wave.
Software used: Matlab 7.0
Generation of binary wave for random signal continuous and discrete manner
n=input('Enter the tota 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
stem(j)
xlabel('no of random signal');
ylabel('amplitude');
title('plot of Random in ones and zeros 0-1')
JNU/ECE/SPL-01/EC507
22 Signal Processing Lab-I Created By Jitendra Jangid
Result:
JNU/ECE/SPL-01/EC507
23 Signal Processing Lab-I Created By Jitendra Jangid
EXPERIMENT 8
Aim : To generate random sequences with arbitrary distributions, means and variances for
following :
(a) Rayleigh distribution
(b) Normal distributions: N(0,1).
Software used: Matlab 7.0
Theory:
Definition The Rayleigh pdf is
The Rayleigh distribution 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 parameters 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 distributions, Rician distributions, 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.
Parameters
The raylfit function returns the MLE of the Rayleigh parameter. This estimate is
Rayleigh distribution
Coding
x = [0:0.01:2];
p= raylpdf(x,0.5);
subplot(211)
plot(x,p)
title('Continuous Rayleigh pdf')
JNU/ECE/SPL-01/EC507
24 Signal Processing Lab-I Created By Jitendra Jangid
subplot(212)
stem(x,p)
title('Discrete Rayleigh pdf')
Normal distributions: N(0,1).
In probability theory, the normal (or Gaussian) distribution is a continuous probability
distribution, defined on the entire real line, that has a bell-shaped probability density function,
known as the Gaussian function or informally as the bell curve:[nb 1]
The parameter μ is the mean or expectation (location of the peak) and σ 2
is the variance. σ is
known as the standard deviation. The distribution with μ = 0 and σ 2
= 1 is called the standard
normal distribution or the unit normal distribution. A normal distribution is often used as a first
approximation to describe real-valued random variables that cluster around a single mean value.
JNU/ECE/SPL-01/EC507
25 Signal Processing Lab-I Created By Jitendra Jangid
Coding :
x = -5:(1/100):5;
mu = 0;
sigma = 1;
k = 1/(sigma*sqrt(2*pi));
y = k*exp(-((x-mu).^2)/(2*sigma^2));
hold off
plot(x,y,'b.-')
hold on
mu = 0.5; sigma = 1.5;
k = 1/(sigma*sqrt(2*pi));
y = k*exp(-((x-mu).^2)/(2*sigma^2));
plot(x,y,'r.-')
mu = -.2; sigma = 0.5;
k = 1/(sigma*sqrt(2*pi));
y = k*exp(-((x-mu).^2)/(2*sigma^2));
plot(x,y,'k.-')
JNU/ECE/SPL-01/EC507
26 Signal Processing Lab-I Created By Jitendra Jangid
EXPERIMENT 9
Aim: To plot the probability density functions. Find mean and variance for the above
distributions
Software used: Matlab 7.0
Theory:
A probability density function is most commonly associated with absolutely
continuous univariate distributions. A random variable X has density f, where f is a non-
negative Lebesgue-integrable function, if:
Hence, if F is the cumulative distribution function of X, then:
and (if f is continuous at x)
Intuitively, one can think of f(x) dx as being the probability of X falling within the
infinitesimal interval [x, x + dx].
Coding : Random number distribution
data = [1 2 3 3 4]; %# Sample data
xRange = 0:10; %# Range of integers to compute a probability for
N = hist(data,xRange); %# Bin the data
plot(xRange,N./numel(data));%# Plot the probabilities for each integer
xlabel('Integer value');
ylabel('Probability');
JNU/ECE/SPL-01/EC507
27 Signal Processing Lab-I Created By Jitendra Jangid
data = [1 2 3 3 4]; %# Sample data
xRange = 0:10; %# Range of integers to compute a probability for
N = hist(data,xRange); %# Bin the data
stem(xRange,N./numel(data)); %# Plot the probabilities for each integer
xlabel('Integer value');
ylabel('Probability');
JNU/ECE/SPL-01/EC507
28 Signal Processing Lab-I Created By Jitendra Jangid
Normal distribution N( mu , sigma )
Code:
%% Explore the Normal distribution N( mu , sigma )
mu = 100; % the mean
sigma = 15; % the standard deviation
xmin = 70; % minimum x value for pdf and cdf plot
xmax = 130; % maximum x value for pdf and cdf plot
n = 100; % number of points on pdf
k = 10000; % number of random draws for histogram
% create a set of values ranging from xmin to xmax
x = linspace( xmin , xmax , n );
p = normpdf( x , mu , sigma ); % calculate the pdf
plot(x,p)
xlabel( 'x' ); ylabel( 'pdf' );
title( 'Probability Density Function' );
JNU/ECE/SPL-01/EC507
29 Signal Processing Lab-I Created By Jitendra Jangid
Code for 'Cumulative Density Function'
mu = 100; % the mean
sigma = 15; % the standard deviation
xmin = 70; % minimum x value for pdf and cdf plot
xmax = 130; % maximum x value for pdf and cdf plot
n = 100; % number of points on pdf
k = 10000; % number of random draws for histogram
% create a set of values ranging from xmin to xmax
x = linspace( xmin , xmax , n );
c = normcdf( x , mu , sigma ); % calculate the cdf
plot( x , c );
xlabel( 'x' ); ylabel( 'cdf' );
title( 'Cumulative Density Function' );

Más contenido relacionado

La actualidad más candente

Signal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier TransformsSignal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier Transforms
Arvind Devaraj
 
Signals and classification
Signals and classificationSignals and classification
Signals and classification
Suraj Mishra
 
Signals and systems( chapter 1)
Signals and systems( chapter 1)Signals and systems( chapter 1)
Signals and systems( chapter 1)
Fariza Zahari
 

La actualidad más candente (20)

Chapter3 - Fourier Series Representation of Periodic Signals
Chapter3 - Fourier Series Representation of Periodic SignalsChapter3 - Fourier Series Representation of Periodic Signals
Chapter3 - Fourier Series Representation of Periodic Signals
 
Lecture No:1 Signals & Systems
Lecture No:1 Signals & SystemsLecture No:1 Signals & Systems
Lecture No:1 Signals & Systems
 
Chapter1 - Signal and System
Chapter1 - Signal and SystemChapter1 - Signal and System
Chapter1 - Signal and System
 
Signal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier TransformsSignal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier Transforms
 
Ec8352 signals and systems 2 marks with answers
Ec8352 signals and systems   2 marks with answersEc8352 signals and systems   2 marks with answers
Ec8352 signals and systems 2 marks with answers
 
Dsp U Lec09 Iir Filter Design
Dsp U   Lec09 Iir Filter DesignDsp U   Lec09 Iir Filter Design
Dsp U Lec09 Iir Filter Design
 
Sampling
SamplingSampling
Sampling
 
Signal classification of signal
Signal classification of signalSignal classification of signal
Signal classification of signal
 
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
 
Analog to Digital Converters and Data Acquisition Systems
Analog to Digital Converters and Data Acquisition SystemsAnalog to Digital Converters and Data Acquisition Systems
Analog to Digital Converters and Data Acquisition Systems
 
Sampling theorem
Sampling theoremSampling theorem
Sampling theorem
 
digital signal processing lecture 1.pptx
digital signal processing lecture 1.pptxdigital signal processing lecture 1.pptx
digital signal processing lecture 1.pptx
 
Signals and classification
Signals and classificationSignals and classification
Signals and classification
 
Frequency Modulation and Demodulation
Frequency  Modulation and DemodulationFrequency  Modulation and Demodulation
Frequency Modulation and Demodulation
 
Decimation in time and frequency
Decimation in time and frequencyDecimation in time and frequency
Decimation in time and frequency
 
DSP_FOEHU - Lec 08 - The Discrete Fourier Transform
DSP_FOEHU - Lec 08 - The Discrete Fourier TransformDSP_FOEHU - Lec 08 - The Discrete Fourier Transform
DSP_FOEHU - Lec 08 - The Discrete Fourier Transform
 
Multirate digital signal processing
Multirate digital signal processingMultirate digital signal processing
Multirate digital signal processing
 
Signals and systems( chapter 1)
Signals and systems( chapter 1)Signals and systems( chapter 1)
Signals and systems( chapter 1)
 
Circular Convolution
Circular ConvolutionCircular Convolution
Circular Convolution
 
Pulse Modulation ppt
Pulse Modulation pptPulse Modulation ppt
Pulse Modulation ppt
 

Destacado

Dsp manual completed2
Dsp manual completed2Dsp manual completed2
Dsp manual completed2
bilawalali74
 
Digital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manualDigital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manual
Ramesh Sundar
 
Digital signal processing computer based approach - sanjit k. mitra (2nd ed)
Digital signal processing   computer based approach - sanjit k. mitra (2nd ed)Digital signal processing   computer based approach - sanjit k. mitra (2nd ed)
Digital signal processing computer based approach - sanjit k. mitra (2nd ed)
Surbhi Maheshwari
 
Ee343 signals and systems - lab 1 - loren schwappach
Ee343   signals and systems - lab 1 - loren schwappachEe343   signals and systems - lab 1 - loren schwappach
Ee343 signals and systems - lab 1 - loren schwappach
Loren Schwappach
 

Destacado (20)

Digital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE studentsDigital Signal Processing Lab Manual ECE students
Digital Signal Processing Lab Manual ECE students
 
digital signal-processing-lab-manual
digital signal-processing-lab-manualdigital signal-processing-lab-manual
digital signal-processing-lab-manual
 
Dsp manual completed2
Dsp manual completed2Dsp manual completed2
Dsp manual completed2
 
Digital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manualDigital signal processing (2nd ed) (mitra) solution manual
Digital signal processing (2nd ed) (mitra) solution manual
 
Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
 
MATLAB Programs For Beginners. | Abhi Sharma
MATLAB Programs For Beginners. | Abhi SharmaMATLAB Programs For Beginners. | Abhi Sharma
MATLAB Programs For Beginners. | Abhi Sharma
 
DIGITAL SIGNAL PROCESSING
DIGITAL SIGNAL PROCESSINGDIGITAL SIGNAL PROCESSING
DIGITAL SIGNAL PROCESSING
 
Digital signal processing computer based approach - sanjit k. mitra (2nd ed)
Digital signal processing   computer based approach - sanjit k. mitra (2nd ed)Digital signal processing   computer based approach - sanjit k. mitra (2nd ed)
Digital signal processing computer based approach - sanjit k. mitra (2nd ed)
 
Introduction to Digital Signal Processing
Introduction to Digital Signal ProcessingIntroduction to Digital Signal Processing
Introduction to Digital Signal Processing
 
Implementation of Digital Filters
Implementation of Digital FiltersImplementation of Digital Filters
Implementation of Digital Filters
 
Dsp ppt
Dsp pptDsp ppt
Dsp ppt
 
Design of IIR filters
Design of IIR filtersDesign of IIR filters
Design of IIR filters
 
Basics of Digital Filters
Basics of Digital FiltersBasics of Digital Filters
Basics of Digital Filters
 
Design of FIR filters
Design of FIR filtersDesign of FIR filters
Design of FIR filters
 
Ee343 signals and systems - lab 1 - loren schwappach
Ee343   signals and systems - lab 1 - loren schwappachEe343   signals and systems - lab 1 - loren schwappach
Ee343 signals and systems - lab 1 - loren schwappach
 
Digital Signal Processing and Control System under MATLAB Environment
Digital Signal Processing and Control System under MATLAB EnvironmentDigital Signal Processing and Control System under MATLAB Environment
Digital Signal Processing and Control System under MATLAB Environment
 
Ip ece303
Ip ece303Ip ece303
Ip ece303
 
Laboratory manual
Laboratory manualLaboratory manual
Laboratory manual
 
DFT and IDFT Matlab Code
DFT and IDFT Matlab CodeDFT and IDFT Matlab Code
DFT and IDFT Matlab Code
 
DSP Mat Lab
DSP Mat LabDSP Mat Lab
DSP Mat Lab
 

Similar a Signal Prosessing Lab Mannual

Basic simulation lab manual1
Basic simulation lab manual1Basic simulation lab manual1
Basic simulation lab manual1
Janardhana Raju M
 
Matlab 2
Matlab 2Matlab 2
Matlab 2
asguna
 

Similar a Signal Prosessing Lab Mannual (20)

PPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptx
PPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptxPPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptx
PPT Chapter-1-V1.pptx__26715_1_1539251776000.pptx.pptx
 
Basic concepts
Basic conceptsBasic concepts
Basic concepts
 
Basic simulation lab manual1
Basic simulation lab manual1Basic simulation lab manual1
Basic simulation lab manual1
 
Dsp Lab Record
Dsp Lab RecordDsp Lab Record
Dsp Lab Record
 
2. signal & systems beyonds
2. signal & systems  beyonds2. signal & systems  beyonds
2. signal & systems beyonds
 
Unit 1 -Introduction to signals and standard signals
Unit 1 -Introduction to signals  and standard signalsUnit 1 -Introduction to signals  and standard signals
Unit 1 -Introduction to signals and standard signals
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
signal and system Lecture 1
signal and system Lecture 1signal and system Lecture 1
signal and system Lecture 1
 
DSP_EXP.pptx
DSP_EXP.pptxDSP_EXP.pptx
DSP_EXP.pptx
 
3.Properties of signals
3.Properties of signals3.Properties of signals
3.Properties of signals
 
Dsp lab task1 ganesh
Dsp lab task1 ganeshDsp lab task1 ganesh
Dsp lab task1 ganesh
 
Signals and Systems.pptx
Signals and Systems.pptxSignals and Systems.pptx
Signals and Systems.pptx
 
Signals and Systems.pptx
Signals and Systems.pptxSignals and Systems.pptx
Signals and Systems.pptx
 
EC202 SIGNALS & SYSTEMS Module1 QUESTION BANK
EC202 SIGNALS & SYSTEMS  Module1 QUESTION BANKEC202 SIGNALS & SYSTEMS  Module1 QUESTION BANK
EC202 SIGNALS & SYSTEMS Module1 QUESTION BANK
 
Signal fundamentals
Signal fundamentalsSignal fundamentals
Signal fundamentals
 
Matlab 2
Matlab 2Matlab 2
Matlab 2
 
3. convolution fourier
3. convolution fourier3. convolution fourier
3. convolution fourier
 
Ss 2013 midterm
Ss 2013 midtermSs 2013 midterm
Ss 2013 midterm
 
Ss 2013 midterm
Ss 2013 midtermSs 2013 midterm
Ss 2013 midterm
 
Sys prop
Sys propSys prop
Sys prop
 

Último

Último (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

Signal Prosessing Lab Mannual

  • 1. JNU/ECE/SPL-01/EC507 1 Signal Processing Lab-I Created By Jitendra Jangid EXPERIMENT-01 Aim:- Generation of Continuous and Discrete Elementary signals (Periodic and Non- periodic) using mathematical expression. Software Requirement-Matlab 7.0 Theory- Continuous-Time and Discrete-Time Signals: A signal x(t) is a continuous-time signal if t is a continuous variable. If t is a discrete variable, that is, x(t) is defined at discrete times, then x(t) is a discrete-time signal. Periodic and Non periodic Signals: A continuous-time signal x(t) is to be periodic with period T if there is a positive nonzero value of T for which X(t+T)=x(t) all t Any continuous-time signal which is not periodic is called a non-periodic signal. Periodic discrete-time signal are defined analogously. A sequence x[n] is periodic with period N if there is a positive integer N for which X[n+N]=x[n] all n Coding:- Continuous periodic time signal time= input('Enter The time duration = ') t=0:0.1:time ; F=1; y=cos(2*F*t*pi); plot(t,y); %plot command to plot the graph% xlabel('TIME'); ylabel('amplitude y(t)=cos(2*F*t*pi)'); title('continuous periodic signal') %title of the signal y2=sin(2*F*t*pi); figure; plot(t,y2); %plot command to plot the graph% xlabel('TIME'); ylabel('amplitude y2(t)=sin(2*F*t*pi)'); title('continuous periodic signal'); %title of the signal
  • 2. JNU/ECE/SPL-01/EC507 2 Signal Processing Lab-I Created By Jitendra Jangid Discrete periodic time signal time= input('Enter The time duration = ') t=0:0.1:time ; F=1; y=cos(2*F*t*pi); stem(t,y); %plot command to plot the graph% xlabel('TIME'); ylabel('amplitude y(t)=cos(2*F*t*pi)'); title('discrete periodic signal') %title of the signal y2=sin(2*F*t*pi); figure; stem(t,y2); %plot command to plot the graph% xlabel('TIME'); ylabel('amplitude y2(t)=sin(2*F*t*pi)'); title('discrete periodic signal'); %title of the signal Non periodic continuous signal
  • 3. JNU/ECE/SPL-01/EC507 3 Signal Processing Lab-I Created By Jitendra Jangid t=0:2:50; y=cos(t/2).*cos(t*pi/4) plot(y) xlabel('time') ylabel('amplitude') title('aperiodical continous signal ') Non periodic Discrete signal t=0:2:50; y=cos(t/2).*cos(t*pi/4) stem(y) xlabel('time') ylabel('amplitude') title('aperiodical discrete signal ')
  • 4. JNU/ECE/SPL-01/EC507 4 Signal Processing Lab-I Created By Jitendra Jangid Result:- Various periodic and non-periodic signals has been studied.
  • 5. JNU/ECE/SPL-01/EC507 5 Signal Processing Lab-I Created By Jitendra Jangid EXPERIMENT-02 AIM: Generation of various continuous and discrete unit step signals. Software Requirement- Matlab 7.0 Theory- Continuous time unit step signals is also a basic continuous time signal and is denoted by u(t) this function is defined as. U(t)= 1 t>0 0 t<0 Discrete time unit step signal:- U(n) = 1 n>=0 0 n<0 Coding:- Continuous unit step signal t1=0:5:50 t2=-50:5:0 y1=ones(size(t1)) y2=zeros(size(t2)) t=[t2 t1] y=[y2 y1] plot(t,y) xlabel('t') title('cont. unit step')
  • 6. JNU/ECE/SPL-01/EC507 6 Signal Processing Lab-I Created By Jitendra Jangid Discrete Unit Step Signal:- n1=0:5:30 n2=-50:5:0 y1=ones(size(n1)) y2=zeros(size(n2)) n=[n2 n1] y=[y2 y1] stem(n,y) xlabel('n') title('discrete unit step') Result:-
  • 7. JNU/ECE/SPL-01/EC507 7 Signal Processing Lab-I Created By Jitendra Jangid EXPERIMENT NO:3 Aim: Generation of Exponential and Ramp signals in Continuous & Discrete domain. Software used: Matlab 7.0 Theory: Continuous-time complex exponential and sinusoidal signals: x(t) = C*eat where C and a are in general complex numbers. The case a > 0 represents exponential growth. Some signals in unstable systems exhibit exponential growth. The case a < 0 represents exponential decay. Some signals in stable systems exhibit exponential decay Ramp signal : The ramp function ( ) may be defined analytically in several ways and definitions are:
  • 8. JNU/ECE/SPL-01/EC507 8 Signal Processing Lab-I Created By Jitendra Jangid Continuous exponential signal n= input('Enter the value of N='); t=0:1:n; M=2; y1=M*exp(t*1); %multiplication factor m =1; y2=M*exp(t*2); %multiplication factor m =1; subplot(211) plot(t,y1) xlabel('time ') ylabel('ampitude'); title('Continuous exponential signal with m = 1 '); subplot(212) plot(t,y2) xlabel('time ') ylabel('ampitude'); title('Continuous exponential signal with m = 2');
  • 9. JNU/ECE/SPL-01/EC507 9 Signal Processing Lab-I Created By Jitendra Jangid Discrete exponent signal: n= input('Enter the value of N='); t=0:1:n; M=2; y1=M*exp(t*1); %multiplication factor m =1; y2=M*exp(t*2); %multiplication factor m =1; subplot(211) stem(t,y1) xlabel('time ') ylabel('ampitude'); title('discrete exponential signal with m = 1 '); subplot(212) stem(t,y2) xlabel('time ') ylabel('ampitude'); title('discrete exponential signal with m = 2');
  • 10. JNU/ECE/SPL-01/EC507 10 Signal Processing Lab-I Created By Jitendra Jangid Continuous ramp signal n= input('Enter the value of N='); t=0:1:n; y1=t; %multiplication factor m =1; y2=t*2; %multiplication factor m =1; subplot(211) plot(t,y1) xlabel('time ') ylabel('ampitude'); title('continuous ramp signal with m = 1 '); subplot(212) plot(t,y2) xlabel('time ') ylabel('ampitude'); title('continuous ramp signal with m = 2');
  • 11. JNU/ECE/SPL-01/EC507 11 Signal Processing Lab-I Created By Jitendra Jangid Discrete ramp signal n= input('Enter the value of N='); t=0:1:n; y1=t; %multiplication factor m =1; y2=t*2; %multiplication factor m =1; subplot(211) stem(t,y1) xlabel('time ') ylabel('ampitude'); title('discrete ramp signal with m = 1 '); subplot(212) stem(t,y2) xlabel('time ') ylabel('ampitude'); title('discrete ramp signal with m = 2'); Result:
  • 12. JNU/ECE/SPL-01/EC507 12 Signal Processing Lab-I Created By Jitendra Jangid EXPERIMENT NO:4 Aim: To generate continuous and discrete convolution time signal Software used: Matlab 7.0 Theory: Convolution theorem for continuous system:If the impulse response of an analog or continuous time system be h(t), it means that for an input δ(t) its output is h(t). Hence for all linear system its output for a shifted impulse δ(t-T) is h(t-T). The following are the mathematical representation of these operations: δ(t) h(t) δ(t-T)  h(t-T) x(t) δ(t-T)  x(T) h(t-T) ∫ x(T) δ(t-T) dT  ∫ x(T) h(t-T) dT From the last two statements, we can say that an input x(T) δ(t-T) the output is x(T) h(t-T) and for an input of continuous summation or integration of x(T) δ(t-T), the output is also continuous summation of x(T) h(t-T). Therefore, we can write by the linearity of the system y(t)= ∫ x(T) h(t-T) dT The right hand side of the above equation is defined as convolution of x(t) with h(t) and now we can write it as follow: y(t)= convolution of x(t) and h(t) = x(t) * h(t) = ∫ x(T) h(t-T) dT The symbol ‘*’ stands for convolution. Convolution for discrete time function: If x(n) is applied as an input to a discret time system, the response y(n) of the system is given by y(n)= T[x(n)]=t[∑ x(k) δ(n-k)] to study LTI systems linear convolution plays an important role.
  • 13. JNU/ECE/SPL-01/EC507 13 Signal Processing Lab-I Created By Jitendra Jangid Continuous convolution time system: t1=[-10:1:0]; t2=[0:1:2]; t3=[2:1:10]; x=zeros(size(t1)); y=ones(size(t2)); z=zeros(size(t3)); t=[t1,t2,t3]; a=[x,y,z]; subplot(2,2 ,1); plot(t,a,'m'); xlabel('time-->'); ylabel('u(t)-u(t-2)'); u1=[-11:1:0]; u2=[0:1:3]; u3=[3:1:11]; v1=zeros(size(u1)); v2=ones(size(u2)); v3=zeros(size(u3)); u=[u1,u2,u3]; b=[v1,v2,v3]; subplot(2,2,2); plot(u,b,'m') xlabel('time-->'); ylabel('u(t)-u(t-3)'); c=conv(y,v2); subplot(2,2,3); plot(c); xlabel('time-->'); ylabel('(u(t)-u(t-2))*(u(t)-u(t-3))');
  • 14. JNU/ECE/SPL-01/EC507 14 Signal Processing Lab-I Created By Jitendra Jangid -10 -5 0 5 10 0 0.2 0.4 0.6 0.8 1 time--> u(t)-u(t-2) -15 -10 -5 0 5 10 15 0 0.2 0.4 0.6 0.8 1 time--> u(t)-u(t-3) 1 2 3 4 5 6 1 1.5 2 2.5 3 time--> (u(t)-u(t-2))*(u(t)-u(t-3)) Result:
  • 15. JNU/ECE/SPL-01/EC507 15 Signal Processing Lab-I Created By Jitendra Jangid EXPIREMENT: 5 Aim: Adding and subtracting two given signals. (Continuous as well as Discrete signals) Software used: Matlab 7.0 Theory: Addition of two ram signal in continuous and discrete n manner Code: n= input('Enter the value of N='); t=0:1:n; y1=t; %multiplication factor m =1; y2=t*2; %multiplication factor m =2; y3=y1+y2; subplot(221) plot(t,y1); xlabel('time ') ylabel('ampitude'); title('continuous ramp signal with m = 1 '); subplot(222) plot(t,y2) xlabel('time ') ylabel('ampitude'); title('continuous ramp signal with m =2'); subplot(223); plot(t,y3); xlabel('time ') ylabel('ampitude'); title('addition of two continuous ramp signal with m = 1 and m =2'); subplot(224) stem(t,y3) xlabel('time ') ylabel('ampitude'); title('addition of ramp signal in DISCRETE in time');
  • 16. JNU/ECE/SPL-01/EC507 16 Signal Processing Lab-I Created By Jitendra Jangid Addition and Subtraction of two discrete different signals a=[0 1 1 1 2 1 ] b=[1 0 1 1 1 2 ] c=a+b; d=a-b; subplot(221) plot(a); xlabel('time'); ylabel('amplitude'); title('first a signal ') subplot(222) plot(b); xlabel('time'); ylabel('amplitude'); title('second b signal ') subplot(223) plot(c); xlabel('time'); ylabel('amplitude'); title('addition of a and b signal ') subplot(224) plot(d);
  • 17. JNU/ECE/SPL-01/EC507 17 Signal Processing Lab-I Created By Jitendra Jangid xlabel('time'); ylabel('amplitude'); title('substraction of a and b signal ') Addition and Subtraction of two discrete different signals a=[0 1 1 1 2 1 ] b=[1 0 1 1 1 2 ] c=a+b; d=a-b; subplot(221) stem(a); xlabel('time'); ylabel('amplitude'); title('first a signal ') subplot(222) stem(b); xlabel('time'); ylabel('amplitude'); title('second b signal ') subplot(223) stem(c);
  • 18. JNU/ECE/SPL-01/EC507 18 Signal Processing Lab-I Created By Jitendra Jangid xlabel('time'); ylabel('amplitude'); title('addition of a and b signal ') subplot(224) stem(d); xlabel('time'); ylabel('amplitude'); title('substraction of a and b signal ') Result :
  • 19. JNU/ECE/SPL-01/EC507 19 Signal Processing Lab-I Created By Jitendra Jangid EXPERIMENT: 6 Aim :To generate uniform random numbers between (0, 1). Software used: Matlab 7.0 Theory: r = rand(n) returns an n-by-n matrix containing pseudorandom values drawn from the standard uniform distribution on the open interval (0,1). r = rand(m,n) or r = rand([m,n]) returns an m-by- nmatrix. r = rand(m,n,p,...) or r = rand([m,n,p,...]) returns an m-by-n-by-p-by-... array. r = rand returns a scalar. r = rand(size(A)) returns an array the same size as A. r = rand(..., 'double') or r = rand(..., 'single') returns an array of uniform values of the specified class. r = rand(n) r = rand(m,n) r = rand([m,n]) r = rand(m,n,p,...) r = rand([m,n,p,...]) r = rand r = rand(size(A)) r = rand(..., 'double') r = rand(..., 'single') Random number generation in continuous and discrete manner n=input('Enter the tota number which is generated N='); y=rand(1,n) subplot(211) plot(y); xlabel('random numbers'); ylabel('amplitude'); title('continuous plot of Random Number 0-1') subplot(212) stem(y) xlabel('random numbers'); ylabel('amplitude'); title('discrete plot of Random Number 0-1')
  • 20. JNU/ECE/SPL-01/EC507 20 Signal Processing Lab-I Created By Jitendra Jangid Result:
  • 21. JNU/ECE/SPL-01/EC507 21 Signal Processing Lab-I Created By Jitendra Jangid EXPERIMENT: 7 Aim: To generate a random binary wave. Software used: Matlab 7.0 Generation of binary wave for random signal continuous and discrete manner n=input('Enter the tota 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 stem(j) xlabel('no of random signal'); ylabel('amplitude'); title('plot of Random in ones and zeros 0-1')
  • 22. JNU/ECE/SPL-01/EC507 22 Signal Processing Lab-I Created By Jitendra Jangid Result:
  • 23. JNU/ECE/SPL-01/EC507 23 Signal Processing Lab-I Created By Jitendra Jangid EXPERIMENT 8 Aim : To generate random sequences with arbitrary distributions, means and variances for following : (a) Rayleigh distribution (b) Normal distributions: N(0,1). Software used: Matlab 7.0 Theory: Definition The Rayleigh pdf is The Rayleigh distribution 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 parameters 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 distributions, Rician distributions, 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. Parameters The raylfit function returns the MLE of the Rayleigh parameter. This estimate is Rayleigh distribution Coding x = [0:0.01:2]; p= raylpdf(x,0.5); subplot(211) plot(x,p) title('Continuous Rayleigh pdf')
  • 24. JNU/ECE/SPL-01/EC507 24 Signal Processing Lab-I Created By Jitendra Jangid subplot(212) stem(x,p) title('Discrete Rayleigh pdf') Normal distributions: N(0,1). In probability theory, the normal (or Gaussian) distribution is a continuous probability distribution, defined on the entire real line, that has a bell-shaped probability density function, known as the Gaussian function or informally as the bell curve:[nb 1] The parameter μ is the mean or expectation (location of the peak) and σ 2 is the variance. σ is known as the standard deviation. The distribution with μ = 0 and σ 2 = 1 is called the standard normal distribution or the unit normal distribution. A normal distribution is often used as a first approximation to describe real-valued random variables that cluster around a single mean value.
  • 25. JNU/ECE/SPL-01/EC507 25 Signal Processing Lab-I Created By Jitendra Jangid Coding : x = -5:(1/100):5; mu = 0; sigma = 1; k = 1/(sigma*sqrt(2*pi)); y = k*exp(-((x-mu).^2)/(2*sigma^2)); hold off plot(x,y,'b.-') hold on mu = 0.5; sigma = 1.5; k = 1/(sigma*sqrt(2*pi)); y = k*exp(-((x-mu).^2)/(2*sigma^2)); plot(x,y,'r.-') mu = -.2; sigma = 0.5; k = 1/(sigma*sqrt(2*pi)); y = k*exp(-((x-mu).^2)/(2*sigma^2)); plot(x,y,'k.-')
  • 26. JNU/ECE/SPL-01/EC507 26 Signal Processing Lab-I Created By Jitendra Jangid EXPERIMENT 9 Aim: To plot the probability density functions. Find mean and variance for the above distributions Software used: Matlab 7.0 Theory: A probability density function is most commonly associated with absolutely continuous univariate distributions. A random variable X has density f, where f is a non- negative Lebesgue-integrable function, if: Hence, if F is the cumulative distribution function of X, then: and (if f is continuous at x) Intuitively, one can think of f(x) dx as being the probability of X falling within the infinitesimal interval [x, x + dx]. Coding : Random number distribution data = [1 2 3 3 4]; %# Sample data xRange = 0:10; %# Range of integers to compute a probability for N = hist(data,xRange); %# Bin the data plot(xRange,N./numel(data));%# Plot the probabilities for each integer xlabel('Integer value'); ylabel('Probability');
  • 27. JNU/ECE/SPL-01/EC507 27 Signal Processing Lab-I Created By Jitendra Jangid data = [1 2 3 3 4]; %# Sample data xRange = 0:10; %# Range of integers to compute a probability for N = hist(data,xRange); %# Bin the data stem(xRange,N./numel(data)); %# Plot the probabilities for each integer xlabel('Integer value'); ylabel('Probability');
  • 28. JNU/ECE/SPL-01/EC507 28 Signal Processing Lab-I Created By Jitendra Jangid Normal distribution N( mu , sigma ) Code: %% Explore the Normal distribution N( mu , sigma ) mu = 100; % the mean sigma = 15; % the standard deviation xmin = 70; % minimum x value for pdf and cdf plot xmax = 130; % maximum x value for pdf and cdf plot n = 100; % number of points on pdf k = 10000; % number of random draws for histogram % create a set of values ranging from xmin to xmax x = linspace( xmin , xmax , n ); p = normpdf( x , mu , sigma ); % calculate the pdf plot(x,p) xlabel( 'x' ); ylabel( 'pdf' ); title( 'Probability Density Function' );
  • 29. JNU/ECE/SPL-01/EC507 29 Signal Processing Lab-I Created By Jitendra Jangid Code for 'Cumulative Density Function' mu = 100; % the mean sigma = 15; % the standard deviation xmin = 70; % minimum x value for pdf and cdf plot xmax = 130; % maximum x value for pdf and cdf plot n = 100; % number of points on pdf k = 10000; % number of random draws for histogram % create a set of values ranging from xmin to xmax x = linspace( xmin , xmax , n ); c = normcdf( x , mu , sigma ); % calculate the cdf plot( x , c ); xlabel( 'x' ); ylabel( 'cdf' ); title( 'Cumulative Density Function' );