<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi all,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">  I have been using Fieldtrip for the past few years for my offline EEG analysis, with good success. Recently, I have switched to helping build and design some online brain-computer interface systems and was looking toward
 Fieldtrip to handle the signal processing aspect in real-time. However, I am having some trouble with getting the online EEG processing to work as I'd like. I was wondering if any of you could provide some guidance on getting started (and potentially optimization
 areas) for the online EEG analysis from Fieldtrip, based on our setup below.<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Details:<br>
</p>
<p style="margin-top:0;margin-bottom:0">We are using the LabStreamingLayer (LSL) synchronization system to read in raw EEG data from a g.tec USB amplifier. I know that Fieldtrip has its own online buffer, but for various reasons we'd prefer to use the LSL system
 to link together our EEG recording, Matlab processing, stimulus input/output.</p>
<p style="margin-top:0;margin-bottom:0">Data from the amplifier is brought in to Matlab through LSL, providing raw Chan X Sample data. We are establishing the header for Fieldtrip ourselves, inputting the required points to use the ft_datatype_raw format. We
 have to use the raw datatype as the header information output is not in Fieldtrip's standard format.  This allows us to run ft_preprocessing after defining a cfg of our choice.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">However, just doing this processes takes around 1.5-1.8 seconds for Matlab to processes each EEG data chunk. We haven't even yet included
<span>any of the ft_analysis schemes for feature extraction, and are concerned the processing time might be too delayed through this route for real-time BCI. Does anyone have any experience with online BCI processing through Fieldtrip, or recommendations on
 expediting this process? <br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span>Thank you in advance for your help!
<br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span>-Eli</span><br>
</p>
</div>
</body>
</html>