<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:766846993;
mso-list-type:hybrid;
mso-list-template-ids:-1499700844 -1 67895299 67895301 67895297 67895299 67895301 67895297 67895299 67895301;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l1
{mso-list-id:836071914;
mso-list-type:hybrid;
mso-list-template-ids:454315896 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l1:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l1:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l1:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l1:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l1:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l1:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l1:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l2
{mso-list-id:1598100855;
mso-list-type:hybrid;
mso-list-template-ids:937043366 -1 67895321 67895323 67895311 67895321 67895323 67895311 67895321 67895323;}
@list l2:level1
{mso-level-text:"\(%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l2:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l2:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l2:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l2:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l2:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l2:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l2:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;}
@list l2:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l3
{mso-list-id:1912690978;
mso-list-type:hybrid;
mso-list-template-ids:1961540754 -1 67895299 67895301 67895297 67895299 67895301 67895297 67895299 67895301;}
@list l3:level1
{mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-font-family:"Times New Roman";}
@list l3:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l3:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l3:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l3:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l3:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l3:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l3:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l3:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l4
{mso-list-id:2079589643;
mso-list-type:hybrid;
mso-list-template-ids:914231948 1357007780 851625558 1915903146 977287148 -774235460 -177426010 -1325492218 -1520923474 1564909306;}
@list l4:level1
{mso-level-number-format:bullet;
mso-level-text:\F0F0;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";}
@list l4:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l4:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l4:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l4:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l4:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l4:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l4:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l4:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:836071914;
mso-list-type:hybrid;
mso-list-template-ids:454315896 67698705 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-text:"%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l1
{mso-list-id:1205681528;
mso-list-template-ids:-1184044856;}
@list l1:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level2
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:1.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:1.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:2.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level5
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:2.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:3.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:3.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level8
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:4.0in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l1:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:4.5in;
mso-level-number-position:left;
text-indent:-.25in;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
@list l2
{mso-list-id:1598100855;
mso-list-type:hybrid;
mso-list-template-ids:937043366 -1 67895321 67895323 67895311 67895321 67895323 67895311 67895321 67895323;}
@list l2:level1
{mso-level-text:"\(%1\)";
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l2:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l2:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l2:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l2:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l2:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l2:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l2:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l2:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l3
{mso-list-id:2079589643;
mso-list-type:hybrid;
mso-list-template-ids:914231948 1357007780 851625558 1915903146 977287148 -774235460 -177426010 -1325492218 -1520923474 1564909306;}
@list l3:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;
mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:"Times New Roman";}
@list l3:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l3:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l3:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l3:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l3:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l3:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l3:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l3:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Dear Stephen, </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for your comments. </p><p class=MsoNormal>In fact I only used the cgf1, cfg2.. for plotting the figure I sent you. So it was not my « real » code.</p><p class=MsoNormal>But you’re rigth cleaning the cfg will prevent some errors.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’ve done so and still have some errors : (for each case, I compared it to a personnal calculation)</p><ul style='margin-top:0cm' type=disc><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo5'>If I use the ‘all’ default cfg.baselinewindow => I have the result I expected : the Baseline is the mean value of all the signal. (cf. figure Baseline_AllSignal)</li><li class=MsoListParagraph style='margin-left:0cm;mso-list:l0 level1 lfo5'>If I use a given time window (here from 0.1 to 0 sec before the stimulsu onset) => in fieldtrip, the Baseline is only the « first point » of the raw signal, but not its mean value on the Baseline window (as in my own calculation : cf. figure Baseline_TimeWindow). I also tried with exorbitant window [-10000 0], [0 0.1], etc ) and each time I Always have the exact same result for the filedtrip calculation.</li></ul><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Here is my entire code (I hope it will be clearer): </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>**************************************************************</p><p class=MsoNormal>seg_window=[0.1 1]; % in seconds %preStim/postStim</p><p class=MsoNormal>trig_Type=[1 5 2 6 3 7 4 8]; % trigger value</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>load(filename_Trig);</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% ** READ FILE INFO </p><p class=MsoNormal>% read the header information and the events from the data</p><p class=MsoNormal>hdr = ft_read_header(filename_Data);</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% Config</p><p class=MsoNormal>cfg= [];</p><p class=MsoNormal>cfg.dataset = filename_Data;</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% **RE-REFERENCES </p><p class=MsoNormal>cfg.reref = 'yes';</p><p class=MsoNormal>cfg.refchannel = {'EXG3', 'EXG4'} ; % electrode 131/132 // cell-array with new EEG reference channel(s), this can be 'all' for a common average reference </p><p class=MsoNormal>cfg.refmethod = 'avg'; % 'avg', 'median', or 'bipolar' for bipolar derivation of sequential channels (default = 'avg') </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% ** TRIAL DEFINITION </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>event_All = ft_read_event(filename_Data);</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% Select only the trigger codes, not the battery and CMS status</p><p class=MsoNormal>sel = find(strcmp({event_All.type}, 'STATUS'));</p><p class=MsoNormal>event_All = event_All(sel);</p><p class=MsoNormal>cfg.eventType=[trig_Type(1) trig_Type(2)];</p><p class=MsoNormal>cfg.trialfun = 'AVExp_trialfun';</p><p class=MsoNormal>cfg.trialdef.pre = seg_window(1);</p><p class=MsoNormal>cfg.trialdef.post = seg_window(2);</p><p class=MsoNormal>cfg.Fs=hdr.Fs; % convert seconds in sample</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>cfg = ft_definetrial(cfg);</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% Remove trials from Cartool selection</p><p class=MsoNormal>cfg.trl(find(Triggers{num_Cond}(:,1)==0),:) = []; </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>data_Raw = ft_preprocessing(cfg);</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% Plot data to check</p><p class=MsoNormal>figure ; chan_num=1;</p><p class=MsoNormal>trial_num=1;</p><p class=MsoNormal>figure;</p><p class=MsoNormal>plot(data_Raw.trial{trial_num}(chan_num,:));</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% ** BASELINE CORRECTION : BASELINE IS ALL THE SIGNAL</p><p class=MsoNormal>%baseline correct the raw data structure, automatic</p><p class=MsoNormal>cfg = [] ;</p><p class=MsoNormal>cfg.demean = 'yes';</p><p class=MsoNormal>cfg.baselinewindow = 'all'; </p><p class=MsoNormal>data_Raw_reref = ft_preprocessing(cfg, data_Raw);</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% Manual correction test </p><p class=MsoNormal>for trial_num=1:length(data_Raw.trial)</p><p class=MsoNormal> for chan_num=1:length(data_Raw.label)</p><p class=MsoNormal> Signal=data_Raw.trial{trial_num}(chan_num,:);</p><p class=MsoNormal> baseline_value=mean(Signal); % for comparison with the default value of</p><p class=MsoNormal> data_Raw_reref_Manual.trial{trial_num}(chan_num,:)=data_Raw.trial{trial_num}(chan_num,:)-baseline_value*ones(1,length(Signal));</p><p class=MsoNormal> end</p><p class=MsoNormal>end</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% plot comparison</p><p class=MsoNormal>figure;chan_num=1;</p><p class=MsoNormal>trial_num=1;</p><p class=MsoNormal>hold all</p><p class=MsoNormal>plot(data_Raw_reref.trial{trial_num}(chan_num,:));</p><p class=MsoNormal>plot(data_Raw_reref_Manual.trial{trial_num}(chan_num,:));</p><p class=MsoNormal>legend('FieldTrip','Manual');</p><p class=MsoNormal>title('Baseline is all the signal');</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% ** BASELINE CORRECTION : BASELINE IS THE MEAN VALUE OF A WINDOW of 0.1sec before the stimulus onset</p><p class=MsoNormal>%baseline correct the raw data structure, automatic</p><p class=MsoNormal>cfg = [] ;</p><p class=MsoNormal>cfg.demean = 'yes';</p><p class=MsoNormal>cfg.baselinewindow = [-0.1 0] ; %as the baseline lasts 0.1 s before the stimulus onset</p><p class=MsoNormal>data_Raw_reref_1 = ft_preprocessing(cfg, data_Raw);</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% Manual correction test for trial 1 - comparison to automatic calculation</p><p class=MsoNormal>for trial_num=1:length(data_Raw.trial)</p><p class=MsoNormal> for chan_num=1:length(data_Raw.label)</p><p class=MsoNormal> Signal=data_Raw.trial{trial_num}(chan_num,:);</p><p class=MsoNormal> baseline_window=[1 round(hdr.Fs*0.1)];% because baseline lasts 0.1 s before the stimulus onset</p><p class=MsoNormal> baseline_value=mean(Signal(baseline_window(1):baseline_window(2)));</p><p class=MsoNormal> data_Raw_reref_Manual_1.trial{trial_num}(chan_num,:)=data_Raw.trial{trial_num}(chan_num,:)-baseline_value*ones(1,length(Signal));</p><p class=MsoNormal> end</p><p class=MsoNormal>end</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>% plot comparison</p><p class=MsoNormal>figure;chan_num=1;</p><p class=MsoNormal>trial_num=1;</p><p class=MsoNormal>hold all</p><p class=MsoNormal>plot(data_Raw_reref_1.trial{trial_num}(chan_num,:));</p><p class=MsoNormal>plot(data_Raw_reref_Manual_1.trial{trial_num}(chan_num,:));</p><p class=MsoNormal>legend('FieldTrip','Manual');</p><p class=MsoNormal>title('Baseline is a given time window’);</p><p class=MsoNormal>**************************************************************<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m sure it’s a silly mistake, but I really can’t find it.</p><p class=MsoNormal>Thanks</p><p class=MsoNormal>Marion</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><b><span style='color:#2F5597'>Marion VINCENT</span></b><span style='color:black'><br>Eng., PhD , CNRS Research Engineer<br><b>Tel</b>: +33 607 59 46 76<br><br>Laboratoire SCALab UMR CNRS 9193<br>Université Lille 3<br>BP 60149<br>59653 Villeneuve d'Ascq Cedex<br><i>http://scalab.cnrs.fr</i><br>--------------------------------------------<br>L’Imaginarium / SCV-IrDIVE Equipex<br>99a Boulevard Descat<br>59200 Tourcoing<br><i>http://www.irdive.fr</i>/</span><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal style='border:none;padding:0cm'><b>De : </b><a href="mailto:stephen.whitmarsh@gmail.com">Stephen Whitmarsh</a><br><b>Envoyé le :</b>jeudi 17 janvier 2019 15:03<br><b>À : </b><a href="mailto:fieldtrip@science.ru.nl">'FieldTrip discussion list'</a><br><b>Objet :</b>Re: [FieldTrip] Baseline removal errors in trials preprocessing</p></div><p class=MsoNormal><o:p> </o:p></p></div><br /><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>Dear Marion,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>Your script is a bit messy. I would start with:<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo6'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>1)<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span style='color:#1F497D'>Always clear your cfg before calling a FT function. Don’t go around saving different cfg’s. This is the nr. 1 cause of confusing results </span><span style='font-family:Wingdings;color:#1F497D'>J</span><span style='color:#1F497D'><o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo6'><![if !supportLists]><span style='color:#1F497D'><span style='mso-list:Ignore'>2)<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span style='color:#1F497D'>Load/segment etc. your data first with ft_preprocessing. Then call ft_preprocessing again to baseline correct, entering the output of the first run.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>I have a hunch that might fix your problem. So, something like:<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>% load your data, apply rereferencing and segment in one go<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg = [];<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg.dataset = filename_Data;<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg.reref = 'yes';<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg.refchannel = {'EXG3', 'EXG4'} ; <o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg.refmethod = 'avg';<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg.trl = … ;<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg = ft_definetrial(cfg);<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>data_Raw = ft_preprocessing(cfg);<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>% somehow plot your data to check<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>figure ; plot(data_Raw.trial{1}(1, :)) ; <o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>% baseline correct your raw data structure, method 1<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg = [] ;<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg.demean = ‘yes’ ;<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg.baselinewindow = [0 0.1] ;<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>data_Raw_reref_1 = ft_preprocessing(cfg, data_Raw);<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>% somehow plot your data to check<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>figure ; plot(data_Raw_reref_1.trial{1}(1, :)) ; <o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>% baseline correct your raw data structure, method 2<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg = [] ;<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg.demean = ‘yes’ ;<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>cfg.baselinewindow = [-1 -0.1] ; % or whatever<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>data_Raw_reref_2 = ft_preprocessing(cfg, data_Raw);<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>% somehow plot your data to check<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='font-family:Consolas'>figure ; plot(data_Raw_reref_2.trial{1}(1, :)) ; <o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:Consolas;color:#1F497D'>And oh, wait, I see what you did there… Don’t use different variables for your cfg, (e.g. cfg1, cfg2, etc.). See the mistake? Those are too easy to make if you don’t do something like the above.<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:Consolas;color:#1F497D'>Cheers and good FieldTripping!<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas;color:#1F497D'>Stepen<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:Consolas;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-family:Consolas;color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b>From:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> <b>On Behalf Of </b>Marion Vincent<br><b>Sent:</b> Thursday, January 17, 2019 2:00 PM<br><b>To:</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br><b>Subject:</b> Re: [FieldTrip] Baseline removal errors in trials preprocessing<o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span lang=FR>Dear Stephen, <o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>Here is my script : <o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>%segmentation<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>seg_window=[0.1 1]; % in seconds %preStim/postStim<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>%config<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg= [];<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg.dataset = filename_Data;<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>%% *********** TRIAL DEFINITION PART *********** (that works )<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>[…]<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg = ft_definetrial(cfg);<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>% *********** Re-References *********** (that also works )<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg.reref = 'yes';<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg.refchannel = {'EXG3', 'EXG4'};% electrode 131/132 // cell-array with new EEG reference channel(s), this can be 'all' for a common average reference<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg.refmethod = 'avg'; % 'avg', 'median', or 'bipolar' for bipolar derivation of sequential channels (default = 'avg') <o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>data_Raw = ft_preprocessing(cfg);<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>%% *********** Baseline ***********<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg.demean = 'yes';<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>cfg1=cfg;<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg1.baselinewindow = [-seg_window(1) 0 ];<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg2=cfg;<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg2.baselinewindow = [0 0.1];<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg3=cfg;<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>cfg3.baselinewindow = 'all';<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>data1 = ft_preprocessing(cfg1);<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>data2 = ft_preprocessing(cfg2);<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>data3 = ft_preprocessing(cfg3);<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l3 level1 lfo3'><![if !supportLists]><span lang=FR style='font-family:Wingdings'><span style='mso-list:Ignore'>ð<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=FR>I’ve attached the figure with the results.<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>PS : In fact I made a mistake in my previous email : the result wasn’t the same when the Baseline window was ‘all’.<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>Let me know if you need more informations. <o:p></o:p></span></p><p class=MsoNormal><span lang=FR>Thanks for your help.<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>Marion<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><b><span lang=FR style='color:#2F5597'>Marion VINCENT</span></b><span lang=FR style='color:black'><br>Eng., PhD , CNRS Research Engineer<br><b>Tel</b>: +33 607 59 46 76<br><br>Laboratoire SCALab UMR CNRS 9193<br>Université Lille 3<br>BP 60149<br>59653 Villeneuve d'Ascq Cedex<br><i><a href="http://scalab.cnrs.fr">http://scalab.cnrs.fr</a></i><br>--------------------------------------------<br>L’Imaginarium / SCV-IrDIVE Equipex<br>99a Boulevard Descat<br>59200 Tourcoing<br><i><a href="http://www.irdive.fr/">http://www.irdive.fr<span style='font-style:normal'>/</span></a></i></span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span lang=FR>De : </span></b><span lang=FR><a href="mailto:stephen.whitmarsh@gmail.com">Stephen Whitmarsh</a><br><b>Envoyé le :</b>jeudi 17 janvier 2019 11:51<br><b>À : </b><a href="mailto:fieldtrip@science.ru.nl">'FieldTrip discussion list'</a><br><b>Objet :</b>Re: [FieldTrip] Baseline removal errors in trials preprocessing<o:p></o:p></span></p></div><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR style='font-size:12.0pt;font-family:"Times New Roman",serif'><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR style='color:#1F497D'>Dear Marion,<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR style='color:#1F497D'>It sounds it might indeed be something as simple as a typo. Could you paste the part of your script – from baseline removal to plotting (where you don’t see a difference) - so we can take a look?<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR style='color:#1F497D'>Cheers,<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='color:#1F497D'>Stephen<o:p></o:p></span></p><p class=MsoNormal><span lang=FR style='color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span lang=FR>From:</span></b><span lang=FR> fieldtrip <<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a>> <b>On Behalf Of </b>Marion Vincent<br><b>Sent:</b> Thursday, January 17, 2019 10:37 AM<br><b>To:</b> <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br><b>Subject:</b> [FieldTrip] Baseline removal errors in trials preprocessing<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>Dear FIeldtrip users, <o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>I’m new in using Fieldtrip for EEG processing and I’ve encountred some issues while removing the Baseline of my trials. <o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>I’m working on EEG signals recorded with the BioSemi system. My pre-processing method is : <o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l2 level1 lfo5'><![if !supportLists]><span lang=FR><span style='mso-list:Ignore'>(1)<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=FR>Re-referecing the channels (necessary with BioSemi)<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l2 level1 lfo5'><![if !supportLists]><span lang=FR><span style='mso-list:Ignore'>(2)<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=FR>Trial definition<o:p></o:p></span></p><p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l2 level1 lfo5'><![if !supportLists]><span lang=FR><span style='mso-list:Ignore'>(3)<span style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]><span lang=FR>Baseline removal<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>I’ve read on the documentation that ft_preprocessing xcan have several cfg parameter for the Baseline removal :<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>% cfg.demean = 'yes';%'no' or 'yes', whether to apply baseline correction (default = 'no')<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>% cfg.baselinewindow = 'all';%[begin end] ;%in seconds, the default is the complete trial (default = 'all')<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>% cfg.detrend = 'no'; %'no' or 'yes', remove linear trend from the data (done per trial) (default = 'no')<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>I wanted to remove a Baseline defined as the average of a given window preceeding my stimulus onset. <o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>I tried to use : cfg.baselinewindow = [-0.5 0 ]; cfg.baselinewindow = [0 0.1] or the default window .<o:p></o:p></span></p><p class=MsoNormal><span lang=FR>But the problem is that I always have the same result, no matter the window I use : the first point of my trial is put to zero and substracted to all my trial. <o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>I’m sure I’m doing something wrong (and that the answer is very simple), but I can’t manage to understand what is the issue.<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>Do you have any advice ?<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal><span lang=FR>Thanks ! <o:p></o:p></span></p><p class=MsoNormal><span lang=FR>Marion<o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p><p class=MsoNormal style='margin-bottom:12.0pt'><b><span lang=FR style='color:#2F5597'>Marion VINCENT</span></b><span lang=FR style='color:black'><br>Eng., PhD , CNRS Research Engineer</span><span lang=FR><o:p></o:p></span></p><p class=MsoNormal><span lang=FR><o:p> </o:p></span></p></div></body></html></body>