diff testing/utp_1.1/utps/ao/reference_files/create_ref_whitenoise.m @ 44:409a22968d5e default

Add unit tests
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Tue, 06 Dec 2011 18:42:11 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/testing/utp_1.1/utps/ao/reference_files/create_ref_whitenoise.m	Tue Dec 06 18:42:11 2011 +0100
@@ -0,0 +1,74 @@
+% CREATE_REF_WHITENOISE creates a set of known white noise time series to
+% be used in UTP testing
+%
+% M Nofrarias 20-01-09
+%
+% $Id: create_ref_whitenoise.m,v 1.5 2010/05/06 07:29:42 ingo Exp $
+%
+
+% <MethodDescription>
+%
+% The method uses the 'whitenoise' AO model to create white noise using
+% always the same seed for the noise generator.
+%
+% </MethodDescription>
+
+function create_ref_whitenoise()
+  
+  % <AlgoCode>
+  
+  % creates 10 s at 1000 Hz, sigma = 1
+  pl = plist(...
+    'sigma',1,...
+    'nsecs',10,...
+    'fs',1000);
+  
+  a = ao(plist('built-in', 'whitenoise'),pl);
+  % save xml file
+  save(a,'ref_whitenoise_10s_1000Hz.xml');
+  
+  
+  % creates 3600 s at 1 Hz, sigma = 3e-8
+  pl = plist(...
+    'sigma',3e-8,...
+    'nsecs',3600,...
+    'fs',1);
+  
+  a = ao(plist('built-in', 'whitenoise'),pl);
+  % save xml file
+  save(a,'ref_whitenoise_3600s_1Hz.xml');
+  
+  
+  % creates 100000 s at 0.1 Hz, sigma = 4e-12
+  pl = plist(...
+    'sigma',4e-12,...
+    'nsecs',100000,...
+    'fs',0.1);
+  
+  a = ao(plist('built-in', 'whitenoise'),pl);
+  % save xml file
+  save(a,'ref_whitenoise_100000s_100mHz.xml');
+  
+  % creates 2e4 s at 10 Hz, sigma = 5e-6
+  pl = plist(...
+    'sigma', 5e-6,...
+    'nsecs', 2e3,...
+    'fs', 10);
+  
+  a = ao(plist('built-in', 'whitenoise'),pl);
+  % save xml file
+  save(a,'ref_whitenoise_20000s_10Hz.xml');
+  
+  % creates 2e5 s at 10 Hz, sigma = 5e-6
+  pl = plist(...
+    'sigma', 5e-6,...
+    'nsecs', 2e3,...
+    'fs', 10);
+  
+  a = ao(plist('built-in', 'whitenoise'),pl);
+  % save xml file
+  save(a,'ref_whitenoise_200000s_10Hz.xml');
+  
+  % </AlgoCode>
+  
+end
\ No newline at end of file