Tuesday, 5 January 2016

Matlab program for Auto Correlation?



 To write a program for Auto Correlation for the given sequence using MATLAB
Step 1: Start
Step 2: Read the input sequence
Step 3: Perform auto correlation using the xcorr() function
Step 4: Plot the sequences
Step 5: Display the input & output sequences
Step 6: Stop
SOURCE CODE:

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 ');
fliplr(y);

 FOR MORE DETAILS CLICK HERE