// simulation on Figure 6-15

// CHANNEL
h = [ 1 0.5 0.2];
// INPUT signal
x1 = [1 0 0 0 0] ;
// OUTPUT signal
y1 = convol(h,x1)
// PLOTS
subplot(4,1,1)
xa =1:7;
plot2d(xa, y1, style=-2,rect=[0 0 8 2])

//
x2=[1 1 1 1 1]
y2=convol(h,x2)
subplot(4,1,2)
plot2d(xa,y2,style=-3,rect=[0 0 8 2])

//
n=1:100;
x3 = cos(2*%pi*n/32);
y3 = convol(h,x3);
subplot(4,1,3)
plot2d(n,x3,style=1, rect=[0 -2 100 2])
subplot(4,1,4)
plot2d(n,y3(1:100),style=1, rect=[0 -2 100 2])

