1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| clear all
n=0:8;
%Function
x=n
h=n.*(n<=3)
%Plot of x and h
subplot(1,2,1)
stem(n,x);
xlabel('x(n)')
grid on
subplot(1,2,2)
stem(n,h)
xlabel('h(n)')
grid on
figure(2)
rhh=autocorr(h)
rxh=crosscorr(x,h)
rxx=autocorr(x)
rhx=crosscorr(h,x)
figure(2)
subplot(2,2,1)
plot(rxx)
xlabel('auto-Correlation Rxx')
grid on
subplot(2,2,2)
plot(rhh)
xlabel('auto-Correlation Rhh')
grid on
subplot(2,2,3)
plot(rxh)
xlabel('cross-Correlation Rxh')
grid on
subplot(2,2,4)
plot(rhx)
xlabel('cross-Correlation Rhx')
grid on
%Part 2
%h(n-4)=h(n') for 4<n'<7
h1=n.*(n>=4 & n<=7)
figure(3);
stem(n,h1);
xlabel('h(n-3)')
grid on
rhh1=crosscorr(h,h1)
figure(4);
plot(rhh1);
grid on
xlabel('Intercorrelation between h(n) and h(n-3)') |
Partager