Mercurial > hg > ltpda
comparison m-toolbox/html_help/help/ug/spikeclean_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 <h2>Description</h2> | |
2 <p> | |
3 Spikes in data due to different nature can be removed, if desired, from the original data. LTPDA <a href="matlab:doc('ao/spikecleaning')"><tt>spikecleaning</tt></a> detects and replaces | |
4 spikes of the input AOs. A spike in data is defined as a single sample exceeding a certain value (usually, the | |
5 floor noise of the data) defined by the user: | |
6 </p> | |
7 <br> | |
8 <p> | |
9 <div align="center"> | |
10 <IMG src="images/spike10x.png" width="147" height="15" border="0" /> | |
11 </div> | |
12 </p> | |
13 <br> | |
14 <p> | |
15 where <IMG src="images/spike41x.png" width="50" height="14" border="0" /> is the input data high-pass filtered, <IMG src="images/spike42x.png" width="34" height="13" border="0"/> is a value defined by the user (by default is 3.3) and <IMG src="images/spike43x.png" width="35" height="8" border="0"/> is the standard deviation of <IMG src="images/spike41x.png" width="50" height="14" border="0" /> . In consequence, a spike is defined as the value that exceeds the floor noise of the data by a factor <IMG src="images/spike42x.png" width="34" height="13" border="0"/>, the higher of this parameter the more difficult to "detect" a spike. | |
16 <br> | |
17 <br> | |
18 <h2>Syntax</h2> | |
19 </p> | |
20 <div class="fragment"><pre> | |
21 <br> | |
22 b = spikecleaning(a, pl) | |
23 </pre> | |
24 </div> | |
25 <h2>Parameters</h2> | |
26 <p> | |
27 The following parameters can be set in this method: | |
28 <ul> | |
29 <li> <tt>'kspike'</tt> - set the <IMG src="images/spike42x.png" width="34" height="13" border="0"/> value (default is 3.3) </li> | |
30 <li> <tt>'method'</tt> - method used to replace the "spiky" sample. Three methods are available ---see below for details---:</li> | |
31 <ul> | |
32 <li> <tt>'random'</tt> </li> | |
33 <li> <tt>'mean'</tt> </li> | |
34 <li> <tt>'previous'</tt> </li> | |
35 </ul> | |
36 <li> <tt>'fc'</tt> - frequency cut-off of the high-pass IIR filter (default is 0.025) </li> | |
37 <li> <tt>'order'</tt> - specifies the order of the IIR filter (default is 2) </li> | |
38 <li> <tt>'ripple'</tt> - specifies pass/stop-band ripple for bandpass and bandreject filters (default is 0.5) </li> | |
39 </ul> | |
40 </p> | |
41 <p> | |
42 <h2>Algorithm</h2> | |
43 </p> | |
44 <p> | |
45 <b>Random: </b> this method substitutes the spiky sample by: | |
46 </p> | |
47 <p> | |
48 <br> | |
49 <div align="center"> | |
50 <IMG src="images/spike20x.png" width="197" height="15" align="center" border="0"/> | |
51 </div> | |
52 <br> | |
53 </p> | |
54 <p> | |
55 where <IMG src="images/spike44x.png" width="42" height="14" border="0"/> is a random number of mean zero and standard deviation 1. | |
56 </p> | |
57 <p> | |
58 <b>Mean: </b>this method uses the following equation to replace the spike detected in data. | |
59 </p> | |
60 <br> | |
61 <p> | |
62 <div align="center"> | |
63 <IMG src="images/spike30x.png" width="158" height="29" align="center" border="0"/> | |
64 </div> | |
65 </p> | |
66 <br> | |
67 <p> | |
68 <b>Previous: </b>the spike is substitued by the previous sample, i.e.: | |
69 </p> | |
70 <br> | |
71 <p> | |
72 <div align="center"> | |
73 <IMG src="images/spike40x.png" width="90" height="14" align="center" border="0"/> | |
74 </div> | |
75 </p> | |
76 <br> | |
77 <p> | |
78 <h2>Examples</h2> | |
79 </p> | |
80 <p> | |
81 1. Spike cleaning of a sequence of random data with <tt>kspike = 2</tt>. | |
82 </p> | |
83 <p> | |
84 <div class="fragment"><pre> | |
85 <br> | |
86 x = ao(plist( <span class="string">'waveform'</span>, <span class="string">'noise'</span>, <span class="string">'nsecs'</span>,1e4, <span class="string">'fs'</span>,10)); <span class="comment">% create an AO of random data sampled at 1 Hz.</span> | |
87 pl = plist( <span class="string">'kspike'</span>, 2); <span class="comment">% kspike = 2</span> | |
88 y = spikecleaning(x, pl); <span class="comment">% spike cleaning function applied to the input AO, x</span> | |
89 iplot(x, y) <span class="comment">% plot original and "cleaned" data</span> | |
90 </pre> | |
91 </div> | |
92 </p> | |
93 <p> | |
94 <div align="center"> | |
95 <img src="images/spike1.png" border="1" > | |
96 </div> | |
97 </p> | |
98 <!-- <p> | |
99 2. Example of real data: the first image shows data from the real world prior to | |
100 the application of the spike cleaning tool. It is clear that some spikes are | |
101 present in data and might be convenient to remove them. The second image shows | |
102 the same data after the spike samples supression. | |
103 </p> | |
104 <p> | |
105 <img src="images/stat1x.png" border="1" width="400px"> | |
106 </p> | |
107 <p> | |
108 <img src="images/stat2x.png" border="1" width="400px"> | |
109 </p> | |
110 --> | |
111 | |
112 |