Mercurial > hg > ddm
annotate overlap_log_p_1.m @ 4:72c011ed1977 tip
more elaborate example with non-stat. estimate explanation
author | smusevic |
---|---|
date | Tue, 30 Jul 2013 09:56:27 +0100 |
parents | a4a7e3405062 |
children |
rev | line source |
---|---|
dan@0 | 1 fs = 441;; |
dan@0 | 2 N = 2^10-1; |
dan@0 | 3 |
dan@0 | 4 ply = [1000, -65, -1.2]; |
dan@0 | 5 |
dan@0 | 6 t = [-(N-1)/2:(N-1)/2]; |
dan@0 | 7 |
dan@0 | 8 p_val = polyval(ply,t); |
dan@0 | 9 f = log(p_val); |
dan@0 | 10 f_fit = polyfit(t,f,20); |
dan@0 | 11 real(f_fit(end - 3:end)) |
dan@0 | 12 |
dan@0 | 13 ply(end-1)/ply(end) |
dan@0 | 14 log(ply(end)) |
dan@0 | 15 |
dan@0 | 16 figure(1);clf; |
dan@0 | 17 subplot(311); |
dan@0 | 18 plot(p_val); |
dan@0 | 19 subplot(312);hold on |
dan@0 | 20 plot(real(f)); |
dan@0 | 21 plot(real(polyval(f_fit,t)),'r--'); |
dan@0 | 22 subplot(313); |
dan@0 | 23 plot(imag(f)/pi*-2+1); |