-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmethods.html
More file actions
336 lines (321 loc) · 37 KB
/
methods.html
File metadata and controls
336 lines (321 loc) · 37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Detection methods — wonambi 7.11 documentation</title>
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="shortcut icon" href="../_static/wonambi.ico"/>
<!--[if lt IE 9]>
<script src="../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<script src="../_static/js/theme.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="Analysis console" href="analysis.html" />
<link rel="prev" title="Event detection" href="detect.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home"> wonambi
<img src="../_static/wonambi.png" class="logo" alt="Logo"/>
</a>
<div class="version">
7.11
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../introduction.html">WONAMBI</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#features">Features</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#installation">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#run-it">Run it!</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#documentation">Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#change-log">Change Log</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#requirements">Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#optional-requirements">Optional Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#status">Status</a></li>
<li class="toctree-l2"><a class="reference internal" href="../introduction.html#license">License</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../installation.html#linux-mac-os-x">Linux / Mac OS X</a></li>
<li class="toctree-l2"><a class="reference internal" href="../installation.html#windows">Windows</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../analysis/index.html">Tutorial / Analysis</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../analysis/tutorial.html">Get Started</a></li>
<li class="toctree-l2"><a class="reference internal" href="../analysis/spectrum.html">Frequency Domain</a></li>
<li class="toctree-l2"><a class="reference internal" href="../analysis/plot3d.html">Plot 3D images</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../cmd.html">Command Line</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../cmd.html#wonambi">wonambi</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cmd.html#won-convert">won_convert</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Graphical User Interface</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="open.html">Open Dataset</a></li>
<li class="toctree-l2"><a class="reference internal" href="labels.html">Edit Labels</a></li>
<li class="toctree-l2"><a class="reference internal" href="channels.html">Plot Channels</a></li>
<li class="toctree-l2"><a class="reference internal" href="traces.html">Navigation</a></li>
<li class="toctree-l2"><a class="reference internal" href="notes.html">Annotations</a></li>
<li class="toctree-l2"><a class="reference internal" href="detect.html">Event detection</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Detection methods</a></li>
<li class="toctree-l2"><a class="reference internal" href="analysis.html">Analysis console</a></li>
<li class="toctree-l2"><a class="reference internal" href="screenshot.html">Screenshot</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../api/wonambi.html">Modules, classes, functions</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../api/wonambi.html#subpackages">Subpackages</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api/wonambi.html#submodules">Submodules</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../testing.html">Development</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#prepare-test-environment">Prepare Test Environment</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#get-files">1. Get Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#run-the-tests">2. Run the Tests</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#coverage">3. Coverage</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#documentation">4. Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#release">5. Release</a></li>
<li class="toctree-l2"><a class="reference internal" href="../testing.html#tips-and-tricks">Tips and Tricks</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../changelog.html">Change Log</a><ul>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-7">Version 7</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-6">Version 6</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-5">Version 5</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-4">Version 4</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-3">Version 3</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-2">Version 2</a></li>
<li class="toctree-l2"><a class="reference internal" href="../changelog.html#version-1">Version 1</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../todo.html">TODO</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">wonambi</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html" class="icon icon-home"></a></li>
<li class="breadcrumb-item"><a href="index.html">Graphical User Interface</a></li>
<li class="breadcrumb-item active">Detection methods</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<section id="detection-methods">
<h1>Detection methods<a class="headerlink" href="#detection-methods" title="Permalink to this heading"></a></h1>
<p>The method options in the spindle and slow wave detection dialogs are direct implementations of detection methods reported in the scholarly articles cited below.
These implementations are based on original author code when available.</p>
<p>Original values for the customizable parameters are provided in square brackets [].</p>
<p>Further details on the original methods are provided in italics.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Italicized steps are not automatically implemented in Wonambi’s algorithms.
They are included only for your information.</p>
</div>
<section id="spindle-detection-methods">
<h2>Spindle detection methods<a class="headerlink" href="#spindle-detection-methods" title="Permalink to this heading"></a></h2>
<p><strong>Ferrarelli2007</strong> - <em>Ferrarelli, F. et al. (2007) Am. J. Psychiatry 164, 483-92</em></p>
<ol class="arabic simple">
<li><p><em>Detection is limited to all NREM sleep signal.</em></p></li>
<li><p>Signal is bandpass filtered between <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> with a zero-phase equiripple Chebyshev FIR filter. Authors used a slightly different and less stable Chebyshev Type II IIR filter. The FIR filter is a more stable approximation. With <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> at 11 Hz, <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> at 15 Hz and <code class="docutils literal notranslate"><span class="pre">Roll-off</span></code> at 0.9 Hz, the attenuation is -3 dB at 10.7 Hz and 15.3 Hz.</p></li>
<li><p>The filtered signal is rectified.</p></li>
<li><p>A signal envelope is created from the oscillatory peaks in the rectified signal.</p></li>
<li><p>The detection threshold is set to the mean of the signal envelope x <code class="docutils literal notranslate"><span class="pre">Detection</span> <span class="pre">threshold</span></code> [8].</p></li>
<li><p>For the selection threshold, the signal envelope amplitude values are distributed in a 120-bin histogram, and the amplitude of the highest-count bin x <code class="docutils literal notranslate"><span class="pre">Selection</span> <span class="pre">threshold</span></code> [2] yields the selection threshold.</p></li>
<li><p>Spindles are detected where the signal envelope exceeds the detection threshold, with start and end times where the envelope dips below the selection threshold, before and after the detected peak.</p></li>
<li><p>Spindles are merged if within <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">interval</span></code> [0] s of each other (or overlapping).</p></li>
<li><p>Spindles within <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">duration</span></code> and <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">duration</span></code> are retained.</p></li>
</ol>
<p><strong>Nir2011</strong> - <em>Nir, Y. et al. (2011) Neuron 70, 153-69</em></p>
<ol class="arabic simple">
<li><p><em>The channels with spindle activity in NREM sleep are chosen for further analysis (significant spectral power increases in spindle range as compared with a 1/f model, p ‹ 0.001, paired t-test across 10 s segments.)</em></p></li>
<li><p>The EEG signal is bandpass filtered between <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> Hz and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> Hz with a zero-phase 4th (2x2) order Butterworth filter. Authors specify -3 dB attenuation at 9.2 Hz and 16.8 Hz. To achieve this with a 4th order filter, <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> must be set to 9.2 Hz and 16.8 Hz, respectively.</p></li>
<li><p>Instantaneous amplitude in the sigma frequency is extracted via the Hilbert transform.</p></li>
<li><p>To avoid excessive multiple crossings of thresholds within the same spindle event, instantaneous amplitude is temporally smoothed using a Gaussian kernel of σ = <code class="docutils literal notranslate"><span class="pre">Gaussian</span> <span class="pre">smoothing</span> <span class="pre">sigma</span></code> [0.4] s.</p></li>
<li><p>Events with amplitude greater than mean + <code class="docutils literal notranslate"><span class="pre">Detection</span> <span class="pre">threshold</span></code> [3] SD (computed across all <em>artifact-free NREM sleep</em> epochs) are considered putative spindles and detections within <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">interval</span></code> [1] s of each other are merged.</p></li>
<li><p>A threshold of mean + <code class="docutils literal notranslate"><span class="pre">Selection</span> <span class="pre">threshold</span></code> [1] SD defines start and end times, and events with duration between <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">duration</span></code> [0.5] s and <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">duration</span></code> [2] s are selected for further analysis.</p></li>
<li><p><em>Those channels, in which an increase in spectral power within the detected events was restricted to the spindle-frequency range (10-16 Hz) rather than broadband (unpaired t-test (α=0.001) between maximal spectral power in detected vs. random events), and with at least 1 spindle per min of NREM sleep were chosen for further analysis. This highly conservative procedure of including in the analysis only the channels with high spindle SNR, ensured that local occurrence of spindle events does not arise merely as a result of the lack of spindles or poor spindle SNR in some channels.</em></p></li>
</ol>
<p><strong>Mölle2011</strong> - <em>Mölle, M. et al. (2011) Sleep 34(10), 1411-21</em></p>
<ol class="arabic simple">
<li><p><em>Detection is limited to NREM signal.</em></p></li>
<li><p>Signal is bandpass filtered between <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code>, using a zero-phase equiripple FIR filter. Authors specify -3 dB attenuation at 11.3 and 15.7 Hz (Mölle et al., J Neurosci, 2002). To achieve this, <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> must be set to 12 Hz and 15 Hz, and <code class="docutils literal notranslate"><span class="pre">Roll-off</span></code> to 1.7 Hz.</p></li>
<li><p>The root-mean-square of the signal is taken, with a moving window of size = <code class="docutils literal notranslate"><span class="pre">RMS</span> <span class="pre">window</span> <span class="pre">length</span></code> [0.2] s.</p></li>
<li><p>The resulting RMS signal is smoothed with a moving average of window size = <code class="docutils literal notranslate"><span class="pre">Smoothing</span> <span class="pre">window</span> <span class="pre">length</span></code> [0.2] s.</p></li>
<li><p>The detection threshold is set to the mean of the RMS signal + <code class="docutils literal notranslate"><span class="pre">Detection</span> <span class="pre">threshold</span></code> [1.5] x RMS signal SD.</p></li>
<li><p>Spindles are detected as a continuous rise in the smoothed RMS signal above the detection threshold lasting between <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">duration</span></code> [0.5] s and <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">duration</span></code> [3] s. Spindle start and end times are the threshold crossings.</p></li>
<li><p>Spindles are merged if within <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">interval</span></code> [0] s of each other.</p></li>
</ol>
<p><strong>Wamsley2012</strong> - <em>Wamsley, E. J. et al. (2012) Biol. Psychiatry 71, 154-61</em></p>
<ol class="arabic simple">
<li><p><em>Detection is limited to NREM2 signal, filtered between 0.5-35 Hz.</em></p></li>
<li><p>The <em>artefact-free</em> EEG signal is subjected to a time-frequency transformation using an 8-parameter complex Morlet wavelet with the average of <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> as the frequency, with σ = <code class="docutils literal notranslate"><span class="pre">Wavelet</span> <span class="pre">sigma</span></code> [0.5] s and with window size = <code class="docutils literal notranslate"><span class="pre">Wavelet</span> <span class="pre">window</span> <span class="pre">length</span></code> [1] s.</p></li>
<li><p>The resulting complex-valued time series is squared.</p></li>
<li><p>The imaginary component of the time-series is discarded, and the remaining real-valued time series is squared again.</p></li>
<li><p>The moving average of the real signal is calculated, using a sliding window of size = <code class="docutils literal notranslate"><span class="pre">Smoothing</span> <span class="pre">window</span> <span class="pre">length</span></code> [0.1] s.</p></li>
<li><p>A spindle event is identified whenever this wavelet signal exceeds a threshold, defined as <code class="docutils literal notranslate"><span class="pre">Detection</span> <span class="pre">threshold</span></code> [4.5] times the mean signal amplitude of all artefact-free epochs, between <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">duration</span></code> [0.4] s and <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">duration</span></code> s [no maximum]. In this implementation, threshold crossings define the spindle start and end times, but see next point for the original method.</p></li>
<li><p><em>The duration of each spindle was calculated as the half-height width of wavelet energy within the spindle frequency range.</em></p></li>
<li><p>Spindles are merged if within <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">interval</span></code> [0] s of each other.</p></li>
</ol>
<p><strong>Martin2013</strong> - <em>Martin, N. et al. (2013) Neurobio. Aging 34(2) 468-76</em></p>
<ol class="arabic simple">
<li><p><em>Artefact-free NREM sleep epochs are retained for analysis.</em></p></li>
<li><p>Signal is bandpass-filtered between <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> with a zero-phase equiripple Chebyshev FIR filter. The authors used a slightly different filter, but this implementation is more stable, and with the default lowcut and highcut and a <code class="docutils literal notranslate"><span class="pre">Roll-off</span></code> of 0.4 Hz, -3 dB attenuation is achieved at 11.1 Hz and 14.9 Hz.</p></li>
<li><p>The root-mean-square of the filtered signal is taken for every consecutive window of duration <code class="docutils literal notranslate"><span class="pre">RMS</span> <span class="pre">window</span> <span class="pre">length</span></code> [0.25] s and of step <code class="docutils literal notranslate"><span class="pre">RMS</span> <span class="pre">window</span> <span class="pre">step</span></code> [None] s.</p></li>
<li><p>The detection threshold is set at percentile <code class="docutils literal notranslate"><span class="pre">Detection</span> <span class="pre">threshold</span></code> [95] of the RMS signal.</p></li>
<li><p>Spindles are detected when the RMS signal exceeds the detection threshold for longer than <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">duration</span></code> [0.5] s and shorter than <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">duration</span></code> [3] s.</p></li>
<li><p>Spindles are merged if within <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">interval</span></code> [0] s of each other.</p></li>
</ol>
<p><strong>Ray2015</strong> - <em>Ray, L. B. et al. (2015) Front. Hum. Neurosci. 9-16</em></p>
<ol class="arabic simple">
<li><p>The <em>artefact-free</em> signal is bandpass filtered between 0.3 Hz and 35 Hz, using a zero-phase 8th (4x2) order Butterworth filter.</p></li>
<li><p>Complex demodulation is deployed on the data about the frequency of interest, set by the mean of <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> [11] and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> [16] (Hz).</p></li>
<li><p>The complex demodulated signal is lowpass filtered below 5 Hz, using a zero-phase 8th (4x2) order Butterworth filter.</p></li>
<li><p>The lowpass filtered signal is smoothed using a triangle convolution, with window size set by <code class="docutils literal notranslate"><span class="pre">Smoothing</span> <span class="pre">window</span> <span class="pre">length</span></code> [2 / frequency of interest] (sec).</p></li>
<li><p>The square of the absolute value of the complex, smoothed signal is taken.</p></li>
<li><p>The resulting signal is converted into a z-score signal, with a sliding window set by <code class="docutils literal notranslate"><span class="pre">zscore</span> <span class="pre">window</span> <span class="pre">length</span></code> [60] (sec).</p></li>
<li><p>Spindles are detected where the z-score signal exceeds <code class="docutils literal notranslate"><span class="pre">Detection</span> <span class="pre">threshold</span></code> [2.33].</p></li>
<li><p>Spindle start and end times are defined where the z-score signal surrounding a detected spindle drops below <code class="docutils literal notranslate"><span class="pre">Selection</span> <span class="pre">threshold</span></code> [0.1].</p></li>
<li><p>Spindles separated by less than <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">interval</span></code> [0.25] sec are merged. <em>Instead of merging spindles, authors excluded spindles beginning less than 0.25 s after of a detected spindle.</em></p></li>
<li><p>Spindles within <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">duration</span></code> [0.49] sec and <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">duration</span></code> [None] are retained.</p></li>
</ol>
<p><strong>Lacourse2018</strong> - <em>Lacourse, K. et al. (2018) J Neurosci. Meth.</em></p>
<ol class="arabic simple">
<li><p><em>Artefact-free NREM sleep epochs are retained for analysis.</em></p></li>
<li><p>Signal is bandpass filtered between <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> to create the sigma signal, and between 0.3 Hz and 30 Hz to create the broadband signal.</p></li>
<li><p>All transformations are applied to the windowed signal, with a window duration of <code class="docutils literal notranslate"><span class="pre">Window</span> <span class="pre">length</span></code> [0.3] s and with a step of <code class="docutils literal notranslate"><span class="pre">Window</span> <span class="pre">step</span></code> [0.1] s.</p></li>
<li><p>The absolute sigma power signal is taken as the window average of the squared value of each data sample. The resulting signal is log10-transformed.</p></li>
<li><p>The relative sigma power signal is taken as the ratio of sigma band power to broadband power, log10-transformed and z-score normalized with respect to a 30-s window centered on the current window. In computing the z-score, only values between the 10th and 90th percentile are used to compute the standard deviation.</p></li>
<li><p>The covariance signal is taken as the window average of the sample-wise product of the detrended sigma signal and detrended broadband signal.</p></li>
<li><p>The normalized covariance signal is taken as the covariance signal log10-transformed and z-score normalized with respect to the 30-s window centered on the current window. In computing the z-score, only values between the 10th and 90th percentile are used to compute the standard deviation.</p></li>
<li><p>The correlation signal is taken as the covariance signal divided, window-wise, by the product of the standard deviations of the sigma and broadband signals.</p></li>
<li><p>Spindles are detected when all four of these conditions are met:</p>
<ul class="simple">
<li><p>the absolute sigma power signal exceeds <code class="docutils literal notranslate"><span class="pre">Absolute</span> <span class="pre">power</span> <span class="pre">threshold</span></code> [1.25];</p></li>
<li><p>the relative sigma power signal exceeds <code class="docutils literal notranslate"><span class="pre">Relative</span> <span class="pre">sigma</span> <span class="pre">threshold</span></code> [1.6];</p></li>
<li><p>the normalized covariance signal exceeds <code class="docutils literal notranslate"><span class="pre">Covariance</span> <span class="pre">threshold</span></code> [1.3];</p></li>
<li><p>the correlation signal exceeds <code class="docutils literal notranslate"><span class="pre">Correlation</span> <span class="pre">threshold</span></code> [0.69].</p></li>
</ul>
</li>
<li><p>Spindle start and end times are defined where the normalized covariance and correlation signals surrounding a detected spindle drop below their respective threshold.</p></li>
<li><p>Spindles shorter than <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">duration</span></code> [0.3] s and <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">duration</span></code> [2.5] s are discarded.</p></li>
<li><p>Spindles are merged if within <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">interval</span></code> [0] s of each other.</p></li>
<li><p><em>A context classifier, based on the spectral makeup of the signal surrounding each detected spindle, identifies those spindles likely to be true positives. This step (not implemented) is most useful in the absence of sleep staging.</em></p></li>
</ol>
<p><strong>FASST</strong> - <em>Leclerq, Y. et al. (2011) Compu. Intel. Neurosci. 1-11</em></p>
<ol class="arabic simple">
<li><p>Signal is bandpass filtered between <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> [11] and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> [18] using a zero-phase 8th (4x2) order Butterworth filter.</p></li>
<li><p>The detection threshold is set as the <code class="docutils literal notranslate"><span class="pre">Detection</span> <span class="pre">threshold</span></code> th percentile of the filtered signal. <em>Authors use only N2 signal to set the threshold.</em></p></li>
<li><p>The filtered signal is rectified, yielding the detection signal.</p></li>
<li><p>The detection signal is smoothed with a moving average of window size = <code class="docutils literal notranslate"><span class="pre">Smoothing</span> <span class="pre">window</span> <span class="pre">length</span></code> [0.1].</p></li>
<li><p>Spindles are detected as rises in the detection signal above the detection threshold, lasting between <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">duration</span></code> [0.4] and <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">duration</span></code> [1.3].</p></li>
<li><p>Detected spindles separated by less than <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">interval</span></code> [1] s are merged.</p></li>
<li><p><em>Spindles overlapping across channels are merged.</em></p></li>
</ol>
<p><strong>FASST2</strong> - <em>Leclerq, Y. et al. (2011) Compu. Intel. Neurosci. 1-11</em></p>
<p>This method is identical to FASST, except step 3 is replaced with the following step:</p>
<ol class="arabic simple" start="3">
<li><p>The root-mean-square of the filtered signal is taken, with a moving window of size = <code class="docutils literal notranslate"><span class="pre">RMS</span> <span class="pre">window</span> <span class="pre">length</span></code> [0.1] s, yielding the detection signal.</p></li>
</ol>
<p><strong>UCSD</strong> - <em>University of California, San Diego; unpublished</em></p>
<ol class="arabic simple">
<li><p>The raw EEG signal is subjected to a time-frequency transformation using real wavelets with frequencies from <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> to <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> at 0.5-Hz intervals, with wavelet duration = <code class="docutils literal notranslate"><span class="pre">Wavelet</span> <span class="pre">duration</span></code> [1] s, width = <code class="docutils literal notranslate"><span class="pre">Wavelet</span> <span class="pre">width</span></code> s and smoothing window duration = <code class="docutils literal notranslate"><span class="pre">Smoothing</span> <span class="pre">window</span> <span class="pre">length</span></code>.</p></li>
<li><p>The resulting time-frequency signals are rectified and convolved with a Tukey window of size = 0.5 s, then averaged to produce a single time-frequency signal.</p></li>
<li><p>A threshold is defined as the signal median plus <code class="docutils literal notranslate"><span class="pre">Detection</span> <span class="pre">threshold</span></code> [2] SDs.</p></li>
<li><p>Spindles are detected at each relative maximum in the signal which exceeds the threshold.</p></li>
<li><p>Steps 1-3 are repeated on the raw signal, this time with width = 0.2 s, with Tukey window size = 0.2 s, and with the threshold set at <code class="docutils literal notranslate"><span class="pre">Selection</span> <span class="pre">threshold</span></code> [1] SD.</p></li>
<li><p>Spindle start and end times are defined at threshold crossings.</p></li>
<li><p>Spindles are retained if their duration is between <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">duration</span></code> and <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">duration</span></code>.</p></li>
<li><p>Spindles are merged if within <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">interval</span></code> [0] s of each other.</p></li>
</ol>
<p><strong>Concordia</strong> - <em>Concordia University, Montreal; unpublished</em></p>
<ol class="arabic simple">
<li><p>Signal is bandpass filtered between <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code> with a zero-phase 6th (3x2) order Butterworth filter.</p></li>
<li><p>The root-mean-square of the signal is taken, with a moving window of size = <code class="docutils literal notranslate"><span class="pre">RMs</span> <span class="pre">window</span> <span class="pre">length</span></code> [0.2] s.</p></li>
<li><p>The resulting RMS signal is smoothed with a moving average of window size = <code class="docutils literal notranslate"><span class="pre">Smoothing</span> <span class="pre">window</span> <span class="pre">length</span></code> [0.2] s.</p></li>
<li><p>The low and high detection thresholds are set at the mean of the RMS signal + <code class="docutils literal notranslate"><span class="pre">Detection</span> <span class="pre">threshold</span></code> [1.5] x RMS signal SD, and mean + <code class="docutils literal notranslate"><span class="pre">Detection</span> <span class="pre">threshold</span></code> [10] x SD, respectively.</p></li>
<li><p>RMS rises between the low and high detection thresholds are considered putative spindles, and those located within <code class="docutils literal notranslate"><span class="pre">Tolerance</span></code> [0.2] s are merged.</p></li>
<li><p>A threshold of mean + <code class="docutils literal notranslate"><span class="pre">Selection</span> <span class="pre">threshold</span></code> [1] SD defines start and end times, and events with duration between <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">duration</span></code> [0.5] s and <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">duration</span></code> [2] s are selected for further analysis.</p></li>
<li><p>Spindles are merged if within <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">interval</span></code> [0] s of each other.</p></li>
</ol>
</section>
<section id="slow-wave-detection-methods">
<h2>Slow wave detection methods<a class="headerlink" href="#slow-wave-detection-methods" title="Permalink to this heading"></a></h2>
<p><strong>Massimini2004</strong> - <em>Massimini, M. et al. (2004) J Neurosci 24(31), 6862-70</em></p>
<ol class="arabic simple">
<li><p><em>256-channel EEG is re-referenced to the average of the signals from the earlobes.</em></p></li>
<li><p><em>EEG signal is locally averaged over 4 non-overlapping regions of the scalp.</em></p></li>
<li><p><em>Detection is limited to NREM signal.</em></p></li>
<li><p>The signal is bandpass filtered between <code class="docutils literal notranslate"><span class="pre">Lowcut</span></code> and <code class="docutils literal notranslate"><span class="pre">Highcut</span></code>, using a zero-phase 4th (2x2) order Butterworth filter. Wonambi’s implementation applies the filter sequentially to avoid numerical instability: first lowpass, the highpass.</p></li>
<li><p>Slow waves are detected when the following 3 criteria are met:</p>
<ul class="simple">
<li><p>A positive-to-negative zero crossing and a subsequent negative-to-positive zero crossing separated by <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">trough</span> <span class="pre">duration</span></code> [0.3] and <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">trough</span> <span class="pre">duration</span></code> [1.0] s.</p></li>
<li><p>A negative peak between the two zero crossings with voltage less than <code class="docutils literal notranslate"><span class="pre">Max.</span> <span class="pre">trough</span> <span class="pre">amplitude</span></code> [-80] μV</p></li>
<li><p>A peak-to-peak amplitude greater than <code class="docutils literal notranslate"><span class="pre">Min.</span> <span class="pre">peak-to-peak</span> <span class="pre">amplitude</span></code> [140] μV.</p></li>
</ul>
</li>
</ol>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Not all channels will show slow waves with the same polarity (e.g. F3-M2 and M2-F3 will be inverted).
Furthermore, the typical iEEG channels will show slow waves as positive-then-negative, contrary to surface EEG electrodes.
For these reasons, it is left to the user to set the correct polarity for slow wave detection.
The default polarity is negative-then-positive.
Wonambi displays signals negative-up, so on typical EEG channels, slow waves will be up-then-down.
To switch to positive-then-negative (down-then-up), check the <code class="docutils literal notranslate"><span class="pre">Invert</span> <span class="pre">detection</span></code> box.</p>
</div>
<p><strong>AASM/Massimini2004</strong></p>
<p>This is the same as Massimini2004, except with default values for slow waves as defined by the American Academy of Sleep Medicine (AASM).</p>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="detect.html" class="btn btn-neutral float-left" title="Event detection" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="analysis.html" class="btn btn-neutral float-right" title="Analysis console" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>© Copyright 2013-2022, Gio Piantoni / Jordan O'Byrne.</p>
</div>
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(false);
});
</script>
</body>
</html>