Xiul109 / eeglib

A library with tools for EEG analysis
MIT License
61 stars 14 forks source link

the bandpower function returning zero value for some bands. #3

Closed alankritmishra closed 2 years ago

alankritmishra commented 2 years ago

The delta, theta and alpha bands powers return zero value for my channels. Could you please help me with this?

Xiul109 commented 2 years ago

Hi, sorry for the late answer, I've been really busy lately, so I couldn't check github. To help you in this matter I would need more information, like the data format and the code you are using.

alankritmishra commented 2 years ago

Hi, I realised that you probably used the welch method to obtain periodograms. My SF is 512Hz, and the time duration was only 2s. That's why the delta, theta and alpha band powers return zero. I used the multitaper method to fix it. Closing it.

PS: It might be helpful for your documentation.

Fs/N = 1/t = Freq resolution where Fs is the sampling frequency of the signal, N the total number of samples and t the duration, in seconds, of the signal.

In welch's method, a commonly used approach takes a sufficiently long window to encompass at least two full cycles of the lowest frequency of interest. In our case, our lowest frequency of interest is 0.5 Hz, so that we will choose a window of 2/0.5 =4 seconds. ( which I didn't have)