function [power1,vr_pulse,F1,S, f,v,power2]=tryout(PRF,M, Vraw, T, lambda, full_encoder)

f=-PRF/2:PRF/M:PRF/2;
f=f(1:M);
v=-f*(lambda/2);
number_az=85;

section=0:6:511;

for azi=1:length(section)-1
    u_az=find(full_encoder >= section(azi) & full_encoder < section(azi+1));
    if length(u_az) < 100
        power1(:,azi)=NaN;
        I(:,azi)=NaN;
        Q(:,azi)=NaN;
        vr_pulse(:,azi)=NaN;
    else
        V_temp=Vraw(:,u_az);
        % pulse pair
        
        power1(:,azi)=sum(V_temp.*conj(V_temp),2)/length(u_az);
        R11=(1/(length(u_az)-1))*sum(V_temp(:,2:length(u_az)).*conj(V_temp(:,1:length(u_az)-1)),2);
        I(:,azi)=real(R11);
        Q(:,azi)=imag(R11);
        vr_pulse(:,azi)=(lambda/(4*pi*T))*atan2((-Q(:,azi)),I(:,azi));
        
        %spectral
    end
    for i=1:250
        if length(u_az) < 100
            S(i,:,azi)=NaN;
            power2(i,azi)=NaN;
        else
            
            w=rectwin(length(u_az))';
            xwin=w.*V_temp(i,:);
            F=fft(xwin,M);
            F1(i,:,azi)=F;
            
            S_temp=(abs(F).^2)*T/M;
            S(i,:,azi)=[S_temp((M/2)+1:M) S_temp(1:M/2)];
            power2(i,azi)=sum(S(i,:,azi)*(f(2)-f(1)));
        end
    end 
end




