<div dir="ltr">Dear Ernesto,<div><br></div><div>> the channel chosen as a reference will be measured against Ground<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">If that's the case, why don't you exclude it from average reference. You can use whatever interpolation method afterwords. Again, I recommend you check Nima's PREP.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Makoto</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 1:33 AM, Ernesto Gonzalez Trejo <span dir="ltr"><<a href="mailto:gonzalez@snn-unit.de" target="_blank">gonzalez@snn-unit.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Dear Makoto,<br>
<br>
thanks again for your answer. Still:<br>
<span class=""><br>
> If you have reference channel in your data, the recorded signal is (ref chan)<br>
> - (ref chan) = 0, so it should be flat. You want to remove this flat channel,<br>
> of course.<br>
<br>
</span>As i mentioned on the previous emails, the reference channel in the recorded<br>
signal is NOT zero, due to the manufacturer (g.tec) settings (since there are no<br>
dedicated reference electrodes, the channel chosen as a reference will be<br>
measured against Ground and not against itself, in order not to lose the<br>
channel).  That's why i was not sure if this channel should be used within the<br>
averaging or if EEGLAB ignores it for the calculation of AR.<br>
<br>
It seems then, that EEGLAB ignores the reference channel (since theoretically<br>
should be 0) so from now on i will remove it pre-AR, and afterwards i will write<br>
the inverted mean of all electrodes into the reference channel (as it should be<br>
(ref chan-ref chan)-(average of all channels)).<br>
<br>
Thanks,<br>
<br>
Ernesto<br>
<span class="im"><br>
<br>
<br>
<br>
> On December 2, 2015 at 7:19 PM Makoto Miyakoshi <<a href="mailto:mmiyakoshi@ucsd.edu">mmiyakoshi@ucsd.edu</a>> wrote:<br>
><br>
> Dear Ernesto,<br>
><br>
</span><span class="im">> > Should I remove the reference channel from my data (select><br>
</span><span class="im">> If you have reference channel in your data, the recorded signal is (ref chan)<br>
> - (ref chan) = 0, so it should be flat. You want to remove this flat channel,<br>
> of course.<br>
><br>
> After average referencing, you may want to discard *any* one channel to make<br>
> the data full-ranked.<br>
><br>
> Makoto<br>
><br>
> On Wed, Dec 2, 2015 at 3:11 AM, Ernesto Gonzalez Trejo <<a href="mailto:gonzalez@snn-unit.de">gonzalez@snn-unit.de</a>><br>
> wrote:<br>
><br>
> > Dear Makoto,<br>
> ><br>
> >  thank you for your answer.<br>
> ><br>
> >  There is no problem when importing the data and setting Cz (ch 30) as<br>
> > reference<br>
> >  when i set the channel locations. But i don't know if it is valid for<br>
> > EEGLAB if<br>
> >  i assign one of my existing 128 channels as reference (by edit->channel<br>
> >  locations->set reference-> Channel Indices 1:128, Reference Cz).  There is<br>
> > no<br>
> >  exclusive reference channel appended at the end. Is this refrence<br>
> > assignment<br>
> >  only a label? does it matter when computing the average reference?<br>
> ><br>
> >  I can "synthesize" my question as follows: Should I remove the reference<br>
> > channel<br>
> >  from my data (select><br>
> ><br>
</span><div class=""><div class="h5">> > > On December 1, 2015 at 9:17 PM Makoto Miyakoshi <<a href="mailto:mmiyakoshi@ucsd.edu">mmiyakoshi@ucsd.edu</a>><br>
> > > wrote:<br>
> > ><br>
> > > Dear Ernesto,<br>
> > > > i have a brief question<br>
> > ><br>
> > > I thought it was quite long, which is why I did not understand the<br>
> > > question.Let me start from here: What's the problem of importing the data<br>
> > > and<br>
> > > apply average reference?<br>
> > > REST is a good solution but I've never been used it myself. Does REST has<br>
> > > Matlab code? If it's available I'd love to try it out.<br>
> > > Another approach is Nima Bigdely-Shamlo's PREP. It'll do conscientious<br>
> > > channel<br>
> > > cleaning before average<br>
> > > referencing.<a href="http://journal.frontiersin.org/article/10.3389/fninf.2015.00016/abstract" rel="noreferrer" target="_blank">http://journal.frontiersin.org/article/10.3389/fninf.2015.00016/abstract</a><br>
> ><br>
> > > Makoto<br>
> > > On Thu, Nov 26, 2015 at 7:14 AM, Ernesto Gonzalez Trejo<br>
> > > <<a href="mailto:gonzalez@snn-unit.de">gonzalez@snn-unit.de</a>><br>
> > > wrote:<br>
> > > > Hi everyone,<br>
> > > ><br>
> > > > i have a brief question regarding a correct average referencing in<br>
> > > > EEGLAB,<br>
> > > > that until now i've been unable to solve. I've read the EEGLAB tutorial<br>
> > > > and<br>
> > > > also searched for some answers in the EEGLAB list but until now i didn't<br>
> > > > find one that helps me solve the problem.<br>
> > > ><br>
> > > > I am doing EEG measurements with 128 Channels, using the channel in the<br>
> > > > position Cz as reference(ch. 30 in my cap). During the acquisition, the<br>
> > > > amplifier properties have Cz set as reference for all electrodes, and <br>
> > > > the<br>
> > > > Cz electrode is then measured then against the ground. Additionally, two<br>
> > > > more channels (63-64) are on the earlobes and are usually discarded<br>
> > > > since<br>
> > > > i'm not using them as reference or for data analysis.<br>
> > > ><br>
> > > > Given the nature of the measurement I consider the average reference the<br>
> > > > way<br>
> > > > to go in order to represent better the brain activity.<br>
> > > ><br>
> > > > The acquisition is done through SIMULINK and saved into a MAT file, for<br>
> > > > post-processing in MATLAB. (The output is a 128xL matrix, where L is the<br>
> > > > length of the measurement in samples).<br>
> > > ><br>
> > > > The problem i have is that i can't seem to indicate correctly to EEGLAB<br>
> > > > that<br>
> > > > the reference used in my measurement is also part of the channels. When<br>
> > > > i<br>
> > > > import the mat file, i cannot give explicitely the channel (as stated on<br>
> > > > the<br>
> > > > import window's help:<br>
> > > ><br>
> > > > "Ref. channel indices or mode" - [edit box] current reference. This edit<br>
> > > > box<br>
> > > >  cannot be edited. To change data reference, use menu<br>
> > > >  Tools > Re-reference calling function pop_reref(). The reference<br>
> > > >  can be a string, 'common' indicating an unknow common reference,<br>
> > > >  'averef' indicating average reference, or an array of integer<br>
> > > >  containing the indices of the reference channels."<br>
> > > ><br>
> > > > Then, after I import the data without a reference, I select the channel<br>
> > > > locations (using a self-made loc file for the cap i use). Here, each one<br>
> > > > of<br>
> > > > the 128 channels has a label (10-10 system names for electrodes 1-64 and<br>
> > > > just the electrode number for 65-128). Once loaded, i click on "Set<br>
> > > > Reference" and write 1:128 as channel indices and Cz as "Reference".<br>
> > > > (Channel 30 has the label Cz and was the reference in the measurement).<br>
> > > > After the locations are set, i remove channels 63 and 64, since i don't<br>
> > > > want<br>
> > > > to use them for AR.<br>
> > > ><br>
> > > > So far, so good. After this i can just go and compute the average<br>
> > > > reference<br>
> > > > using the tools from EEGLAB. I wanted to validate the results so i kept<br>
> > > > doing some tests, and i realized that if i clicked on tools-rereference<br>
> > > > and<br>
> > > > then to "add current reference channel back to the data", the error :<br>
> > > ><br>
> > > > "There are no Reference channel defined, add it using the channel<br>
> > > > location<br>
> > > > editor"<br>
> > > ><br>
> > > > appeared, although in the main EEGLAB window the Reference is stated to<br>
> > > > be<br>
> > > > Cz and Channel locations as "Yes".<br>
> > > ><br>
> > > > Question 1:<br>
> > > ><br>
> > > > Could it be that i am giving the Reference wrong in the channel<br>
> > > > locations?<br>
> > > > After reading the tutorials i only got that the reference is usually<br>
> > > > given<br>
> > > > as an extra channel, which is appended to the locations. In this case,<br>
> > > > it is<br>
> > > > not an extra channel, but channel 30 of 128. Is it wrong then, to input<br>
> > > > this<br>
> > > > channel as i did in the channel locations?<br>
> > > ><br>
> > > > Question 2:<br>
> > > ><br>
> > > > Since i wanted to see how exactly the average referencing was working, I<br>
> > > > checked also the reref.m function from EEGLAB and tried to run it<br>
> > > > standalone<br>
> > > > as follows:<br>
> > > ><br>
> > > > output=reref(eeg,30,'exclude',[63 64],'keepref','on');,<br>
> > > ><br>
> > > > where i am only interesed on the average-referenced EEG (output) and i<br>
> > > > give<br>
> > > > a 128xL matrix (my EEG measurement), I indicate my reference was the<br>
> > > > channel<br>
> > > > (row) 30, and i exclude the earlobes (63 64).<br>
> > > ><br>
> > > > The output is however very different to the one i obtain with the method<br>
> > > > explained above in EEGLAB.<br>
> > > ><br>
> > > > In order to obtain the (mostly) same result as in EEGLAB i have to input<br>
> > > > the<br>
> > > > following:<br>
> > > ><br>
> > > > output=reref(eeg,30,'exclude',[30 63 64],'keepref','on');<br>
> > > ><br>
> > > > So, what exactly am i doing wrong here? I am probably specifying the<br>
> > > > reference in a wrong way. How should one manage such a reference system<br>
> > > > within EEGLAB or in the reref function? As i understand the calculation<br>
> > > > of<br>
> > > > average referencing, i should NOT use the values of the reference to<br>
> > > > calculate the mean of all electrodes, which would be afterwards<br>
> > > > subtracted<br>
> > > > from each one. And if i wanted to see the signal of Cz post-AR, i would<br>
> > > > have<br>
> > > > it by inverting the mean of all electrodes. If so, then the right way to<br>
> > > > go<br>
> > > > here would be to exclude also the channel 30 in the reref function. Is<br>
> > > > that<br>
> > > > right?<br>
> > > ><br>
> > > > I am using currently EEGLAB v13.4.4b on MATLAB R2013a<br>
> > > ><br>
> > > > Thanks in advance!<br>
> > > ><br>
> > > > EG<br>
> > > ><br>
> > > > _______________________________________________<br>
> > > >  Eeglablist page: <a href="http://sccn.ucsd.edu/eeglab/eeglabmail.html" rel="noreferrer" target="_blank">http://sccn.ucsd.edu/eeglab/eeglabmail.html</a><br>
> > > >  To unsubscribe, send an empty email to<br>
> > > ><a href="mailto:eeglablist-unsubscribe@sccn.ucsd.edu">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
> > > >  For digest mode, send an email with the subject "set digest mime" to<br>
> > > > <a href="mailto:eeglablist-request@sccn.ucsd.edu">eeglablist-request@sccn.ucsd.edu</a><br>
> > ><br>
> > > --<br>
> > > Makoto Miyakoshi<br>
> > > Swartz Center for Computational Neuroscience<br>
> > > Institute for Neural Computation, University of California San Diego<br>
><br>
> --<br>
><br>
> Makoto Miyakoshi<br>
> Swartz Center for Computational Neuroscience<br>
> Institute for Neural Computation, University of California San Diego<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Makoto Miyakoshi<br>Swartz Center for Computational Neuroscience<br>Institute for Neural Computation, University of California San Diego<br></div></div>
</div></div>