function result = AllPass(d)
w =[0:pi/2000:pi];
a = (1-d)/(1+d);

result  = (a + exp(-i*w)) ./ (1+ a*exp(-i*w));

figure;
subplot(2,1,1);
plot(w, abs(result));
subplot(2,1,2);
plot(w, angle(result));