Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/sigproc_example_matrix_linfitsvd_content.html @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 | |
2 <p>Iterative linear parameter estimation for multichannel systems - symbolic system model in frequency domain.</p> | |
3 | |
4 <h2>Contents</h2> | |
5 <ul> | |
6 <li><a href="#1">set plist for retriving</a></li> | |
7 <li><a href="#2">retrive data</a></li> | |
8 <li><a href="#3">Load input signal</a></li> | |
9 <li><a href="#4">load Whitening filters</a></li> | |
10 <li><a href="#6">Build input objects</a></li> | |
11 <li><a href="#7">system model 1</a></li> | |
12 <li><a href="#8">Do Fit</a></li> | |
13 <li><a href="#9">system model 2</a></li> | |
14 <li><a href="#10">Set Model Alias</a></li> | |
15 <li><a href="#11">Do fit with alias</a></li> | |
16 </ul> | |
17 | |
18 <h2>set plist for retriving<a name="1"></a></h2> | |
19 | |
20 <div class="fragment"><pre> | |
21 | |
22 pl = plist(<span class="string">'hostname'</span>, <span class="string">'lpsdas01.esac.esa.int'</span>, <span class="string">'database'</span>, <span class="string">'ex6'</span>); | |
23 </pre></div> | |
24 | |
25 <h2>retrive data<a name="2"></a></h2> | |
26 | |
27 <div class="fragment"><pre> | |
28 o1_1 = ao(pl.pset(<span class="string">'binary'</span>, <span class="string">'yes'</span>, <span class="string">'id'</span>, 169)); | |
29 o12_1 = ao(pl.pset(<span class="string">'binary'</span>, <span class="string">'yes'</span>, <span class="string">'id'</span>, 170)); | |
30 | |
31 o1_2 = ao(pl.pset(<span class="string">'binary'</span>, <span class="string">'yes'</span>, <span class="string">'id'</span>, 171)); | |
32 o12_2 = ao(pl.pset(<span class="string">'binary'</span>, <span class="string">'yes'</span>, <span class="string">'id'</span>, 172)); | |
33 </pre></div> | |
34 | |
35 <h2>Load input signal<a name="3"></a></h2> | |
36 | |
37 <div class="fragment"><pre> | |
38 is1 = matrix(pl.pset(<span class="string">'binary'</span>, <span class="string">'yes'</span>, <span class="string">'id'</span>, 173)); | |
39 is2 = matrix(pl.pset(<span class="string">'binary'</span>, <span class="string">'yes'</span>, <span class="string">'id'</span>, 180)); | |
40 </pre></div> | |
41 | |
42 <h2>load Whitening filters<a name="4"></a></h2> | |
43 <span class="comment">% Stoc filter</span> | |
44 | |
45 <div class="fragment"><pre> | |
46 fil1 = filterbank(pl.pset(<span class="string">'binary'</span>, <span class="string">'yes'</span>, <span class="string">'id'</span>, 191)); | |
47 fil2 = filterbank(pl.pset(<span class="string">'binary'</span>, <span class="string">'yes'</span>, <span class="string">'id'</span>, 192)); | |
48 fil3 = filterbank(miir()); | |
49 <span class="comment">% build matrix</span> | |
50 wf = matrix(fil1,fil3,fil3,fil2,plist(<span class="string">'shape'</span>,[2 2])); | |
51 </pre></div> | |
52 | |
53 <h2>Build input objects<a name="6"></a></h2> | |
54 | |
55 <div class="fragment"><pre> | |
56 | |
57 <span class="comment">% empty ao</span> | |
58 eao = ao(); | |
59 | |
60 <span class="comment">% exp_3_1</span> | |
61 os1 = matrix(o1_1,o12_1,plist(<span class="string">'shape'</span>,[2 1])); | |
62 | |
63 <span class="comment">% exp_3_2</span> | |
64 os2 = matrix(o1_2,o12_2,plist(<span class="string">'shape'</span>,[2 1])); | |
65 | |
66 <span class="comment">% Input signals</span> | |
67 iS = collection(is1,is2); | |
68 | |
69 <span class="comment">% Fit Params</span> | |
70 usedparams = {<span class="string">'A1'</span>,<span class="string">'A2'</span>,<span class="string">'S21'</span>,<span class="string">'w1'</span>,<span class="string">'w12'</span>,<span class="string">'del1'</span>,<span class="string">'del2'</span>}; | |
71 | |
72 nsecs = os1.objs(1).data.nsecs; | |
73 fs = os1.objs(1).data.fs; | |
74 npad = nsecs*fs; | |
75 | |
76 <span class="comment">% set bounded params</span> | |
77 bdparams = {<span class="string">'del1'</span>,<span class="string">'del2'</span>}; | |
78 bdvals = {[0.1 0.3],[0.1 0.3]}; | |
79 | |
80 </pre></div> | |
81 | |
82 <h2>system model 1<a name="7"></a></h2> | |
83 | |
84 <div class="fragment"><pre> | |
85 | |
86 H = matrix(plist(<span class="string">'built-in'</span>,<span class="string">'ifo2ifo'</span>, <span class="string">'Version'</span>, <span class="string">'LSS v4.9.2 Phys Params'</span>)); | |
87 </pre></div> | |
88 | |
89 <h2>Do Fit<a name="8"></a></h2> | |
90 | |
91 <div class="fragment"><pre> | |
92 | |
93 plfit = plist(<span class="keyword">...</span> | |
94 <span class="string">'FitParams'</span>,usedparams,<span class="keyword">...</span> | |
95 <span class="string">'Model'</span>,H,<span class="keyword">...</span> | |
96 <span class="string">'Input'</span>,iS,<span class="keyword">...</span> | |
97 <span class="string">'WhiteningFilter'</span>,wf,<span class="keyword">...</span> | |
98 <span class="string">'tol'</span>,1,<span class="keyword">...</span> | |
99 <span class="string">'Nloops'</span>,10,<span class="keyword">...</span> | |
100 <span class="string">'Npad'</span>,npad,<span class="keyword">...</span> | |
101 <span class="string">'Ncut'</span>,1e4); | |
102 | |
103 opars1 = linfitsvd(os1,os2,plfit); | |
104 </pre></div> | |
105 | |
106 <h2>system model 2<a name="9"></a></h2> | |
107 | |
108 <div class="fragment"><pre> | |
109 | |
110 H2 = matrix(plist(<span class="string">'built-in'</span>,<span class="string">'ifo2ifo'</span>, <span class="string">'Version'</span>, <span class="string">'LSS v4.9.2 Phys Params Alias'</span>)); | |
111 </pre></div> | |
112 | |
113 <h2>Set Model Alias<a name="10"></a></h2> | |
114 | |
115 <div class="fragment"><pre> | |
116 | |
117 plalias = plist(<span class="string">'nsecs'</span>,nsecs,<span class="string">'npad'</span>,npad,<span class="string">'fs'</span>,fs); | |
118 <span class="keyword">for</span> ii=1:numel(H2.objs) | |
119 H2.objs(ii).assignalias(H2.objs(ii),plalias); | |
120 <span class="keyword">end</span> | |
121 </pre></div> | |
122 | |
123 <h2>Do fit with alias<a name="11"></a></h2> | |
124 | |
125 <div class="fragment"><pre> | |
126 | |
127 plfit2 = plist(<span class="keyword">...</span> | |
128 <span class="string">'FitParams'</span>,usedparams,<span class="keyword">...</span> | |
129 <span class="string">'Model'</span>,H2,<span class="keyword">...</span> | |
130 <span class="string">'BoundedParams'</span>,bdparams,<span class="keyword">...</span> | |
131 <span class="string">'BoundVals'</span>,bdvals,<span class="keyword">...</span> | |
132 <span class="string">'Input'</span>,iS,<span class="keyword">...</span> | |
133 <span class="string">'WhiteningFilter'</span>,wf,<span class="keyword">...</span> | |
134 <span class="string">'tol'</span>,1,<span class="keyword">...</span> | |
135 <span class="string">'Nloops'</span>,10,<span class="keyword">...</span><span class="comment"> % maximum number of fit iterations</span> | |
136 <span class="string">'Npad'</span>,npad,<span class="keyword">...</span> | |
137 <span class="string">'Ncut'</span>,1e4); <span class="comment">% number of data points to skip at the starting of the series to avoid whitening filter transient</span> | |
138 | |
139 opars2 = linfitsvd(os1,os2,plfit2); | |
140 </pre></div> | |
141 |