<div dir="ltr">Dear Ernesto,<div><br></div><div>> Should I remove the reference channel from my data (select data->remove) before processing the average reference, even if it is part of my data?<br><div class="gmail_extra"><br></div><div class="gmail_extra">If you have reference channel in your data, the recorded signal is (ref chan) - (ref chan) = 0, so it should be flat. You want to remove this flat channel, of course.</div><div class="gmail_extra"><br></div><div class="gmail_extra">After average referencing, you may want to discard *any* one channel to make the data full-ranked.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Makoto</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 2, 2015 at 3:11 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>
thank you for your answer.<br>
<br>
There is no problem when importing the data and setting Cz (ch 30) as reference<br>
when i set the channel locations. But i don't know if it is valid for 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 no<br>
exclusive reference channel appended at the end. Is this refrence 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 channel<br>
from my data (select data->remove) before processing the average reference, even<br>
if it is part of my data?<br>
<br>
>From the 128 acquired electrodes, 63 and 64 are earlobes (so i remove them) and<br>
30 (cz)  is used as a reference, while channel 30 itself is measured against the<br>
ground. Unfortunately our setup has no option to use a dedicated reference<br>
electrode, so either EEG has to be measured against ground (no reference) or one<br>
of the 128 channels.<br>
<br>
So in order to get an accurate average-referenced EEG, should i remove the<br>
reference before calculating it?<br>
<br>
Thanks again!<br>
<br>
Ernesto<br>
<span class=""><br>
<br>
> On December 1, 2015 at 9:17 PM Makoto Miyakoshi <<a href="mailto:mmiyakoshi@ucsd.edu">mmiyakoshi@ucsd.edu</a>> 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>
</span>> question.Let me start from here: What's the problem of importing the data and<br>
<span class="">> 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 channel<br>
> cleaning before average<br>
</span>> 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>
<div class=""><div class="h5">> Makoto<br>
> On Thu, Nov 26, 2015 at 7:14 AM, Ernesto Gonzalez Trejo <<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 EEGLAB,<br>
> > that until now i've been unable to solve. I've read the EEGLAB tutorial 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  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 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 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 that<br>
> > the reference used in my measurement is also part of the channels. When i<br>
> > import the mat file, i cannot give explicitely the channel (as stated on the<br>
> > import window's help:<br>
> ><br>
> > "Ref. channel indices or mode" - [edit box] current reference. This edit 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 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 want<br>
> > to use them for AR.<br>
> ><br>
> > So far, so good. After this i can just go and compute the average 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 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 location<br>
> > editor"<br>
> ><br>
> > appeared, although in the main EEGLAB window the Reference is stated to 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 locations?<br>
> > After reading the tutorials i only got that the reference is usually given<br>
> > as an extra channel, which is appended to the locations. In this case, it is<br>
> > not an extra channel, but channel 30 of 128. Is it wrong then, to input 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 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 give<br>
> > a 128xL matrix (my EEG measurement), I indicate my reference was the 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 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 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 subtracted<br>
> > from each one. And if i wanted to see the signal of Cz post-AR, i would have<br>
> > it by inverting the mean of all electrodes. If so, then the right way to go<br>
> > here would be to exclude also the channel 30 in the reref function. Is 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 <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>
</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></div>