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

add method to rereference channels #619

Open
Andrey1994 opened this issue Mar 26, 2023 · 5 comments
Open

add method to rereference channels #619

Andrey1994 opened this issue Mar 26, 2023 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Andrey1994
Copy link
Member

https://pressrelease.brainproducts.com/referencing/

@Andrey1994 Andrey1994 added enhancement New feature or request good first issue Good for newcomers labels Mar 26, 2023
@IbrahimBagalwa
Copy link

https://pressrelease.brainproducts.com/referencing/

Hello @Andrey1994 , I would like to kindly request for further explanation regarding the issue at hand. I am interested in working on this matter and would greatly appreciate it if you could provide more details. Thank you very much for your time and consideration.

@Andrey1994
Copy link
Member Author

Hi and thanks for willing to implement it!

I think method signature should look like this: void reference(BrainFlowArray<double, 2> data, std::vector<int> channels_to_reference, std::vector<int> reference_channels)

That should be done for all supported languages.

In terms of implementation first of all you need to average data from reference_channels and after that subtract the averaged data from channels_to_reference

In BrainFlow in general we implement everything in C\C++ and call methods from dyn libs from other languages, but here since implementation is very simple(just average multiple arrays and subtract) and since it requires 2d arrays I think it's ok to just implement it for each language

@kkashiva
Copy link

kkashiva commented May 15, 2023

Hi @Andrey1994, I'm trying to implement this and was reading your comment. The reference method signature and the implementation logic seem helpful.

When you say

That should be done for all supported languages.

As an example for java_package, do we need to add a helper method to the DataFilter.java? (brainflow/java_package/brainflow/src/main/java/brainflow/DataFilter.java)

Or the reference method needs to be added to a separate/different file?

@Andrey1994
Copy link
Member Author

Hi and thanks for working on it!

It should be a static method of DataFilter class for all languages

@kkashiva
Copy link

kkashiva commented May 27, 2023

Hi @Andrey1994 The reference method implementation in DataFilter class is ready for review for the java_package in this draft PR #630
I'll work on similar logic to implement this in other languages (Java is my strongest, so I started there).

I just have 1 doubt on where will this method be called from?

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

No branches or pull requests

4 participants
@Andrey1994 @kkashiva @IbrahimBagalwa and others