function [coef_out] =  root_raised_cosine(alpha,beta,clen)
        flen=2048;
        clear vec;
        f1=(1-beta)*alpha;
        f2=(1+beta)*alpha;
        tau=0.5/alpha;

        len2=floor(flen/2);
        for n=0:len2
                f=n/flen;
                v=0;
                if f<=f1
                        v=1.0;
                else
                        if f<=f2
                                v=sqrt((0.5*(1+cos((pi*tau/beta)*(f-f1)))));
                        endif
                endif

                x=pi*n/flen;
        
                vec(1+n)=v;
                vec(flen-n)=v;
        endfor

        vec2=real(ifft(vec));
        vec2=ifftshift(vec2);

        clear coef_out;

        for n=1:clen
        coef_out(n)=vec2(len2-(clen+1)/2+n+1);
        endfor;
end

rrc_filtersize=31;
rrc_alpha=.25; # corner frequency (-3dB)
rrc_beta=0.35; # Beta

coef_rrc=root_raised_cosine(rrc_alpha, rrc_beta, rrc_filtersize);

printf("%f, ", coef_rrc);
printf("\n");