DEPARTMENT OF ECE
CEC 332 – ADVANCED DIGITAL SIGNAL PROCESSING
LABORATORY MANUAL
NAME :
REGISTER NUMBER :
DEGREE : B.E
REGULATION : 2021
YEAR & SEMESTER : III & V
ACADEMIC YEAR : 2024-2025
BATCH : 2022-2026
TABLE OF CONTENTS
[Link] DATE NAME OF CONTENTS MARKS SIGNATURE
1 STUDY OF
AUTOCORRELATION
AND CROSS
CORRELATION OF
RANDOM SIGNALS
2 DESIGN AND
IMPLEMENTATION OF
MULTIRATE SYSTEM
3 DESIGN AND
IMPLEMENTATION OF
WIENER FILTER
4 DESIGN AND
IMPLEMENTATION OF
FIR LINEAR PREDICTOR
5 DESIGN OF ADAPTIVE
FILTERS USING LMS
ALGORITHM
6 SPECTRUM ESTIMATION
USING BARLETT AND
WELCH METHOD
STUDY OF AUTOCORRELATION AND CROSS CORRELATION OF
RANDOM SIGNAL
EX NO:
DATE:
AIM
To study the autocorrelation and cross correlation of random signals and
implement it using MATLAB.
APPARATUS REQUIRED
HARDWARE - PERSONAL COMPUTER
SOFTWARE - MATLAB
STUDY
AUTO CORRELATION
Autocorrelation, also known as serial correlation, is the correlation of a signal with a
delayed copy of itself as a function of delay. It measures the similarity between
observations of a random variable at different times. This is particularly useful in
identifying repeating patterns or periodic signals obscured by noise.
For a random process (X(t)), the autocorrelation function ( RX(t1, t2) ) is defined as:
RX(t1,t2)=E[X(t1)X(t2)]
where ( E ) denotes the expected value. This function measures the correlation
between the values of the process at two different times ( t1 ) and ( t2 ).
Properties of Autocorrelation
1. Symmetry: ( RX(t) = RX(-t) )
2. Maximum at Zero Lag: ( RX(0) ) is the maximum value of the
autocorrelation function.
3. Periodicity: For periodic signals, the autocorrelation function is also periodic
with the same period.
Applications
1. Signal Processing: Used to identify repeating patterns or periodic signals
obscured by noise.
2. Econometrics: Helps in identifying trends and cycles in time series data.
3. Communications: Used in the design of filters and in the analysis of signals.
Example: White Noise
For a white noise signal, the autocorrelation function is a delta function:
RX(τ)=σ2δ(τ)
where ( σ^2 ) is the variance of the white noise, and (δ(τ)) is the Dirac delta function.
Practical Computation
In practice, the autocorrelation function is often estimated using sample data.
CROSS CORRELATION
Cross-correlation is a measure of similarity between two signals as a function of the
time-lag applied to one of them. It is widely used in signal processing, time series
analysis, and many other fields to identify the relationship between two signals.
For two random processes (X(t)) and (Y(t)), the cross-correlation function
( Rxy(t) ) is defined as:
Rxy(τ)=E[X(t)Y(t+τ)]
where (E[xy]) denotes the expected value, and (t) is the time lag.
Properties of Cross-Correlation
1. Symmetry: ( Rxy(t) = Ryx(t) )
2. Maximum Value: The maximum value of the cross-correlation function
indicates the time lag at which the signals are most similar.
3. Linearity: Cross-correlation is a linear operation.
Applications
1. Signal Processing: Used to detect known patterns within a signal.
2. Time Series Analysis: Helps in identifying the time delay between two related
time series.
3. Image Processing: Used for template matching and feature detection.
OUTPUT
PROGRAM FOR AUTOCORRELATION:
clc;
close all;
clear all;
x=input('Enter the sequence 1: ');
y=xcorr(x,x);
figure;
subplot(2,1,1);
stem(x);
ylabel('Amplitude->');
xlabel('n->');
title('Input sequence');
subplot(2,1,2);
stem(fliplr(y));
ylabel('amplitude');
xlabel('n->');
title('Output
sequence');
disp('the resultant is ');
disp(y);
OUTPUT
PROGRAM FOR CROSSCORRELATION
clc;
clear all;
close all;
x=input('Enter the sequence 1: ');
h=input('Enter the sequence 2: ');
y=xcorr(x,h);
figure;
subplot(3,1,1);
stem(x);
xlabel('n->');
ylabel('Amplitude->');
title('Input sequence 1');
subplot(3,1,2);
stem(fliplr(y));
stem(h);
xlabel('n->');
ylabel('Amplitude->');
title('Input sequence 2');
subplot(3,1,3);
stem(fliplr(y));
xlabel('n->');
ylabel('Amplitude->');
title('Output sequence');
disp('The resultant is');
fliplr(y);
RESULT
Thus autocorrelation and cross correlation of random signals was studied and
implemented using MATLAB successfully.