
function [phi, range]=extendedDACMalgorithm_(dataBin, param)
    
        
     I = real(dataBin);
     Q = imag(dataBin);

    phi_previous = 0;
    

    for k=2:length(dataBin)

        phi(k)=phi_previous + (I(k-1)*Q(k) - I(k)*Q(k-1));
        range(k) = param.c/(4*pi*param.centerFrequency) * phi(k);
        phi_previous = phi(k);

    end

    len = length(range);
    t = (0:len-1)*param.slowTime/len;

    figure
    plot(t, phi)
    xlim([param.startsec param.endsec])
    title ("Phase vs Slow time")
    xlabel('time(s)')
    ylabel('phase amplitude')
    

    
end