N=1024;
t = [0:1/44100:0.1-1/44100];
x1=cos(2*pi*100*44100/1024*t);
x801 = x1(1:801);
xlength=length(x801);
fftbuffer=zeros(N, 1);
fftbuffer(1:(xlength+1)/2) = x801((xlength+1)/2:xlength);
fftbuffer(N-(xlength-1)/2+1:N) = x801(1: (xlength-1)/2);
plot(unwrap(angle(fftbuffer,1024)));