BrainBit foe developers Visit website Subscribe for updates
Home
SDK
Device

Performing signal analysis

 

This page describes about various channel buffers that could be used for signal processing.

If you found some erroneous information on this or any other page or you have any questions about the device or SDK, don't hesitate to ask your questions via email or file a bug on our public issue tracker.

Email: support@brainbit.com

Issue tracker link: gitlab.com/brainbit-inc/brainbit-sdk/issues

We also have a chant on Gitter.

 

Channels residing in the SDK

The SDK contains following channel buffers (or just channels):

  • Signal channel - provides one with raw signal data. Various filters could be applied to that data.
  • EEG channel - contains EEG data with filters applied: 2 - 30Hz bandpass, 50 Hz bandstop.
  • Bipolar channel - is used to subtract samples of one channel from another to reduce synchronous noise factor.
  • Spectrum channel - contains information about the signal spectrum on a specified signal span.
  • Spectrum power channel - gives information about power of spectrum on a specified data collection.
  • Eeg index channel - shows relative EEG index values for 4 rhythms: alpha, beta, theta and delta.

 

The following code contains a simple example of listed channels usage:

    
HashMap<String, EegChannel> eegChannelCollection = new HashMap<>();
ChannelInfo[] channelInfo = mDevice.channels();
for (ChannelInfo info : channelInfo) {
    if (info.getType() == ChannelType.Signal) {
        EegChannel eegChannel = new EegChannel(mDevice, info);
        eegChannelCollection.put(eegChannel.info().getName(), eegChannel);
    }                
}
EegChannel t3 = eegChannelCollection.get("T3");
EegChannel t4 = eegChannelCollection.get("T4");
EegChannel o1 = eegChannelCollection.get("O1");
EegChannel o2 = eegChannelCollection.get("O2");

BipolarDoubleChannel t3o1 = new BipolarDoubleChannel(t3, o1);
BipolarDoubleChannel t4o2 = new BipolarDoubleChannel(t4, o2);
SpectrumChannel[] channels = new SpectrumChannel[2];
channels[0] = new SpectrumChannel(t3o1);
channels[1] = new SpectrumChannel(t4o2);
SpectrumPowerChannel alphaChannel = new SpectrumPowerChannel(channels, 8f, 14f, "Alpha");
alphaChannel.dataLengthChanged.subscribe(new INotificationCallback<Integer>() {
    @Override
    public void onNotify(Object sender, Integer nParam) {
        
    }
});
SpectrumPowerChannel betaChannel = new SpectrumPowerChannel(channels, 14f, 34f, "Beta");
betaChannel.dataLengthChanged.subscribe(new INotificationCallback<Integer>() {
    @Override
    public void onNotify(Object sender, Integer nParam) {
        
    }
});

EegIndexChannel eegIndexChannel = new EegIndexChannel(t3, t4, o1, o2);
    

The first lines are for distinguishing 4 channels by names. Then you could see the part where BipolarChannels are created, they're just for the sake of example, you could use plain EegSignal channels for Spectrum. SpectrumChannels are required by another channel - SpectrumPowerChannel, which will calculate average wave power from beginning frequency till ending frequency(e.g. 8-14 for Alpha), readData will return power in Volts squared. You could pass source spectrum channels either by one or every combination of them, resulting power values will be an average from passed channels powers.
And at last, you could use EegIndexChannel which could give you relative powers of 4 waves: alpha, beta, theta, delta. This channel returns values for each wave from 0.0 to 1.0. These numbers will show you every rhythm proportion in the EEG signal.