0% found this document useful (0 votes)
43 views2 pages

1 (B) (Correlation)

This MATLAB program takes two input sequences, computes the cross correlation between the sequences and the auto correlation of each individual sequence. It then displays the input sequences, cross correlated sequence, and auto correlated sequence in graphical and numerical formats.

Uploaded by

Michael Mcintosh
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)
43 views2 pages

1 (B) (Correlation)

This MATLAB program takes two input sequences, computes the cross correlation between the sequences and the auto correlation of each individual sequence. It then displays the input sequences, cross correlated sequence, and auto correlated sequence in graphical and numerical formats.

Uploaded by

Michael Mcintosh
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/ 2

%***** PROGRAM FOR COMPUTING CORRELATION OF THE SEQUENCES *****%

% CLEAR MEMORY AND CONSOLE


clc;
clear all;
close all;

% ENTERING THE INPUT SEQUENCES


x1=input('ENTER THE FIRST SEQUENCE :');
x2=input('ENTER THE SECOND SEQUENCE:');

% COMPUTE THE CROSS CORRELATION AND AUTO CORRELATION


cc=xcorr(x1,x2); % CROSS CORRELATION
ac=xcorr(x1); % AUTO CORRELATION

%DISPLAY THE GRAPHICAL INPUT AND OUTPUT SEQUENCES


figure();
subplot(221);stem(x1);
xlabel('time');ylabel('amplitude');title('FIRST SEQUENCE');
subplot(222);stem(x2);
xlabel('time');ylabel('amplitude');title('SECOND SEQUENCE');
subplot(223);stem(cc);
xlabel('time');ylabel('amplitude');title('CROSS CORRELATED SEQUENCE');
subplot(224);stem(ac);
xlabel('time');ylabel('amplitude');title('AUTO CORRELATED SEQUENCE');

% DISPLAY NUMERICAL INPUT AND OUTPUT SEQUENCES


disp('CROSS CORRELATED SEQUENCE VALUES= ');disp(round(cc))
disp('AUTO CORRELATED SEQUENCE VALUES= ');disp(round(ac))
OUTPUT

You might also like