comparison m-toolbox/html_help/help/ug/gapfill.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 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
3
4 <html lang="en">
5 <head>
6 <meta name="generator" content=
7 "HTML Tidy for Mac OS X (vers 1st December 2004), see www.w3.org">
8 <meta http-equiv="Content-Type" content=
9 "text/html; charset=us-ascii">
10
11 <title>Data gap filling (LTPDA Toolbox)</title>
12 <link rel="stylesheet" href="docstyle.css" type="text/css">
13 <meta name="generator" content="DocBook XSL Stylesheets V1.52.2">
14 <meta name="description" content=
15 "Presents an overview of the features, system requirements, and starting the toolbox.">
16 </head>
17
18 <body>
19 <a name="top_of_page" id="top_of_page"></a>
20
21 <p style="font-size:1px;">&nbsp;</p>
22
23 <table class="nav" summary="Navigation aid" border="0" width=
24 "100%" cellpadding="0" cellspacing="0">
25 <tr>
26 <td valign="baseline"><b>LTPDA Toolbox</b></td><td><a href="../helptoc.html">contents</a></td>
27
28 <td valign="baseline" align="right"><a href=
29 "spikeclean.html"><img src="b_prev.gif" border="0" align=
30 "bottom" alt="Spikes reduction in data"></a>&nbsp;&nbsp;&nbsp;<a href=
31 "whitening.html"><img src="b_next.gif" border="0" align=
32 "bottom" alt="Noise whitening"></a></td>
33 </tr>
34 </table>
35
36 <h1 class="title"><a name="f3-12899" id="f3-12899"></a>Data gap filling</h1>
37 <hr>
38
39 <p>
40 <h2>Description</h2>
41 <p>
42 Gaps in data can be filled with <i>interpolated</i> data if desired. LTPDA <a href="matlab:doc('ao/gapfilling')"><tt>gapfilling</tt></a> joins two AOs
43 by means of a segment of <i>synthetic</i> data. This segment is calculated from the two input AOs. Two different
44 methods are possible to fill the gap in the data: <tt>linear</tt> and <tt>spline</tt>. The former fills the data
45 by means of a linear interpolation whereas the latter uses a smoother curve ---see examples below.
46 <br>
47 <br>
48 <h2>Syntax</h2>
49 </p>
50 <div class="fragment"><pre>
51 <br>
52 b = gapfilling(a1, a2, pl)
53 </pre>
54 </div>
55 <p>
56 where <tt>a1</tt> and <tt>a2</tt> are the two segments to join.
57 </p>
58 <h2>Parameters</h2>
59 The following parameters apply for this method:
60 <ul>
61 <li><tt>'method'</tt> - method used to interpolate missing data (see below for details)
62 <ul>
63 <li> <tt>'linear'</tt> (default option) </li>
64 <li> <tt>'spline'</tt> </li>
65 </ul>
66 <li><tt>'addnoise'</tt> - with this option <i>noise</i> can be
67 added to the interpolated data.
68 This noise is defined as a <br>
69 random variable with
70 zero mean and variance equal to the high-frequency
71 noise of the input AO. </li>
72
73 </ul>
74 </p>
75 <p>
76 <h2>Algorithm</h2>
77 </p>
78 <p>
79 <b>Linear :</b> The gap is filled using a linear approximation.
80 </p>
81 <p>
82 <div align="center">
83 <IMG src="images/spike50x.png" width="205" height="27" border="0">
84 </div>
85 </p>
86 <br>
87 the notation used in the previous expression is schematically explained in the figure below
88 <br>
89 <p>
90 <div align="center">
91 <img src="images/interplinear1.png" border="1" width="400px">
92 </div>
93 </p>
94 <br>
95 <br>
96 <br>
97 <p>
98 <b>Spline :</b> a third order interpolation is used in this case
99 </p>
100 <p>
101 <br>
102 <div align="center">
103 <IMG src="images/spike51x.png" width="237" height="16" border="0">
104 </div>
105 <br>
106 </p>
107 <p>
108 The parameters <tt>a</tt>, <tt>b</tt>, <tt>c</tt> and <tt>d</tt> are calculated
109 by solving next system of equations:
110 </p>
111 <p>
112 <div align="center">
113 <IMG src="images/spike52x.png" width="205" height="117" border="0">
114 </div>
115 </p>
116 <br>
117 The result is schematically shown in the figure below
118 <br>
119 <p>
120 <div align="center">
121 <img src="images/interpspline.png" border="0" width="400px">
122 </div>
123 </p>
124 <br>
125 <p>
126 <h2>Examples</h2>
127 </p>
128 <p>
129 1. Missing data between two vectors of random data interpolated with the <tt>linear</tt> method.
130 </p>
131 <p>
132 <div class="fragment"><pre>
133 <br>
134 x1 = ao(plist(<span class="string">'waveform'</span>,<span class="string">'noise'</span>,<span class="string">'nsecs'</span>,1e3,<span class="string">'fs'</span>,10,<span class="string">'name'</span>,<span class="string">'noise'</span>)); <span class="comment">% create an AO of random data</span>
135 xs = split(x1,plist(<span class="string">'chunks'</span>,3)); <span class="comment">% split in three segments</span>
136 pl = plist( <span class="string">'method'</span>, <span class="string"> 'linear'</span>, <span class="string">'addnoise'</span>, <span class="string">'no'</span>); <span class="comment">% linear gapfilling</span>
137 y = gapfilling(xs(1),xs(3), pl); <span class="comment">% fill between 2nd and 3rd segment</span>
138 iplot(x1,y)
139 </pre>
140 </div>
141 </p>
142 <p>
143 <div align="center">
144 <img src="images/gapexample1.png" border="1" >
145 </div>
146 </p>
147 <br>
148 <br>
149 <p>
150 2. Missing data between two data vectors interpolated with the <tt>spline</tt> method.
151 </p>
152 <p>
153 <div class="fragment"><pre>
154 <br>
155 x1 = ao(plist(<span class="string">'tsfcn'</span>,<span class="string">'t.^1.8 + 1e6*rand(size(t))'</span>,<span class="string">'nsecs'</span>,5e3,<span class="string">'fs'</span>,10,<span class="string">'name'</span>,<span class="string">'noise'</span>)); <span class="comment">% create an AO</span>
156 xs = split(x1,plist(<span class="string">'chunks'</span>,3)); <span class="comment">% split in three segments</span>
157 pl = plist( <span class="string">'method'</span>, <span class="string"> 'spline'</span>, <span class="string">'addnoise'</span>, <span class="string">'no'</span>); <span class="comment">% cubic gapfilling</span>
158 y = gapfilling(xs(1),xs(3), pl); <span class="comment">% fill between 2nd and 3rd segment</span>
159 iplot(x1,y)
160 </pre>
161 </div>
162 </p>
163 <p>
164 <div align="center">
165 <img src="images/gapexample2.png" border="1">
166 </div>
167 </p>
168
169
170
171
172 </p>
173
174 <br>
175 <br>
176 <table class="nav" summary="Navigation aid" border="0" width=
177 "100%" cellpadding="0" cellspacing="0">
178 <tr valign="top">
179 <td align="left" width="20"><a href="spikeclean.html"><img src=
180 "b_prev.gif" border="0" align="bottom" alt=
181 "Spikes reduction in data"></a>&nbsp;</td>
182
183 <td align="left">Spikes reduction in data</td>
184
185 <td>&nbsp;</td>
186
187 <td align="right">Noise whitening</td>
188
189 <td align="right" width="20"><a href=
190 "whitening.html"><img src="b_next.gif" border="0" align=
191 "bottom" alt="Noise whitening"></a></td>
192 </tr>
193 </table><br>
194
195 <p class="copy">&copy;LTP Team</p>
196 </body>
197 </html>