sccn / lsl_archived

Multi-modal time-synched data transmission over local network

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to change output dimension of inlet.pull_sample()

nsinnigen opened this issue · comments

When I call "inlet.pull_sample()" it outputs a 1x63 matrix (EEGData). How can I change the EEGData output from 63x1 to 63x1 without transposing the matrix EEGData? I couldn't fine the code line where this might be possible.

Are you using the Python wrapper?

Can you explain more about what you are trying to do with the data and why transpose is inappropriate in your case? For a matrix where one of the dimensions is 1, the transpose operation is very fast (100 nsec on my computer).

I am using lsl with matlab to correct EEG data in real time. An EEG data set is simulated using Brainvision Recorder and sent to Matlab. All the functions I wrote are based on 63x1 dimension. On my computer transpose operation is quite fast as well (about 16µs). I just wanted to avoid any unnecessary calculation steps. But if it's too much effort to change the dimension of the outcome, then I'll just stick to transpose. I just thought there might be a simple solution.

Btw, thanks for working on labstreaminglayer. It helped me a lot and saved me probably hundreds of working hours!

For nx1 / 1xn-matrices the transpose operation is O(1), i.e. it takes the same time no matter how much data you have.
If performance is a real problem, you could try pypy or write parts of your algorithm in C / C++.

At the beginning I used Brain Product's "Remote Data access" to stream data directly from Brainvision Recorder to Matlab, but my code didn't work there, because there is no option to buffer data. The processing time is a bit larger than the acquisition time, so it's rather near real-time. That's why I thought it's a good idea to use labstreaminglayer since this enables me to use a buffer.

Or are there any other options to perform near real-time correction using matlab? (I am quite a newbie to the topic)