Azhar Sayyed Ss
Azhar Sayyed Ss
Azhar Sayyed Ss
EXAMPLE 1:
>>x=[ 1 2 -3 -2 4];
>> r=conv(x,fliplr(y))
r=
3 5 -10 2 15 -19 4 16 -8
>> n=0:8;
>> stem(n,r)
>> ylabel('Amplitude')
15
10
5
Amplitude
-5
-10
-15
-20
0 1 2 3 4 5 6 7 8
Time index n
EXAMPLE 2:
x=[1 -2 3 -4 5];
y=[1 0 2 3 4];
>> r=conv(x,fliplr(y))
r=
4 -5 8 -11 15 5 13 -4 5
>> n=0:8;
>> stem(n,r)
>> ylabel('Amplitude')
>>title('Cross Correlation')
Cross Correlation
15
10
5
Amplitude
-5
-10
-15
0 1 2 3 4 5 6 7 8
Time index n
x=[1 -2 3 -4 5]
x=
1 -2 3 -4 5
>> r=conv(x,fliplr(x))
r=
5 -14 26 -40 55 -40 26 -14 5
>> n=0:8;
>> stem(n,r)
ylabel('Amplitude')
Auto correlation
60
50
40
30
20
Amplitude
10
-10
-20
-30
-40
0 1 2 3 4 5 6 7 8
Time index n