function H =raised_cos_baseband_filter(f,f_data,alpha) %function output= name(input)....this is the syntax % have to be careful not to use an existing function name. % % alpha is the excess bandwidth factor and f is the signal frequency, and f_data the data rate % % % % first create the raised-cosine transfer function.... % y=abs(f) ; if y < (1-alpha)*f_data/2 H=1; else if y > (1+alpha)*f_data/2 H=1E-120; % making this zero causes numerical problems else H=(cos( pi*y/alpha/f_data/2 + pi*(1-1/alpha)/4))^2 ; end end % %end function