<div dir="ltr">Thank you Carolina, the method you suggest is really simple (and that's super for a matlab neophyte as me), I am going to try it!<br><div class="gmail_quote"><div dir="ltr"><div>Ciao,<br></div><div>Leo<br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2016-05-12 18:17 GMT+02:00 Carolina Migliorelli <span dir="ltr"><<a href="mailto:carolina.migliorelli@upc.edu" target="_blank">carolina.migliorelli@upc.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Leo, You are right, filters doesn't work with NaN signals. You can try to replace NaNs by zeros. The easiest way to do this is to use the matlab function "isnan". If you do something like:<div><br></div><div>signal(isnan(signal))=0;</div><div><br></div><div>This will replace all the Nans by zeros. If you don't want the nans be part of the signal you can try</div><div><br></div><div>signal(isnan(signal))=[];</div><div><br></div><div>This will delete the NaNs of the whole signal.</div><div><br></div><div>Hope this works!</div><div><br></div><div>Best,</div><div><br></div><div>Carolina</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>2016-05-11 15:38 GMT+02:00 leo budinich <span dir="ltr"><<a href="mailto:leo.budinich@edu.unito.it" target="_blank">leo.budinich@edu.unito.it</a>></span>:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div><div>Hi Eeglablist,<br><br></div>I'm writing here because I'm a new user of EEGLAB and I am facing a problem with high-pass filtering some data.<br><br></div><div>I am trying to apply on a freely downloadable dataset some of the same processing steps that have been used by the researchers that provided the data (see <a href="http://www.stefanfrank.info/pubs/BL2015.pdf" target="_blank">http://www.stefanfrank.info/pubs/BL2015.pdf</a>).<br>The set I want to filter has 32 channels and has already been been band-pass filtered at 0.05Hz - 25Hz, recalibrated and re-referenced to the mastoids.<br><br></div><div>An important detail is that the EEG recordings concern the reading of two hundred english sentences; the data recorded between the presentations of two sentences have been "set to NaN" by the researchers who provided the dataset, so the channel data of, e.g. subject01, presents this aspect when you inspect it:<br><br></div><div><-------------sentence_1-------------><---------wait----------><---------sentence_2---------><br></div><div><br>signal-signal-signal-signal-signal-NaN-NaN-NaN-NaN-signal-signal-signal-signal  <br></div><div><br><br>What I would like to do is high-pass filter the entire set to 0.50Hz, as a way to "mitigate the baseline problem by reducing the correlation between the baselines and amplitudes by applying an additional high-pass filter with a sufficiently high cut-off frequency" (see the reference, pp.4). <br><br></div><div>Unfortunately, when I apply a FIR filter with a 0.50Hz lower-edge I obtain a lot of NaNs on the areas that previously were 'signal', but not everywhere (and, curiously, the processing is really fast), so that it gets this kind of aspect:<br><br><br><div><-------------sentence_1-------------><---------wait----------><---------sentence_2---------><br></div><br>NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-signal-NaN-NaN</div><div><br><br>Here's the eeglab output:<br><font face="Liberation Mono, monospace"><font style="font-size:10pt" size="2"><br>pop_eegfiltnew()
- performing 1651 point highpass filtering.</font></font><font face="Liberation Mono, monospace"><font style="font-size:10pt" size="2"><br>pop_eegfiltnew()
- transition band width: 0.5 Hz</font></font><font face="Liberation Mono, monospace"><font style="font-size:10pt" size="2"><br>pop_eegfiltnew()
- passband edge(s): 0.5 Hz</font></font><font face="Liberation Mono, monospace"><font style="font-size:10pt" size="2"><br>pop_eegfiltnew()
- cutoff frequency(ies) (-6 dB): 0.25 Hz</font></font><font face="Liberation Mono, monospace"><font style="font-size:10pt" size="2"><br>pop_eegfiltnew()
- filtering the data (zero-phase)</font></font><font face="Liberation Mono, monospace"><font style="font-size:10pt" size="2"><br>firfilt():
|====================| 100%, ETE 00:00</font></font><font size="2"><font style="font-size:10pt" size="2"><br>Done.<br></font><font face="arial,helvetica,sans-serif"><br><br>I imagined that the filter function doesn't produce the right output because of the NaNs present between the sentences</font></font>, but as my comprehension of the functioning of filters and of eeglab in general is extremely limited at the moment, it turns out to be just a speculation. <br><br></div><div>Could you help me understanding what's wrong with my filtering?<br></div><div><br>And, if my hypothesis is correct, i.e. the filter cannot be applied to data containing NaNs, how would you apply a high-pass filter to data structured as I indicated above (i.e., containing NaNs in some parts)?<br><br></div><div>Thank you!<br></div><div>Leo<br></div></div>

<br>
</div></div><div style="font-size:1.3em">------------------------</div><span style="font-size:small"><div><img src="http://www.mail.unito.it/img/logounito.png"></div><span><div><span style="font-size:small"><br></span></div>Indirizzo istituzionale di posta elettronica degli studenti e dei laureati dell'Università degli Studi di Torino</span></span><span><div><font size="2">Official University of Turin email address for students and graduates </font></div><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" target="_blank">eeglablist-unsubscribe@sccn.ucsd.edu</a><br>
For digest mode, send an email with the subject "set digest mime" to <a href="mailto:eeglablist-request@sccn.ucsd.edu" target="_blank">eeglablist-request@sccn.ucsd.edu</a><br></span></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></div><br></div>

<br>
<div style="font-size:1.3em">------------------------</div><span style="font-size:small"><div><img src="http://www.mail.unito.it/img/logounito.png"></div><div><span style="font-size:small"><br></span></div>Indirizzo istituzionale di posta elettronica degli studenti e dei laureati dell'Università degli Studi di Torino</span><div><font size="2">Official University of Turin email address for students and graduates </font></div>