comparison m-toolbox/html_help/help/ug/whiten1D_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>
3 <ul>
4 <li><a href="#description">Description</a></li>
5 <li><a href="#call">Call</a></li>
6 <li><a href="#inputs">Inputs</a></li>
7 <li><a href="#outputs">Outputs</a></li>
8 <li><a href="#algorithm">Algorithm</a></li>
9 <li><a href="#parameters">Parameters</a></li>
10 <li><a href="#example">Example</a></li>
11 </ul>
12 </p>
13 -->
14 <h2><a name="description">Description</a></h2>
15
16 <p>
17 whiten1D whitens input time-series. Whitening filter is constructed
18 by a fitting procedure to the model provided. If no model is provided, a
19 fit is made to a log-spectral-density estimate of the
20 time-series (made using lpsd).
21 Note: The function assumes that the input model corresponds
22 to the one-sided psd of the data to be whitened.
23 </p>
24
25 <h2><a name="call">Call</a></h2>
26 <div class="fragment">
27 <pre>
28 <br>
29 b = whiten1D(a, pl)
30 [b1,b2,...,bn] = whiten1D(a1,a2,...,an, pl);
31 </pre>
32 </div>
33
34 <h2><a name="inputs">Inputs</a></h2>
35
36 <p>
37 <ul>
38 <li> a - is a tsdata analysis object or a vector of tsdata analysis objects
39 <li> pl - is a plist with the input parameters. See the list of function parameters below
40 </ul>
41 </p>
42
43 <h2><a name="outputs">Outputs</a></h2>
44
45 <p>
46 <ul>
47 <li> b "whitened" time-series AOs. The whitening filters used
48 are stored in the objects procinfo field under the
49 parameter 'Filt'.
50 </ul>
51 </p>
52
53 <h2><a name="algorithm">Algorithm</a></h2>
54
55 <p>
56 <ol>
57 <li> If no model provided, make lpsd of time-series and take it
58 as a model for the data power spectral density
59 <li> Fit a set of partial fraction z-domain filters using
60 utils.math.psd2wf. The fit is automatically stopped when
61 the accuracy tolerance is reached.
62 <li> Convert to bank of MIIR filters.
63 <li> Filter time-series in parallel
64 </ol>
65 </p>
66 <p>
67 Accuracy tolerance criteria
68 <ul>
69 <li> No model provided <br/>
70 In such a case the algorithm try to extract a smooth model
71 from lpsd noisy data. Fit residuals spectral flatness is
72 compared with the 'FitTolerance' parameter. Fit is stopped
73 when residuals spectral flatness is larger than the
74 'FitTolerance' parameter. Admitted values are 0 < tol < 1.
75 Recommended values are 0.5 < tol < 0.7. If out of range values
76 are provided the parameter is set to 0.5.
77 <li> Model provided <br/>
78 In such a case the algorithm try to exactly fit the input
79 model whitin the accuracy reported in 'FitTolerance'. Check
80 if the minimum of the logarithmic difference between data
81 and residuals is larger than a specified value.
82 Admitted values are tol>0. Recommended values are
83 0.5 < tol < 2. if the conditioning value is 2, the function
84 ensures that the difference between data and residuals is
85 at lest 2 order of magnitude lower than data itsleves. If a
86 negative value is provided the tolerance is set to 1.
87 </ul>
88 </p>
89
90
91 <h2><a name="parameters">Parameters</a></h2>
92 <p>
93 <ul>
94 <li> 'Model' - a frequency-series AO describing the model
95 response to build the filter from. [default: lpsd
96 of time-series].
97 <li> 'MaxIter' - Maximum number of iterations in fit routine
98 [default: 30]
99 <li> 'PoleType' - Choose the pole type for fitting:
100 <ul>
101 <li> 1 - use real starting poles.
102 <li> 2 - generates complex conjugate poles of the
103 type a.*exp(theta*pi*j)
104 with theta = linspace(0,pi,N/2+1).
105 <li> 3 - generates complex conjugate poles of the type
106 a.*exp(theta*pi*j)
107 with theta = linspace(0,pi,N/2+2) [default].
108 </ul>
109 </li>
110 <li> 'MinOrder' - Minimum order to fit with. [default: 2].
111 <li> 'MaxOrder' - Maximum order to fit with. [default: 25]
112 <li> 'Weights' - choose weighting for the fit: [default: 2]
113 <ul>
114 <li> 1 - equal weights for each point.
115 <li> 2 - weight with 1/abs(model).
116 <li> 3 - weight with 1/abs(model).^2.
117 <li> 4 - weight with inverse of the square mean spread of the model.
118 </ul>
119 </li>
120 <li> 'Plot' - plot results of each fitting step. [default: false]
121 <li> 'Disp' - Display the progress of the fitting iteration.
122 [default: false]
123 <li> 'FitTolerance' - Stopping fit tolerance condition. Be sure to
124 read the algorithm description to provide the
125 correct value. [default: 0.6]
126 <li> 'RMSEVar' - Root Mean Squared Error Variation - Check if the
127 variation of the RMS error is smaller than 10^(-b),
128 where b is the value given to the variable. This
129 option is useful for finding the minimum of Chi
130 squared. [default: 7].
131 </ul>
132 parameters passed to lpsd()
133 <ul>
134 <li> 'Jdes' - The number of points in the power spectrum.
135 [default: help lpsd].
136 <li> 'Win' - Spectral window used in spectral estimation.
137 [default: help lpsd].
138 <li> 'Order' - order of segment detrending: [default: help lpsd]
139 <ul>
140 <li> -1 - no detrending
141 <li> 0 - subtract mean
142 <li> 1 - subtract linear fit
143 <li> N - subtract fit of polynomial, order N
144 </ul>
145 </ul>
146 </p>
147
148 <h2><a name="example">Example</a></h2>
149
150 <div class="fragment">
151 <br>
152 <pre>
153 <span class="comment">% Generate white noise</span>
154 fs = 1;
155 a = ao(plist( <span class="string">'tsfcn'</span>, <span class="string">'randn(size(t))'</span>, <span class="string">'fs'</span>, fs, <span class="string">'nsecs'</span>, 10000, <span class="string">'yunits'</span>, <span class="string">'m'</span>, <span class="string">'name'</span>, <span class="string">'input'</span>));
156
157 <span class="comment">% filter </span>
158 pzm = pzmodel(1e-2, {0.01}, {0.1});
159 ft = miir(pzm,plist( <span class="string">'fs'</span>,fs));
160
161 <span class="comment">% coloring white noise </span>
162 af = filter(a, ft);
163
164 <span class="comment">% Whitening colored noise</span>
165 pl = plist(...
166 <span class="string">'model'</span>, [], ...
167 <span class="string">'MaxIter'</span>, 30, ...
168 <span class="string">'PoleType'</span>, 2, ...
169 <span class="string">'MinOrder'</span>, 2, ...
170 <span class="string">'MaxOrder'</span>, 9, ...
171 <span class="string">'Weights'</span>, 2, ...
172 <span class="string">'Plot'</span>, false,...
173 <span class="string">'Disp'</span>, false,...
174 <span class="string">'RMSEVar'</span>, 3,...
175 <span class="string">'FitTolerance'</span>, 0.6); <span class="comment">% tolerancee on fit residuals spectral flatness</span>
176
177 aw = whiten1D(af,pl);
178
179 <span class="comment">% Calculate psd of colored and whitened data </span>
180 afxx = af.psd;
181 awxx = aw.psd;
182
183 <span class="comment">% plotting </span>
184 iplot(afxx,awxx)
185 </pre>
186 </div>
187 <br>
188 <br>
189 <p>
190 <div align="center">
191 <IMG src="images/whiten1D_1.png" align="center" border="0">
192 </div>
193 </p>
194
195
196
197
198
199
200
201
202
203
204