fs = 441;;
N = 2^10-1;

ply = [1000, -65, -1.2];

t = [-(N-1)/2:(N-1)/2];

p_val = polyval(ply,t);
f = log(p_val);
f_fit = polyfit(t,f,20);
real(f_fit(end - 3:end))

ply(end-1)/ply(end)
log(ply(end))

figure(1);clf;
subplot(311);
plot(p_val);
subplot(312);hold on
plot(real(f)); 
plot(real(polyval(f_fit,t)),'r--');
subplot(313);
plot(imag(f)/pi*-2+1);