Saturday, January 25, 2014

Matlab Program for Cross Correlation

with 0 Comment
Matlab Program for Cross Correlation:
                                       
clc
clear all
close all
n=0:3;
x=[1 2 3 4];
subplot(2,2,1);
stem(n,x);
grid on
title('x(n)sequence');
xlabel('n');
ylabel('Amplitude');

y=[1 2 1 2];
subplot(2,2,2);
stem(n,y);
grid on
title('h(n)sequence');
xlabel('n');
ylabel('Amplitude');

t=-3:3;
rxy=xcorr(x,y);
subplot(2,2,3);
stem(t,rxy);
grid on
title('rxy(l)');
xlabel('n');
ylabel('Amplitude');

OUTPUT:





0 comments:

Post a Comment

Powered by Blogger.

Blog Archive