what is 'Ibin' variable in W_Focus widget?
hi, my name is Babak. I am using openBCI Ganglion with java Processing. i want to know in openBCI source code, in W_focus tab, what means Ibin?
I want to obtain values of frequency 13 Hz, so, Can I use the following code?
for (int Ichan=0; Ichan < 2; Ichan++) { // only consider first two channels
for (int Ibin = 0; Ibin < fftBuff[Ichan].specSize(); Ibin++) {
if (Ibin == 17){
FFT_freq_Hz = fftBuff[Ichan].indexToFreq(Ibin);
FFT_value_uV = fftBuff[Ichan].getBand(FFT_freq_Hz);
println("FFT_value_in_13Hz = " + FFT_value_uV);
}
...
please guide me????
Comments
Babak, hi.
Why not just use the Networking Widget's ability to output the FFT 'bins' as an array of amplitude @ frequency values?
https://docs.openbci.com/docs/06Software/01-OpenBCISoftware/GUIWidgets#networking
https://labstreaminglayer.readthedocs.io/ [LSL document]
Output formats:
https://docs.google.com/document/d/e/2PACX-1vR_4DXPTh1nuiOwWKwIZN3NkGP3kRwpP4Hu6fQmy3jRAOaydOuEI1jket6V4V6PG4yIG15H1N7oFfdV/pub
Alternately you could use BrainFlow and construct a bandpass filter, say from 12 to 14 Hz.
https://brainflow.readthedocs.io/en/stable/Examples.html#java-signal-filtering
Regards, William
@Babilord The OpenBCI software team has decided as a group to deprecate the W_Focus widget for now, since the current algorithm is not supported by existing scientific papers. I think it mentions in the widget that it was derived using trial and error.
You are still welcome to use and modify this widget using GUI 4.2.0 as a starting point.
Moving forward, we would like to bring this widget back to life in the future, but we want to make sure it is actually a measure of focus, and may require the use of a Machine Learning Classifier https://towardsdatascience.com/machine-learning-classifiers-a5cc4e1b0623.
Using GUI v5 (coming next month), you can still use the FFT datatype in the Networking Widget to send data to an external application.