diff m-toolbox/test/test_ltpda_nfest.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/test/test_ltpda_nfest.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,36 @@
+% TEST_LTPDA_NFEST tests the ltpda_nfest noise-floor estimator.
+%
+% M Hewitson 14-05-07
+%
+% $Id: test_ltpda_nfest.m,v 1.14 2009/02/02 15:20:37 hewitson Exp $
+%
+function test_ltpda_nfest()
+  
+  
+  nsecs = 10000;
+  fs    = 10;
+  pl = plist('nsecs', nsecs, 'fs', fs, 'tsfcn', 'sin(2*pi*0.433*t) + 10*sin(2*pi*0.021*t) + randn(size(t))');
+  x12 = ao(pl);
+  
+  % Make spectrum
+  
+  pl = plist('Nfft', '100*fs');
+  x12xx = psd(x12, pl);
+  
+  % Make noise-floor estimate
+  pl    = plist('bw', 128);
+  x12nf = smoother(x12xx, pl)
+  
+  % Plot
+  iplot([x12xx x12nf])
+  
+  
+  % Rebuild from history
+  a_out = rebuild(x12nf);
+  
+  iplot(a_out)
+  plot(a_out.hist)
+  
+end
+% END
+