function temp=pricostr(Fin,Im,Gim,Nval,alfa)

%%%%%%%%%% temp verra` passata al main come ris

n=length(Im);

auxim=1./alfa*Im;
auxg=1./alfa*Gim;
tau=1./((max(abs(auxim)))^2)

for i=1:n,
   primo(i)=tau*(-1)^(i-1)*conj(auxim(i))*auxg(i);
   secondo(i)=1.-tau*(abs(auxim(i)))^2;
end

it=0;
while it < Nval,
   for i=1:n,
      aux(i)=primo(i)+secondo(i)*Fin(i);
   end
   aux1=ifft(aux);
   %%%%%% Positivity constraint
   
   a=real(aux1);
   for i=1:n,
      if a(i) < 0 
         a(i)=0.;
      end   
   end
   aux1=complex(a);
   aux1=alfa*aux1;
   
   if it == Nval-1
      temp=aux1;
   end
      
   Fin=1./alfa*fft(aux1);
   it=it+1;
      
end