[Eeglablist] sending TTL triggers over parallel port

James Jones-Rounds jj324 at cornell.edu
Mon May 16 09:13:18 PDT 2016


Hi Simon,

This is an increasingly tricky issue as time goes on, with fewer and fewer
computers having parallel ports. Psychophysiology as a field is in need of
the next generation of inter-computer communication devices!

To answer your question, though, there are several options, although I
don't know very much about Linux machines, and nothing about Psychtoolbox.
However, I've worked with parallel port signalling with the
stimulus-presentation programs Inquisit, PsychoPy, ePrime, Presentation,
and the data acquisition programs ActiView (from BioSemi) and Acqknowledge
(from BioPac), and there are some similarities.

First, you want to check that your computer actually knows where your
parallel port is. If it's natively installed (not installed after-market by
you or someone else), that makes it a lot easier. Make sure you know the
base address, which I'm not sure how to find out on a Linux machine, but
you probably already know what it is (if you don't, an internet search
should tell you how to find out this address).  You'll probably need to
feed this into Psychtoolbox at some "experiment" or "properties" level.

If you had to install the parallel port card into a PCI or PCI-Express
slot, then make sure the computer can use it an recognize it. There are
several aspects to this, which I don't have the chance to go into now, but
you can respond with more specific questions. There are some utilities out
there that you can use to test to see if parallel port signals are getting
through, such as "VBPortTest", which you can download online.

You may also want to reach out to Neuroscan to see if there is a special
format in which it needs to receive the TTL signals, such as only through
the parallel port's data channels 3:10, or only through channels 2:9, etc.
You may need to use a "breakout board" to change which channels/pins are
communicating the signal. I've used the PBX-2 from Probotix successfully.

Good luck!

James

On Mon, May 16, 2016 at 11:46 AM, <eeglablist-request at sccn.ucsd.edu> wrote:

> Send eeglablist mailing list submissions to
>         eeglablist at sccn.ucsd.edu
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://sccn.ucsd.edu/mailman/listinfo/eeglablist
> or, via email, send a message with subject or body 'help' to
>         eeglablist-request at sccn.ucsd.edu
>
> You can reach the person managing the list at
>         eeglablist-owner at sccn.ucsd.edu
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of eeglablist digest..."
>
> Today's Topics:
>
>    1. Interpolation of bad channels (DISNAN FEDERICA [PS5100398])
>    2. Re: Eigenvalues generation (Ibtissem KHOUAJA BENFRADJ)
>    3. Fwd: How to high-pass filter eeg data containing NaNs?
>       (leo budinich)
>    4. Fwd: How to high-pass filter eeg data containing NaNs?
>       (leo budinich)
>    5. Re: Eigenvalues generation (Matt Gerhold)
>    6. Re: How to high-pass filter eeg data containing NaNs?
>       (Andreas Widmann)
>    7. Re: Question about ASR (Artifact Subspace Reconstruction)
>       (Huy Ho?ng Tr?n)
>    8. sending TTL triggers over parallel port (Simon De Deyne)
>
>
> ---------- Forwarded message ----------
> From: "DISNAN FEDERICA [PS5100398]" <FEDERICA.DISNAN at studenti.units.it>
> To: "eeglablist at sccn.ucsd.edu" <eeglablist at sccn.ucsd.edu>
> Cc:
> Date: Sat, 14 May 2016 16:31:54 +0000
> Subject: [Eeglablist] Interpolation of bad channels
>
> Dear users,
> I would like to ask you some help with the usage of EEGLab.
> In detail, I have some questions concerning the interpolation of bad
> channels.
> Before running the ICA on EEG continuous data I follow this steps:
> - Load Channel configuration
> - Resampling to 500 Hz
> - Filtering
> - Re-reference
> - Cleanline
> Kindly I would like to know when and how it would be more appropriate to
> interpolate the bad channels.
> I would really appreciate your suggestions to solve this problem.
> Many thanks for your support,
> Best regards
> Federica Disnan
>
>
>
>
> ---------- Forwarded message ----------
> From: Ibtissem KHOUAJA BENFRADJ <ibtissem.khouaja at live.fr>
> To: Matt Gerhold <matt.gerhold at gmail.com>
> Cc: "eeglablist at sccn.ucsd.edu" <eeglablist at sccn.ucsd.edu>
> Date: Fri, 13 May 2016 11:57:57 +0100
> Subject: Re: [Eeglablist] Eigenvalues generation
> Hi Matt,
>
> I thank you so much for your reply.
>
> Really, you have undersatand very well my goal.
> In fact, I'd like to know if you have applied a specific algorithm for
> the generation of the AR matrix (A).
> In my work, I applied the algorithm 'arfit', and it gives me a vector of
> p AR parameters for each signal.
>
> In this case, how can I present my matrix to extract the eigenvalues?
>
> Thank's a lot for your reply, Ibtissem
>
> ----------------------------------------------------------
> ----------------------------------------------------------
> Ibtissem KHOUAJA BENFRADJ
> PhD in computer science
> Speciality: Biomedical Signal Processing
> Laboratory: LTIM, University of Monastir, Tunisia
> http://www.labtim.org/accueil.php
> Laboratory: LIGM, Univerisity of Paris-East, France
> http://ligm.u-pem.fr/
>
>
>
>
> ------------------------------
> Date: Tue, 3 May 2016 21:09:01 +0200
> Subject: Re: [Eeglablist] Eigenvalues generation
> From: matt.gerhold at gmail.com
> To: ibtissem.khouaja at live.fr
> CC: eeglablist at sccn.ucsd.edu
>
> Hi,
>
> One would compute the eigenvalues for the autoregressive parameter
> matrix--your estimated beta coefficients. This would be to assess the
> stability of the system. One only needs to compute these eigenvalues for
> this matrix; nothing more nothing less... Then take the modulus of the
> eigenvalues, they should all be less than one. Following Lutkepohl (2005),
> a simple way to do this is:
>
> if A = autoregressive parameters (K x K), where K is number of
> data-channels:
>
> >> eig_vals = abs(diag(jordan(A))) % jordan canonical form of A
> >> eig_vals < 1 % should give a vector of 1's if the system is stable
>
> Regards,
>
> Matthew
>
>
> On Mon, May 2, 2016 at 6:20 PM, Ibtissem KHOUAJA BENFRADJ <
> ibtissem.khouaja at live.fr> wrote:
>
> Dear list,
>
>
> I applied the ARFIT algorithm in the generation of autoregressive
> parameters
> corresponding to the time-varying of EEG.
> Nest, in order to generate the eigenvalues of the AR matrix I used ARMODE
> algorithm.
>
> I need your help to generate differently the eigenvalues for the AR
> parameters of each signal (AR vector) and all of signal (AR matrix).
>
> Thank you for your help, Ibtissem
>
> ----------------------------------------------------------
> ----------------------------------------------------------
> Ibtissem KHOUAJA BENFRADJ
> PhD in computer science
> Speciality: Biomedical Signal Processing
> Laboratory: LTIM, University of Monastir, Tunisia
> http://www.labtim.org/accueil.php
> Laboratory: LIGM, Univerisity of Paris-East, France
> http://ligm.u-pem.fr/
>
>
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>
>
>
>
> ---------- Forwarded message ----------
> From: leo budinich <leo.budinich at edu.unito.it>
> To: <eeglablist at sccn.ucsd.edu>
> Cc:
> Date: Fri, 13 May 2016 14:33:36 +0200
> Subject: [Eeglablist] Fwd: How to high-pass filter eeg data containing
> NaNs?
> 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!
> Ciao,
> Leo
>
> 2016-05-12 18:17 GMT+02:00 Carolina Migliorelli <
> carolina.migliorelli at upc.edu>:
>
>> 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:
>>
>> signal(isnan(signal))=0;
>>
>> This will replace all the Nans by zeros. If you don't want the nans be
>> part of the signal you can try
>>
>> signal(isnan(signal))=[];
>>
>> This will delete the NaNs of the whole signal.
>>
>> Hope this works!
>>
>> Best,
>>
>> Carolina
>>
>> 2016-05-11 15:38 GMT+02:00 leo budinich <leo.budinich at edu.unito.it>:
>>
>>> Hi Eeglablist,
>>>
>>> I'm writing here because I'm a new user of EEGLAB and I am facing a
>>> problem with high-pass filtering some data.
>>>
>>> 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 http://www.stefanfrank.info/pubs/BL2015.pdf).
>>> 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.
>>>
>>> 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:
>>>
>>>
>>> <-------------sentence_1-------------><---------wait----------><---------sentence_2--------->
>>>
>>> signal-signal-signal-signal-signal-NaN-NaN-NaN-NaN-signal-signal-signal-signal
>>>
>>>
>>>
>>> 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).
>>>
>>> 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:
>>>
>>>
>>>
>>> <-------------sentence_1-------------><---------wait----------><---------sentence_2--------->
>>>
>>> NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-signal-NaN-NaN
>>>
>>>
>>> Here's the eeglab output:
>>>
>>> pop_eegfiltnew() - performing 1651 point highpass filtering.
>>> pop_eegfiltnew() - transition band width: 0.5 Hz
>>> pop_eegfiltnew() - passband edge(s): 0.5 Hz
>>> pop_eegfiltnew() - cutoff frequency(ies) (-6 dB): 0.25 Hz
>>> pop_eegfiltnew() - filtering the data (zero-phase)
>>> firfilt(): |====================| 100%, ETE 00:00
>>> Done.
>>>
>>>
>>> I imagined that the filter function doesn't produce the right output
>>> because of the NaNs present between the sentences, 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.
>>>
>>> Could you help me understanding what's wrong with my filtering?
>>>
>>> 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)?
>>>
>>> Thank you!
>>> Leo
>>>
>>> ------------------------
>>>
>>> Indirizzo istituzionale di posta elettronica degli studenti e dei
>>> laureati dell'Università degli Studi di Torino
>>> Official University of Turin email address for students and graduates
>>>
>>> _______________________________________________
>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>> To unsubscribe, send an empty email to
>>> eeglablist-unsubscribe at sccn.ucsd.edu
>>> For digest mode, send an email with the subject "set digest mime" to
>>> eeglablist-request at sccn.ucsd.edu
>>>
>>
>>
>
>
> ------------------------
>
> Indirizzo istituzionale di posta elettronica degli studenti e dei laureati
> dell'Università degli Studi di Torino
> Official University of Turin email address for students and graduates
>
>
> ---------- Forwarded message ----------
> From: leo budinich <leo.budinich at edu.unito.it>
> To: <eeglablist at sccn.ucsd.edu>
> Cc:
> Date: Fri, 13 May 2016 14:33:00 +0200
> Subject: [Eeglablist] Fwd: How to high-pass filter eeg data containing
> NaNs?
>
> ---------- Forwarded message ----------
> From: leo budinich <leo.budinich at edu.unito.it>
> Date: 2016-05-13 10:56 GMT+02:00
> Subject: Re: [Eeglablist] How to high-pass filter eeg data containing NaNs?
> To: Andreas Widmann <widmann at uni-leipzig.de>
>
>
> Thanks Andreas! Your answer has been really helpful!
> Now I understand a little better how filtering works...
> I'll make a try with cutting away the NaN parts and then applying the
> high-pass filter, keeping in mind that it's highly possible to incur in
> edge-effects.
> I think also that I am going make a try with a more traditional approach
> to baseline correction (subtracting the mean amplitude of the 100ms
> preceding the target stimulus).
>
> I would like also to try what Carolina proposed (transforming NaNs in
> zeros and then filtering the set): do you think it could work?
>
> Thanks,
> Leo
>
> 2016-05-12 16:25 GMT+02:00 Andreas Widmann <widmann at uni-leipzig.de>:
>
>> Hi Leo,
>>
>> filtering is the convolution of two signals-the data and the filter’s
>> impulse response. The impulse response has a duration, 1651 samples or 6.6
>> seconds in your case. If any sample of both signals is NaN the output is
>> also NaN. That’s why your filter output mainly consists of NaNs.
>> Unfortunately, there’s is not so much one could do. Thus, I would consider
>> the decision NaNing large parts of the continuous data as, hm, suboptimal.
>>
>> Pragmatically, the only thing you could do is cutting away the NaN parts
>> (the data are effectively kind of „epoched“ already anyway).
>>
>> tmp = any( isnan( EEG.data ), 1 );
>> onsetArray = find( diff( [ 0 tmp ] ) == 1 );
>> offsetArray = find( diff( [ tmp 0 ] ) == -1 );
>> EEG = eeg_eegrej( EEG, [ onsetArray; offsetArray ]' );
>> [ ALLEEG, EEG, CURRENTSET ] = pop_newset( ALLEEG, EEG, CURRENTSET );
>> eeglab redraw
>>
>> Now, at least there is signal in the filter output where there was signal
>> in the filter input.
>>
>> I would, however, recommend being careful with the further analysis of
>> the data and interpretation of the results. High-pass filtering should
>> always be done on the continuous data. You have to expect edge-effects up
>> to the duration of the impulse response at the beginning and end of each
>> epoch (actually all data regions which were signal in the filter input and
>> NaN in the filter output before; essentially the observed NaNs reflect some
>> kind of edge-effect themselves). Type, size, and duration of the
>> edge-effects depend on impulse response length and whether and how data are
>> padded during filtering but there is nothing you could do against
>> edge-effects in general. Given the minimal required durations of the
>> impulse responses for the filter cutoffs suggested in the paper I would
>> consider the final sentence of footnote 3 as incorrect. This does also not
>> depend on filter type (unfortunately not described in detail in the paper).
>>
>> Finally, you have to be careful with high-pass filtering with higher
>> cutoffs in ERP analysis in general. Recent relevant literature on this
>> issue you may find at the end of this page:
>> http://sccn.ucsd.edu/wiki/Firfilt_FAQ
>>
>> Hope this helps!
>> Andreas
>>
>> > Am 11.05.2016 um 15:38 schrieb leo budinich <leo.budinich at edu.unito.it
>> >:
>> >
>> > Hi Eeglablist,
>> >
>> > I'm writing here because I'm a new user of EEGLAB and I am facing a
>> problem with high-pass filtering some data.
>> >
>> > 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 http://www.stefanfrank.info/pubs/BL2015.pdf).
>> > 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.
>> >
>> > 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:
>> >
>> >
>> <-------------sentence_1-------------><---------wait----------><---------sentence_2--------->
>> >
>> >
>> signal-signal-signal-signal-signal-NaN-NaN-NaN-NaN-signal-signal-signal-signal
>> >
>> >
>> > 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).
>> >
>> > 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:
>> >
>> >
>> >
>> <-------------sentence_1-------------><---------wait----------><---------sentence_2--------->
>> >
>> > NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-signal-NaN-NaN
>> >
>> >
>> > Here's the eeglab output:
>> >
>> > pop_eegfiltnew() - performing 1651 point highpass filtering.
>> > pop_eegfiltnew() - transition band width: 0.5 Hz
>> > pop_eegfiltnew() - passband edge(s): 0.5 Hz
>> > pop_eegfiltnew() - cutoff frequency(ies) (-6 dB): 0.25 Hz
>> > pop_eegfiltnew() - filtering the data (zero-phase)
>> > firfilt(): |====================| 100%, ETE 00:00
>> > Done.
>> >
>> >
>> > I imagined that the filter function doesn't produce the right output
>> because of the NaNs present between the sentences, 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.
>> >
>> > Could you help me understanding what's wrong with my filtering?
>> >
>> > 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)?
>> >
>> > Thank you!
>> > Leo
>> >
>> > ------------------------
>> >
>> >
>> > Indirizzo istituzionale di posta elettronica degli studenti e dei
>> laureati dell'Università degli Studi di Torino
>> > Official University of Turin email address for students and graduates
>> > _______________________________________________
>> > Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>> > To unsubscribe, send an empty email to
>> eeglablist-unsubscribe at sccn.ucsd.edu
>> > For digest mode, send an email with the subject "set digest mime" to
>> eeglablist-request at sccn.ucsd.edu
>>
>>
>
>
> ------------------------
>
> Indirizzo istituzionale di posta elettronica degli studenti e dei laureati
> dell'Università degli Studi di Torino
> Official University of Turin email address for students and graduates
>
>
> ---------- Forwarded message ----------
> From: Matt Gerhold <matt.gerhold at gmail.com>
> To: Ibtissem KHOUAJA BENFRADJ <ibtissem.khouaja at live.fr>
> Cc: "eeglablist at sccn.ucsd.edu" <eeglablist at sccn.ucsd.edu>
> Date: Fri, 13 May 2016 15:15:25 +0200
> Subject: Re: [Eeglablist] Eigenvalues generation
>
> Hi Ibtissem,
>
> ARFit is a toolbox for fitting vector autoregressive timeseries models. It
> uses QR factorisation to solve for a least-squares fit. One can use the QR
> factors to compute the covariance matrix for progressively lower model
> orders, thus enabling a step-wise least-square approach. It has
> computational advantages over OLS and Yule-Walker fitting algorithms.
>
> The ARFit provides a (chan X chan*order) matrix of coefficients in the
> instance of a higher order model. For a higher-order model one would
> compute the companion form matrix denoted, F.
>
> % fit model to a bivariate timeseries data in variable ts
>
> >>[w, A, C, sbc, fpe, th]=arfit(ts', 4, 4, 'sbc', 'zero');
>
>  % build companion form matrix
>
> >> rw_2 = [eye(2) zeros(2,2) zeros(2,2) zeros(2,2)];
>
> >> rw_3 = [zeros(2,2) eye(2) zeros(2,2) zeros(2,2)];
>
> >> rw_4 = [zeros(2,2) zeros(2,2) eye(2) zeros(2,2)];
>
> >> F = [A; rw_2; rw_3; rw_4]; % final companion form matrix
>
>  % check stability
>
> >> eig_vals = abs(diag(jordan(F))) % jordan canonical form of A
> >> max(eig_vals) < 1 % should give a 1 if the system is stable
>
> That’s pretty much it.
>
> Rgds,
>
> Matthew
>
> On Fri, May 13, 2016 at 12:57 PM, Ibtissem KHOUAJA BENFRADJ <
> ibtissem.khouaja at live.fr> wrote:
>
>> Hi Matt,
>>
>> I thank you so much for your reply.
>>
>> Really, you have undersatand very well my goal.
>> In fact, I'd like to know if you have applied a specific algorithm for
>> the generation of the AR matrix (A).
>> In my work, I applied the algorithm 'arfit', and it gives me a vector of
>> p AR parameters for each signal.
>>
>> In this case, how can I present my matrix to extract the eigenvalues?
>>
>> Thank's a lot for your reply, Ibtissem
>>
>> ----------------------------------------------------------
>> ----------------------------------------------------------
>> Ibtissem KHOUAJA BENFRADJ
>> PhD in computer science
>> Speciality: Biomedical Signal Processing
>> Laboratory: LTIM, University of Monastir, Tunisia
>> http://www.labtim.org/accueil.php
>> Laboratory: LIGM, Univerisity of Paris-East, France
>> http://ligm.u-pem.fr/
>>
>>
>>
>>
>> ------------------------------
>> Date: Tue, 3 May 2016 21:09:01 +0200
>> Subject: Re: [Eeglablist] Eigenvalues generation
>> From: matt.gerhold at gmail.com
>> To: ibtissem.khouaja at live.fr
>> CC: eeglablist at sccn.ucsd.edu
>>
>>
>> Hi,
>>
>> One would compute the eigenvalues for the autoregressive parameter
>> matrix--your estimated beta coefficients. This would be to assess the
>> stability of the system. One only needs to compute these eigenvalues for
>> this matrix; nothing more nothing less... Then take the modulus of the
>> eigenvalues, they should all be less than one. Following Lutkepohl (2005),
>> a simple way to do this is:
>>
>> if A = autoregressive parameters (K x K), where K is number of
>> data-channels:
>>
>> >> eig_vals = abs(diag(jordan(A))) % jordan canonical form of A
>> >> eig_vals < 1 % should give a vector of 1's if the system is stable
>>
>> Regards,
>>
>> Matthew
>>
>>
>> On Mon, May 2, 2016 at 6:20 PM, Ibtissem KHOUAJA BENFRADJ <
>> ibtissem.khouaja at live.fr> wrote:
>>
>> Dear list,
>>
>>
>> I applied the ARFIT algorithm in the generation of autoregressive
>> parameters
>> corresponding to the time-varying of EEG.
>> Nest, in order to generate the eigenvalues of the AR matrix I used ARMODE
>> algorithm.
>>
>> I need your help to generate differently the eigenvalues for the AR
>> parameters of each signal (AR vector) and all of signal (AR matrix).
>>
>> Thank you for your help, Ibtissem
>>
>> ----------------------------------------------------------
>> ----------------------------------------------------------
>> Ibtissem KHOUAJA BENFRADJ
>> PhD in computer science
>> Speciality: Biomedical Signal Processing
>> Laboratory: LTIM, University of Monastir, Tunisia
>> http://www.labtim.org/accueil.php
>> Laboratory: LIGM, Univerisity of Paris-East, France
>> http://ligm.u-pem.fr/
>>
>>
>>
>> _______________________________________________
>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>> To unsubscribe, send an empty email to
>> eeglablist-unsubscribe at sccn.ucsd.edu
>> For digest mode, send an email with the subject "set digest mime" to
>> eeglablist-request at sccn.ucsd.edu
>>
>>
>>
>
>
> ---------- Forwarded message ----------
> From: Andreas Widmann <widmann at uni-leipzig.de>
> To: EEGLAB List <eeglablist at sccn.ucsd.edu>
> Cc:
> Date: Mon, 16 May 2016 11:49:48 +0200
> Subject: Re: [Eeglablist] How to high-pass filter eeg data containing NaNs?
> Hi Leo,
>
> filtering is the convolution of two signals-the data and the filter’s
> impulse response. The impulse response has a duration, 1651 samples or 6.6
> seconds in your case. If any sample of both signals is NaN the output is
> also NaN. That’s why your filter output mainly consists of NaNs.
> Unfortunately, there’s is not so much one could do. Thus, I would consider
> the decision NaNing large parts of the continuous data as, hm, suboptimal.
>
> Pragmatically, the only thing you could do is cutting away the NaN parts
> (the data are effectively kind of „epoched“ already anyway).
>
> tmp = any( isnan( EEG.data ), 1 );
> onsetArray = find( diff( [ 0 tmp ] ) == 1 );
> offsetArray = find( diff( [ tmp 0 ] ) == -1 );
> EEG = eeg_eegrej( EEG, [ onsetArray; offsetArray ]' );
> [ ALLEEG, EEG, CURRENTSET ] = pop_newset( ALLEEG, EEG, CURRENTSET );
> eeglab redraw
>
> Now, at least there is signal in the filter output where there was signal
> in the filter input.
>
> I would, however, recommend being careful with the further analysis of the
> data and interpretation of the results. High-pass filtering should always
> be done on the continuous data. You have to expect edge-effects up to the
> duration of the impulse response at the beginning and end of each epoch
> (actually all data regions which were signal in the filter input and NaN in
> the filter output before; essentially the observed NaNs reflect some kind
> of edge-effect themselves). Type, size, and duration of the edge-effects
> depend on impulse response length and whether and how data are padded
> during filtering but there is nothing you could do against edge-effects in
> general. Given the minimal required durations of the impulse responses for
> the filter cutoffs suggested in the paper I would consider the final
> sentence of footnote 3 as incorrect. This does also not depend on filter
> type (unfortunately not described in detail in the paper).
>
> Finally, you have to be careful with high-pass filtering with higher
> cutoffs in ERP analysis in general. Recent relevant literature on this
> issue you may find at the end of this page:
> http://sccn.ucsd.edu/wiki/Firfilt_FAQ
>
> Hope this helps!
> Andreas
>
> > Am 11.05.2016 um 15:38 schrieb leo budinich <leo.budinich at edu.unito.it>:
> >
> > Hi Eeglablist,
> >
> > I'm writing here because I'm a new user of EEGLAB and I am facing a
> problem with high-pass filtering some data.
> >
> > 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 http://www.stefanfrank.info/pubs/BL2015.pdf).
> > 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.
> >
> > 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:
> >
> >
> <-------------sentence_1-------------><---------wait----------><---------sentence_2--------->
> >
> >
> signal-signal-signal-signal-signal-NaN-NaN-NaN-NaN-signal-signal-signal-signal
> >
> >
> > 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).
> >
> > 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:
> >
> >
> >
> <-------------sentence_1-------------><---------wait----------><---------sentence_2--------->
> >
> > NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-NaN-signal-NaN-NaN
> >
> >
> > Here's the eeglab output:
> >
> > pop_eegfiltnew() - performing 1651 point highpass filtering.
> > pop_eegfiltnew() - transition band width: 0.5 Hz
> > pop_eegfiltnew() - passband edge(s): 0.5 Hz
> > pop_eegfiltnew() - cutoff frequency(ies) (-6 dB): 0.25 Hz
> > pop_eegfiltnew() - filtering the data (zero-phase)
> > firfilt(): |====================| 100%, ETE 00:00
> > Done.
> >
> >
> > I imagined that the filter function doesn't produce the right output
> because of the NaNs present between the sentences, 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.
> >
> > Could you help me understanding what's wrong with my filtering?
> >
> > 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)?
> >
> > Thank you!
> > Leo
> >
> > ------------------------
> >
> >
> > Indirizzo istituzionale di posta elettronica degli studenti e dei
> laureati dell'Università degli Studi di Torino
> > Official University of Turin email address for students and graduates
> > _______________________________________________
> > Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> > To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> > For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>
>
>
>
> ---------- Forwarded message ----------
> From: "Huy Hoàng Trần" <hoangtran355 at gmail.com>
> To: <tarikbelbahar at gmail.com>
> Cc: eeglablist <eeglablist at sccn.ucsd.edu>
> Date: Mon, 16 May 2016 04:19:22 +0000
> Subject: Re: [Eeglablist] Question about ASR (Artifact Subspace
> Reconstruction)
> Hello,
> Thanks for your response.
> I can use ASR in my data and it works very well, and now I want to modify
> the code.
> I don't really understand the part of the code that performs PCA. Which
> variance represent the Principal Components in asr_process.m file?
>
>
>
>
> Vào Th 6, 13 thg 5, 2016 vào lúc 01:43 Tarik S Bel-Bahar <
> tarikbelbahar at gmail.com> đã viết:
>
>> Hello, I have a related question, can we set the specific channels used
>> in ASR without hacking into the functions ?
>> Huy, you may benefit from using the new published PREP pipeline from
>> Kothe and colleagues, which I believe also implements ASR and various other
>> functioins for automatic pre-processing.
>> Best wishes!
>>
>> On Thu, May 12, 2016 at 12:27 AM, Huy Hoàng Trần <hoangtran355 at gmail.com>
>> wrote:
>>
>>> Hello
>>> I am working with ASR and I wonder if it would be possible to replace
>>> PCA step in ASR with another algorithm?
>>>
>>> Thank you for any responses!
>>>
>>> Hoang
>>>
>>> Department of Automation Technology,
>>> Institute of Information Tech., Vietnam Academy of Science and Tech.
>>>
>>> _______________________________________________
>>> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
>>> To unsubscribe, send an empty email to
>>> eeglablist-unsubscribe at sccn.ucsd.edu
>>> For digest mode, send an email with the subject "set digest mime" to
>>> eeglablist-request at sccn.ucsd.edu
>>>
>>
>>
>
> ---------- Forwarded message ----------
> From: Simon De Deyne <simon.dedeyne at adelaide.edu.au>
> To: "eeglablist at sccn.ucsd.edu" <eeglablist at sccn.ucsd.edu>
> Cc:
> Date: Mon, 16 May 2016 09:51:31 +0000
> Subject: [Eeglablist] sending TTL triggers over parallel port
>
>
> My apologies if this is slightly off topic, but does anyone know how to
> send TTL triggers
>  with matlab on Linux? I use an ubuntu  14.04 machine with psychtoolbox 3
> and would like to communicate with Neuroscan Synamps2.
> So far I found some outdated information online, but nothing seems to work
> so far and I'm afraid I'm not that experienced with EEG studies as well.
> Any ideas on how to test to see if everything works?
>
> Thanks,
> Simon
>
> Simon De Deyne
> School of Psychology
> The University of Adelaide, AUSTRALIA 5005
> Level 5  Hughes Building
> Ph    : +61 8 8313 6785
> e-mail: simon.dedeyne at adelaide.edu.au
>
> _______________________________________________
> eeglablist mailing list eeglablist at sccn.ucsd.edu
> Eeglablist page: http://www.sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsub at sccn.ucsd.edu
> To switch to non-digest mode, send an empty email to
> eeglablist-nodigest at sccn.ucsd.edu
>



-- 
James Jones-Rounds
Laboratory Manager
Human Development EEG and Psychophysiology (HEP) Laboratory,
Department of Human Development,
--------------------------------------------
Cornell University | Ithaca, NY
607-255-9883
eeg at cornell.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sccn.ucsd.edu/pipermail/eeglablist/attachments/20160516/286fc079/attachment.html>


More information about the eeglablist mailing list