%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%This function takes in a center %
%and bandwidth and creates a     %
%2nd order band bass filter      %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function [a,b,num,den,root1,root2] =second_band_pass(wc,bw)

b=cos(wc);  %Beta

%Finding Alpha
v=[cos(bw),-2,cos(bw)];
a=roots(v);
root1=roots(1);
root2=roots(2);

if abs(a(1))<1
    a=a(1);
else
    a=a(2)
end
num=(1-a)*[1,0,-1];
den=2*[1,-b*(1+a),a];
freqz(num,den)



