PIA-Group / BioSPPy

Biosignal Processing in Python
Other
569 stars 273 forks source link

Single-channel EEG support #101

Closed iris-pascoal closed 2 years ago

iris-pascoal commented 2 years ago

Hi! I have been trying to process a single-channel raw EEG signal with your library, but when I call the function eeg.eeg(signal=signal_eeg, sampling_rate=1000, show=True) I always get the error:

File "C:\Users\irisp\Anaconda3\lib\site-packages\biosppy\signals\eeg.py", line 81, in eeg nch = signal.shape[1] IndexError: tuple index out of range

Am I doing something wrong or the library doesen't work for a single-channel?

Thank you

iris-pascoal commented 2 years ago

Do you know how to solve the bug?

hugoslv commented 2 years ago

Hi Iris,

One of the metrics computed by the library requires at least two channels. A quick fix is then to create a matrix with two columns corresponding to the same channel. We'll try to revise this quickly.

Best regards, Hugo Silva

iris-pascoal commented 2 years ago

Thank you!

afonsocraposo commented 2 years ago

Hi @iris-pascoal ! I fixed your problem. It should now work with single-channel EEG. Remember to use the Github version instead of the PyPI one. Feel free to reopen this issue if needed.