Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change output dimension of inlet.pull_sample() #347

Open
nsinnigen opened this issue Sep 25, 2018 · 5 comments
Open

How to change output dimension of inlet.pull_sample() #347

nsinnigen opened this issue Sep 25, 2018 · 5 comments

Comments

@nsinnigen
Copy link

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.

@nsinnigen nsinnigen changed the title How to change output dimension of inlet.pull.sample() How to change output dimension of inlet.pull_sample() Sep 25, 2018
@cboulay
Copy link
Collaborator

cboulay commented Sep 25, 2018

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).

@nsinnigen
Copy link
Author

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!

@tstenner
Copy link
Collaborator

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++.

@dmedine
Copy link
Contributor

dmedine commented Sep 26, 2018 via email

@nsinnigen
Copy link
Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants