function [y]=RaisedCosine(x,alfa) %function [y]=RaisedCosine(x,alfa) %x: time vector %alfa: roll-off factor %y: pulse response pigreco=3.141592653589793; y=zeros(1,length(x)); y(x==0)=1; y(abs(x*alfa)==1/2)=sinc(1/(2*alfa))*pigreco/4; y(x~=0 & abs(x*alfa)~=1/2)=sinc(x(x~=0 & abs(x*alfa)~=1/2)).*cos(alfa*pigreco*x(x~=0 & abs(x*alfa)~=1/2))./(1-(2*alfa*x(x~=0 & abs(x*alfa)~=1/2)).^2);