Mercurial > hg > ltpda
diff m-toolbox/test/xml_tests/test_param.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/xml_tests/test_param.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,88 @@ +clear all; + +%% Char param +xmlfile = 'char.xml'; +p = param('a', 'val'); +save(p, xmlfile) +q = param(xmlfile); +if p ~= q + error('param char test failed') +end + + +%% Numeric param +xmlfile = 'numeric.xml'; +p = param('a', 2); +save(p, xmlfile) +q = param(xmlfile); +if p ~= q + error('param numeric test failed') +end + + +%% Specwin param +xmlfile = 'specwin.xml'; +p = param('a', specwin('Hanning', 20)); +save(p, xmlfile) +q = param(xmlfile); +if p ~= q + error('param specwin test failed') +end + +%% Time param +xmlfile = 'time.xml'; +p = param('a', time()); +save(p, xmlfile) +q = param(xmlfile); +if p ~= q + error('param time test failed') +end + +%% MIIR param +xmlfile = 'miir.xml'; +pl_mii = plist('type', 'bandpass', 'fs', 1000, 'fc', [50 100], 'order', 3); +p = param('a', miir(pl_mii)); +save(p, xmlfile) +q = param(xmlfile); +if p ~= q(1) + error('param miir test failed') +end + + +%% MFIR param +xmlfile = 'mfir.xml'; +pl_mir = plist('type', 'lowpass', 'Win', specwin('Kaiser', 10, 150), 'fs', 100, 'fc', 20); +p = param('a', mfir(pl_mir)); +save(p, xmlfile) +q = param(xmlfile); +if p ~= q(1) + error('param mfir test failed') +end + +%% pole param +xmlfile = 'pole.xml'; +p = param('a', pz(1)); +save(p, xmlfile) +q = param(xmlfile); +if p ~= q + error('param pole test failed') +end + +%% zero param +xmlfile = 'zero.xml'; +p = param('a', pz(1,10)); +save(p, xmlfile) +q = param(xmlfile); +if p ~= q + error('param zero test failed') +end + +%% pzmodel param +xmlfile = 'pzmodel.xml'; +pzm = pzmodel(1, [pz(1) pz(2,10)], pz(4.3)); +p = param('a', pzm); +save(p, xmlfile); +q = param(xmlfile); +if p ~= q + error('param pzmodel test failed') +end