Pages

Friday 22 February 2013

Autocorrelation Sequence Using Function (Matlab 2012a)

Program:

clc;
clear all;
x = input('Enter the sequence = ');
y = xcorr(x,x);
subplot(2,1,1);
stem(x);
title('Input Sequence');
ylabel('Amplitude---->');
xlabel('n---->');
grid on;
subplot(2,1,2);
stem(y);
title('Autocorrelation Sequence');
ylabel('Amplitude---->');
xlabel('n---->');
grid on;
disp('Auto Correlation Sequence = ');
disp(y);


Output:

Enter the sequence = [1 2 3 4]
Auto Correlation Sequence =
    4.0000   11.0000   20.0000   30.0000   20.0000   11.0000    4.0000


Waveform:

 

No comments:

Post a Comment