view overlap_log_p_1.m @ 0:a4a7e3405062

Import DDM code by Sašo Muševič
author Dan Stowell <dan.stowell@elec.qmul.ac.uk>
date Thu, 09 May 2013 20:04:15 +0100
parents
children
line wrap: on
line source
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);