fc=0.25;
wc=2*pi*fc;
N=31;
n=-(N-1)/2:(N-1)/2;
h_HP=-(wc/pi)*sin(pi/2.*n)./(pi/2*n);
h_HP((N+1)/2)=1-(wc/pi);

zeros_HP=roots(h_HP);
figure(1);
plot(real(zeros_HP),imag(zeros_HP),'o')
hold on
plot(0,0,'bx')
axis([-1.5 1.5 -1.5 1.5]);
axis square

x=linspace(-1,1,1000);
plot(x,sqrt(1-x.^2),'r-')
plot(x,-sqrt(1-x.^2),'r-')
hold off

X=exp(-1i*n'*linspace(-pi,pi,1000));
h_HP=h_HP./sqrt(h_HP*h_HP');
H=h_HP*X;
figure(2);
plot(linspace(-pi,pi,1000),abs(H))

%% Removing the zeros in the left half plane (for comparison purposes - what would happen if we only have the zeros at the places we would like to attenuate)
pos=find(real(zeros_HP)>0);
zeros_HP_mod=zeros_HP(pos);
h_HP_mod=poly(zeros_HP_mod);
h_HP_mod=h_HP_mod./sqrt(h_HP_mod*h_HP_mod');
ste=[-(length(h_LP_mod)-1)/2:(length(h_LP_mod)-1)/2];
X=exp(-1i*ste'*linspace(-pi,pi,1000));
H=h_HP_mod*X;
figure(2);
hold on
plot(linspace(-pi,pi,1000),abs(H),'r')
hold off