%Input g-vector %This approach is abandoned. It seems oveengineered. %Perhaps it is fast, but requires from programmer watch out for %vector/scalar operation difference function r=functionPPMFast(g,PPM_L){ q=(pi)*g; %vector L=PPM_L; Pw=sin(q)./(q); %vector %Calculate correlator: H=0.0; for d=1:(L-1) H=H.+(L-d)*cos(2.0*q*i); end r=Pw.*Pw.*(1-(L+2.0*H)/L); end Copyright (C) 2009 Konstantin Kirillov