diff m-toolbox/test/test_miir_class.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_miir_class.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,43 @@
+% Test the constructor for miir objects.
+%
+% M Hewitson 11-02-07
+%
+% $Id: test_miir_class.m,v 1.20 2009/02/02 15:20:38 hewitson Exp $
+%
+function test_miir_class()
+  
+  
+  % Example 1  - empty
+  
+  f = miir()
+  
+  % Example 2 - standard types
+  
+  % bandpass
+  pl = plist('type', 'bandpass', 'fs', 1000, 'fc', [50 100], 'order', 3);
+  f1 = miir(pl);
+  
+  % highpass
+  pl = plist('type', 'highpass', 'fs', 1000, 'fc', 60, 'order', 3);
+  f2 = miir(pl);
+  
+  
+  % Plot response
+  
+  pl = plist('f1', 10, 'f2', 200);
+  a1 = resp(f1, pl);
+  a2 = resp(f2, pl);
+  a3 = a2.*a1;
+  a4 = a2./a1;
+  
+  iplot(a1, a2, a3, a4)
+  
+  % Plot history
+  plot([a3.hist a4.hist])
+  
+  
+end
+
+
+
+