<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://stage.nitrcce.org/themes/nitrc3.0/css/rss.xsl.php?feed=https://stage.nitrcce.org/export/rss20_newreleases.php?group_id=572" ?>
<?xml-stylesheet type="text/css" href="https://stage.nitrcce.org/themes/nitrc3.0/css/rss.css" ?>
<rss version="2.0"> <channel>
  <title>CleanLine Releases</title>
  <link>http://stage.nitrcce.org/project/showfiles.php?group_id=572</link>
  <description>CleanLine Latest Releases</description>
  <language>en-us</language>
  <copyright>Copyright 2000-2026 NITRC OSI</copyright>
  <webMaster>antillipsi@stage.nitrcce.org (Tim Mullen)</webMaster>
  <lastBuildDate>Mon, 20 Apr 2026 10:35:19 GMT</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <image>
    <url>http://stage.nitrcce.org/images/bflogo-88.png</url>
    <title>NITRC Developer</title>
    <link>http://stage.nitrcce.org/</link>
    <width>124</width>
    <heigth>32</heigth>
  </image>
  <item>
   <title>cleanline Cleanline</title>
   <link>http://stage.nitrcce.org/project/showfiles.php?group_id=572&amp;release_id=1859</link>
   <description>&amp;lt;pre class=&amp;quot;plaintext&amp;quot; style=&amp;quot;margin-top: 20px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; border-image: initial; font-size: 12px; font-family: Monaco, 'Courier New', monospace; vertical-align: baseline; line-height: 16px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; white-space: pre-wrap; color: #393939; background-position: 0px 50%; padding: 0px; border: 0px initial initial;&amp;quot;&amp;gt;Welcome to the CleanLine plugin for EEGLAB! &lt;br /&gt;
&lt;br /&gt;
This plugin adaptively estimates and removes sinusoidal (e.g. line) noise from your ICA components&lt;br /&gt;
or scalp channels using multi-tapering and a Thompson F-statistic.&lt;br /&gt;
&lt;br /&gt;
CleanLine is written by Tim Mullen ([url=mailto:tim@sccn.ucsd.edu]tim@sccn.ucsd.edu[/url]) with thanks to Makoto Miyakoshi for beta &lt;br /&gt;
testing. CleanLine makes use of functions modified from the Mitra Lab's Chronux &lt;br /&gt;
Toolbox ([url=http://www.chronux.org/]www.chronux.org[/url]).&lt;br /&gt;
&lt;br /&gt;
CleanLine also makes use of the arg() functionality from Christian Kothe's BCILAB toolbox &lt;br /&gt;
(sccn.ucsd.edu/wiki/BCILAB)&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
INSTALLATION INSTRUCTIONS&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Installation of CleanLine is simple:&lt;br /&gt;
&lt;br /&gt;
1) download CleanLine (if you are reading this, you have probably already completed this step)&lt;br /&gt;
2) Unzip the package and copy to /plugins/. Start eeglab from the Matlab command line.&lt;br /&gt;
   Alternately, you may add CleanLine (with subfolders) to your path and ensure EEGLAB is present &lt;br /&gt;
   in the path.&lt;br /&gt;
3) If using the EEGLAB GUI you may start CleanLine from Tools--&amp;gt;CleanLine.&lt;br /&gt;
   Alternately, you can start CleanLine from the command line&lt;br /&gt;
   &amp;gt;&amp;gt; EEGclean = pop_cleanline(EEG);&lt;br /&gt;
   See &amp;quot;Command-line example&amp;quot; section below for command-line example and other parameters&lt;br /&gt;
4) For Help, see Readme.txt or type &lt;br /&gt;
   &amp;gt;&amp;gt; doc cleanline&lt;br /&gt;
   Or, hold mouse over any textbox, checkbox, etc in the GUI for tooltip help text.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
THEORY&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Sinusoidal noise can be a prominent artifact in recorded electrophysiological data. This can stem &lt;br /&gt;
from AC power line fluctuations (e.g. 50/60 Hz line noise + harmonics), power suppliers (e.g. in &lt;br /&gt;
medical equipment), fluorescent lights, etc. Notch filtering is generally undesirable due to &lt;br /&gt;
creation of band-holes, and significant distortion of frequencies around the notch frequency (as well &lt;br /&gt;
as phase distortion at other frequencies and Gibbs rippling in the time-domain). Other approaches for&lt;br /&gt;
sinusoidal (&amp;quot;line&amp;quot;) noise reduction include adaptive regressive filtering approaches (e.g. RLS, LMS),&lt;br /&gt;
but these typically require a reference signal (e.g. externally-recorded noise reference), which is &lt;br /&gt;
often unavailable. Blind-source separation approaches such as ICA may help mitigate line noise, but  &lt;br /&gt;
often fail to completely remove the noise due to spatiotemporal non-stationarities in the  noise. &lt;br /&gt;
&lt;br /&gt;
CleanLine uses an approach for line noise removal advocated by Partha Mitra and Hemant Bokil in &lt;br /&gt;
&amp;quot;Observed Brain Dynamics&amp;quot; (2007), Chapter 7.3.4. &lt;br /&gt;
&lt;br /&gt;
In brief, the data is traversed by a sliding window. Within each window, the signal is transformed to &lt;br /&gt;
the frequency domain using a multi-taper FFT. The complex amplitude (amplitude and phase) is thus&lt;br /&gt;
obtained for each frequency. Under the assumption of a deterministic sinusoid embedded in white &lt;br /&gt;
noise, we can set up a regression of the multi-taper transform (spectrum) of this sinusoidal signal &lt;br /&gt;
onto the multitaper spectrum of the original data at a given frequency. The regression coefficient &lt;br /&gt;
is a complex number representing the complex amplitude (phase and amplitude) of the deterministic &lt;br /&gt;
sinusoid. From this, a time-domain representation of the sinusoid may be constructed and subtracted &lt;br /&gt;
from the data to remove the line.&lt;br /&gt;
&lt;br /&gt;
Typically, one does not know the exact line frequency. For instance, in the U.S.A., power line noise &lt;br /&gt;
is not guaranteed to be at exactly 60 Hz (or even to have constant phase over a given period of time).&lt;br /&gt;
To ameliorate this problem a Thompson F-Test may be applied to determine the statistical significance&lt;br /&gt;
of a non-zero coefficient in the above regression (indicating a sinusoid with significantly non-zero &lt;br /&gt;
amplitude). We can then search within a narrow band around the expected location of the line for the &lt;br /&gt;
frequency which maximizes this F-statistic above a significance threshold (e.g. p=0.05).&lt;br /&gt;
&lt;br /&gt;
Line frequency scanning can be enabled/disabled using the 'ScanForLines' option.&lt;br /&gt;
&lt;br /&gt;
Overlapping short (e.g. 2-4 second) windows can be used to adaptively estimate the frequency, phase,&lt;br /&gt;
and amplitude of the sinusoidal noise components (which typically change over the course of a recording &lt;br /&gt;
session). The discontinuity at the point of window overlap can be smoothed using a sigmoidal function.&amp;lt;/pre&amp;gt;&amp;lt;pre class=&amp;quot;plaintext&amp;quot; style=&amp;quot;margin-top: 20px; margin-right: 0px; margin-bottom: 20px; margin-left: 0px; border-image: initial; font-size: 12px; font-family: Monaco, 'Courier New', monospace; vertical-align: baseline; line-height: 16px; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; white-space: pre-wrap; color: #393939; background-position: 0px 50%; padding: 0px; border: 0px initial initial;&amp;quot;&amp;gt;The smoothing factor is determined by the 'SmoothingFactor' parameter in cleanline().&lt;br /&gt;
&lt;br /&gt;
CleanLine allows you to specify the multi-taper frequency resolution by the 'Bandwidth' parameter. &lt;br /&gt;
This is the width of a peak in the spectrum for a sinusoid at given frequency. Due to the time-frequency &lt;br /&gt;
uncertainty principle, decreasing bandwidth increases the necessary length of the sliding window in &lt;br /&gt;
order to obtain a reasonable frequency decomposition. The number of tapers, K, used by CleanLine is &lt;br /&gt;
given by K=2TW-1 where T is the temporal resolution in seconds (window length) and W is the frequency &lt;br /&gt;
resolution (Bandwidth) in Hz. CleanLine fixes T to be the sliding window length, so W (Bandwidth) is the&lt;br /&gt;
only required parameter. If the 'Verbosity' option is set to 1, then CleanLine will display the multi-taper&lt;br /&gt;
parameters in the command line on execution of the function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
TIPS ON RUNNING CLEANLINE&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
The default options should work quite well, but parameters may need to be tweaked depending on the setup. &lt;br /&gt;
If you have multiple epochs you need to make sure that your window size and step size exactly divides the &lt;br /&gt;
epoch length. In other words, you do not want any sliding windows to overlap two epochs since line noise &lt;br /&gt;
phase and amplitude may shift at that point, making it impossible to perform the time-domain line subtraction.&lt;br /&gt;
If you have relatively short epochs (e.g. &amp;lt; 5 sec) it is best if each window is taken to be the length&lt;br /&gt;
of the epoch and the step size is equal to the window length. In this way, the lines are estimated and &lt;br /&gt;
removed for each epoch individually. When using the GUI, the default values for window length and step size&lt;br /&gt;
are automatically set to the epoch length.&lt;br /&gt;
&lt;br /&gt;
If cleaning continuous, un-epoched data, then you may wish to use sliding windows of 3-4 seconds with 50% &lt;br /&gt;
overlap.&lt;br /&gt;
&lt;br /&gt;
If using the EEGLAB GUI, commands are stored in EEG.history so that the eegh() command will return the &lt;br /&gt;
command-line function call corresponding to the last GUI execution of CleanLine.&lt;br /&gt;
&lt;br /&gt;
You might find it useful to try the option ('PlotFigures',true) on a subset of channels/components to get a&lt;br /&gt;
sense of the performance of CleanLine for difference parameter choices (and also to identify where the most&lt;br /&gt;
significant lines lie in the spectrum) and then, once you are satisfied with the parameters, turn this option&lt;br /&gt;
off before cleaning all the remaining channels/components. NOTE: CleanLine is *considerably slower* if PlotFigures &lt;br /&gt;
is enabled. If you don't care to see the visualize the final results of the cleaning operation, you may also&lt;br /&gt;
wish to set ('ComputeSpectralPower',false) which will speed up computation considerably.&lt;br /&gt;
&amp;lt;/pre&amp;gt;</description>
   <author>antillipsi@stage.nitrcce.org (Tim Mullen)</author>
   <comment>http://stage.nitrcce.org/project/shownotes.php?group_id=572&amp;release_id=1859</comment>
   <pubDate>Thu, 09 Feb 2012 6:37:00 GMT</pubDate>
   <guid>http://stage.nitrcce.org/project/showfiles.php?group_id=572&amp;release_id=1859</guid>
  </item>
 </channel>
</rss>
