function[fH,H]=Butterworth_Transfer(typ,fc,freq,nyq);
%
disp(' Butterworth_Transfer.m   ver 1.0   June 18, 2007')
%
clear H;
clear fH;
clear A;
clear s;
tpi=2*pi;
disp(' ')
%
for(i=1:nyq)
    flag=0;
    s=complex(0,(freq(i)/fc));
%
    if(typ==2)
        if( (freq(i)/fc) >0)
            s=1/s;
        else
            flag=1;
        end
    end
%    
    H(i)=complex(0.,0.);   % H is complex because s is complex
    if(flag==0)
        H1=s^2-2*cos(7*pi/12)*s+1;
        H2=s^2-2*cos(9*pi/12)*s+1;
        H3=s^2-2*cos(11*pi/12)*s+1;    
        A=H1*H2*H3;
%    
        A=1/A;
        H(i)=A;
    end
    fH(i)=freq(i);
%
end