% File: E3_069.M

clear;

r = input('Enter value of r between 0.01 and 1:');
fo = 1;
B = fo*(1+r);
fl = B*(1-r)/(1+r);
fd = (B-fl)/2;
df = B/50;
f = 0:df:B;

a = zeros(length(f),1);
window = a;
b = a;

window = pulse(window,f,fl,B);
for (i = 1:1:length(f));
  if (f(i) < fl)
    a(i) = 1;
  end;
  b(i) = 0.5*(1+cos(pi*(f(i)-fl)/(2*fd)));
end;
He = a + b.*window;

plot(f,He);
xlabel('f');
ylabel('He(f)');
title(['r=',num2str(r),'   NOTE: See Figs. 3-25 & 3-26a']);



