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

Speed up the wPLI calculation with C++ #54

Open
yacineMahdid opened this issue Mar 11, 2020 · 8 comments
Open

Speed up the wPLI calculation with C++ #54

yacineMahdid opened this issue Mar 11, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@yacineMahdid
Copy link
Contributor

Right now MATLAB capabilities are not sufficient for having a fast wPLI, it takes too long. Implementing wPLI from C++ should give us at least 10X improvement.

@yacineMahdid yacineMahdid added the enhancement New feature or request label Mar 11, 2020
@yacineMahdid yacineMahdid self-assigned this Mar 11, 2020
@yacineMahdid
Copy link
Contributor Author

I found this library Armadillo which can be used to do the linear algebra stuff we need to do.

@yacineMahdid
Copy link
Contributor Author

  • will need to cite the package if we are using it for research purposes

@yacineMahdid
Copy link
Contributor Author

Had some issues with hdf5 will need to retry the installation from scratch: https://tutorialforlinux.com/2018/12/05/step-by-step-armadillo-ubuntu-18-04-installation-guide/

@yacineMahdid
Copy link
Contributor Author

I was able to get it to work but it was a pain, it was a problem with conda and hdf5 I had to copy the file over to my lib folder

@yacineMahdid
Copy link
Contributor Author

It takes some time to get use to the library, but I am already able to pass around the matrix from MATLAB to Armadillo

@yacineMahdid
Copy link
Contributor Author

Here is one way of writting the matrix in a binary format:

m=10;
A = randn(m,m);
name = 'eeg.bin'

[F,err] = fopen(name,'w');
if F<0,error(err);end

fwrite(F,A,'double');
fclose(F);

@yacineMahdid
Copy link
Contributor Author

I just need to reshape the matrix once I get it in armadillo

@yacineMahdid
Copy link
Contributor Author

We can go even simpler by using numpy and scipy since these are wrapper around C++ implementation

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

No branches or pull requests

1 participant