06-05-2011, 03:35 PM
Procedure:-
1. Read the input sequence
2. Cross correlate the signal
3. Display the cross correlate result in suitable axis
4. Verify the correlation property:Rxx(0)=energy(x)
5. Verify the property :Rxx is a even function
MATLAB program for crosscorrelation
Code:
clear
clc
close all
% READ THE INPUT SEUENCES
x = [1 2 1 1]
y = [1 1 2 1]
%DEFINE THE AXIS
n1 = -2:1:1;
n2 = -2:1:1;
% PLOT THE SIGNAL
subplot(3,1,1);
stem(n1,x);
title('sequence-x');
grid on;
subplot(3,1,2);
stem(n2,y);
title('sequence-y');
grid on;
% CROSSCORRELATE THE SEQUENCES
r = conv(x, fliplr(y))
nr = -3:1:3;
subplot(3,1,3);
stem(nr,r);
title('Crosscorrelation sequence');
grid on;
RESULT:-
CROSSCORRELATION OF TWO SEQUENCES