Escolar Documentos
Profissional Documentos
Cultura Documentos
S. No.
Experiment
Date
Signature
EXPERIMENT- 1
EXPERIMENT- 2
Aim- To generate pseudo random noise signal using Matlab.
Software used- MATLAB
TheoryIn cryptography, pseudo random noise (PRN) is a signal similar to noise which satisfies one or
more of the standard tests for statistical randomness.
Although it seems to lack any definite pattern, pseudo random noise consists of a deterministic
sequence of pulses that will repeat itself after its period.
In cryptographic devices, the pseudo random noise pattern is determined by a key and the
repetition period can be very long, even millions of digits.
Pseudo random noise is used in some electronic musical instruments, either by itself or as an
input to subtractive synthesis, and in many white noise machines.
In spread-spectrum systems, the receiver correlates a locally generated signal with the received
signal. Such spread-spectrum systems require a set of one or more "codes" or "sequences" such
that
Like random noise, the local sequence has a very low correlation with any other sequence
in the set, or with the same sequence at a significantly different time offset, or with
narrow band interference, or with thermal noise.
Unlike random noise, it must be easy to generate exactly the same sequence at both the
transmitter and the receiver, so the receiver's locally generated sequence has a very high
correlation with the transmitted sequence.
Programclc;
clear all;
close all;
N=200; % Define Number of samples
R1=2*(round(rand(1,N))-0.5); % Generate Normal Random Numbers
plot(R1); % Plot of R1
title('Random Signal');
xlabel('Sample Number ---------->');
ylabel('Amplitude ---------->');
axis([0 N -1.5 1.5]);
OutputRandom Signal
1.5
Amplitude ---------->
0.5
-0.5
-1
-1.5
20
40
60
80
100
120
140
Sample Number ---------->
160
180
200
EXPERIMENT- 3
Aim- To find probability density function of a random variable.
Software used- MATLAB
TheoryIn probability theory, a probability density function (pdf), or density of a continuous random
variable, is a function that describes the relative likelihood for this random variable to take on a
given value. The probability of the random variable falling within a particular range of values is
given by the integral of this variables density over that rangethat 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 function" and "probability function" have also sometimes
been used to denote the probability density function. However, this use is not standard among
probabilists 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 rather than
the density. Further confusion of terminology exists because density function has also been used
for what is here called the "probability mass function".
Programclc;
close all;
clear all;
u=1;
sigma=3;
x = -10:0.1:10;
p = exp(-(x-u).*(x-u)/(2*sigma^2))/(sqrt(2*pi)*sigma);
plot(p);
title('PDF Curve');
xlabel('X
---------->');
ylabel('P(x)
---------->');
OutputPDF Curve
0.14
0.12
P(x)
---------->
0.1
0.08
0.06
0.04
0.02
0
50
100
150
X ---------->
200
250
EXPERIMENT- 4
Aim- To find fast fourier transform of a given sequence.
Software used- MATLAB
TheoryA fast Fourier transform (FFT) is an algorithm to compute the discrete Fourier transform (DFT)
and its inverse. A Fourier transform converts time (or space) to frequency and vice versa; an FFT
rapidly computes such transformations. As a result, fast Fourier transforms are widely used for
many applications in engineering, science, and mathematics. The basic ideas were popularized in
1965, but some FFTs had been previously known as early as 1805. Fast Fourier transforms have
been described as "the most important numerical algorithm[s] of our lifetime".[1]
There are many different FFT algorithms involving a wide range of mathematics, from simple
complex-number arithmetic to group theory and number theory; this article gives an overview of
the available techniques and some of their general properties, while the specific algorithms are
described in subsidiary articles linked below.
The DFT is obtained by decomposing a sequence of values into components of different
frequencies. This operation is useful in many fields (see discrete Fourier transform for properties
and applications of the transform) but computing it directly from the definition is often too slow
to be practical. An FFT is a way to compute the same result more quickly: computing the DFT of
N points in the naive way, using the definition, takes O(N2) arithmetical operations, while a FFT
can compute the same DFT in only O(N log N) operations. The difference in speed can be
enormous, especially for long data sets where N may be in the thousands or millions. In practice,
the computation time can be reduced by several orders of magnitude in such cases, and the
improvement is roughly proportional to N / log(N). This huge improvement made the calculation
of the DFT practical; FFTs are of great importance to a wide variety of applications, from digital
signal processing and solving partial differential equations to algorithms for quick multiplication
of large integers.
Programclc;
clear all;
close all;
x = [1 3 8 4 5 6 7]
N = length(x);
for k = 1:N
y(k) = 0;
for n = 1:N
y(k) = y(k)+x(n)*exp(-1i*2*pi*(k-1)*(n-1)/N)
end
end
subplot(2,1,1);
stem(x);
ylabel('Amplitude ---->');
xlabel('n ---->');
title('Input Sequence');
subplot(2,1,2);
stem(y);
ylabel('Amplitude ---->');
xlabel('K ---->');
title('FFT Sequence');
OutputInput Sequence
Amplitude ---->
8
6
4
2
0
4
n ---->
FFT Sequence
4
K ---->
Amplitude ---->
-5
EXPERIMENT- 5
Aim- To find inverse fast fourier transform of a given sequence.
Software used- MATLAB
TheoryA fast Fourier transform (FFT) is an algorithm to compute the discrete Fourier transform (DFT)
and its inverse. A Fourier transform converts time (or space) to frequency and vice versa; an FFT
rapidly computes such transformations. As a result, fast Fourier transforms are widely used for
many applications in engineering, science, and mathematics. The basic ideas were popularized in
1965, but some FFTs had been previously known as early as 1805. Fast Fourier transforms have
been described as "the most important numerical algorithm[s] of our lifetime".[1]
There are many different FFT algorithms involving a wide range of mathematics, from simple
complex-number arithmetic to group theory and number theory; this article gives an overview of
the available techniques and some of their general properties, while the specific algorithms are
described in subsidiary articles linked below.
The DFT is obtained by decomposing a sequence of values into components of different
frequencies. This operation is useful in many fields (see discrete Fourier transform for properties
and applications of the transform) but computing it directly from the definition is often too slow
to be practical. An FFT is a way to compute the same result more quickly: computing the DFT of
N points in the naive way, using the definition, takes O(N2) arithmetical operations, while a FFT
can compute the same DFT in only O(N log N) operations. The difference in speed can be
enormous, especially for long data sets where N may be in the thousands or millions. In practice,
the computation time can be reduced by several orders of magnitude in such cases, and the
improvement is roughly proportional to N / log(N). This huge improvement made the calculation
of the DFT practical; FFTs are of great importance to a wide variety of applications, from digital
signal processing and solving partial differential equations to algorithms for quick multiplication
of large integers.
Programclc;
clear all;
close all;
x = [1 2 5 4 3 2 4]
N = length(x);
for n = 1:N
y(n) = 0;
for k = 1:N
y(n) = y(n)+(1/N)*x(k)*exp(1i*2*pi*(k-1)*(n-1)/N);
end
end
subplot(2,1,1);
stem(x);
ylabel('Amplitude ---->');
xlabel('K ---->');
title('Input Sequence');
subplot(2,1,2);
stem(y);
ylabel('Amplitude ---->');
xlabel('n ---->');
title('IFFT Sequence');
OutputInput Sequence
Amplitude ---->
6
4
2
0
4
K ---->
IFFT Sequence
4
n ---->
Amplitude ---->
1
0.5
0
-0.5
-1
EXPERIMENT- 6
Aim- To perform auto- correlation of a given sequence.
Software used- MATLAB
TheoryAutocorrelation is the cross-correlation of a signal with itself. Informally, it is the similarity
between observations as a function of the time lag between them. It is a mathematical tool for
finding repeating patterns, such as the presence of a periodic signal obscured by noise, or
identifying the missing fundamental frequency in a signal implied by its harmonic frequencies. It
is often used in signal processing for analyzing functions or series of values, such as time domain
signals.
In signal processing, autocorrelation can give information about repeating events like
musical beats (for example, to determine tempo) or pulsar frequencies, though it
cannot tell the position in time of the beat. It can also be used to estimate the pitch of
a musical tone.
Autocorrelation in space rather than time, via the Patterson function, is used by X-ray
diffractionists to help recover the "Fourier phase information" on atom positions not
available through diffraction alone.
Programclc;
clear all;
x = [1 5 6 3 2 7 3];
N = length(x);
a = x;
y = x;
z = x;
for i = 1:N-1
for i = N-1:-1:1
x(i+1) = x(i);
end
x(1) = 0;
z = [x;z;x];
end
k = z*y';
m = k';
subplot(2,1,1);
stem(a);
title('Input Sequence');
ylabel('Amplitude---->');
xlabel('n---->');
subplot(2,1,2);
stem(m);
title('Autocorrelation Sequence');
ylabel('Amplitude---->');
xlabel('n---->');
OutputInput Sequence
Amplitude---->
8
6
4
2
0
4
5
n---->
Autocorrelation Sequence
Amplitude---->
150
100
50
0
n---->
10
12
14
EXPERIMENT- 7
Aim- To perform Cross- correlation of two given sequences.
Software used- MATLAB
TheoryIn signal processing, cross-correlation is a measure of similarity of two waveforms as a function
of a time-lag applied to one of them. This is also known as a sliding dot product or sliding innerproduct. It is commonly used for searching a long signal for a shorter, known feature. It has
applications in pattern recognition, single particle analysis, electron tomographic averaging,
cryptanalysis, and neurophysiology.
The cross-correlation is similar in nature to the convolution of two functions. In an
autocorrelation, which is the cross-correlation of a signal with itself, there will always be a peak
at a lag of zero unless the signal is a trivial zero signal. In probability theory and statistics,
correlation is always used to include a standardising factor in such a way that correlations have
values between 1 and +1, and the term cross-correlation is used for referring to the correlation
corr(X, Y) between two random variables X and Y, while the "correlation" of a random vector X
is considered to be the correlation matrix (matrix of correlations) between the scalar elements of
X.
Programclc;
clear all;
x = [1 5 6 3 2 7 3];
N = length(x);
y = [2 5 7 3 2 1 4];
a = x;
z = x;
for i = 1:N-1
for i = N-1:-1:1
x(i+1) = x(i);
end
x(1) = 0;
z = [x;z;x];
end
k = z*y';
m = k'
subplot(2,1,1);
stem(a);
title('Input Sequence');
ylabel('Amplitude---->');
xlabel('n---->');
subplot(2,1,2);
stem(m);
title('Cross-correlation Sequence');
ylabel('Amplitude---->');
xlabel('n---->');
OutputInput Sequence
Amplitude---->
8
6
4
2
0
4
5
n---->
Cross-correlation Sequence
Amplitude---->
150
100
50
0
n---->
10
12
14