Design w/ artifact/jaw removal, FFT band filters and more




here you can exchange knowledge and designs

Moderator: chris

Design w/ artifact/jaw removal, FFT band filters and more

Postby encoded_evolution » Thu 29. Sep 2022, 21:42

Note that to see this design in action, you will have to
- place the design in the \AppData\Local\BrainBay\CONFIGURATIONS folder
- find a suitable piece of music (ie: mpg song) and place in the \AppData\Local\BrainBay\MOVIES folder
- place the recorded EDF file (in post below) in the \AppData\Local\BrainBay\ARCHIVES folder

Also see diagrams attached, they go with the description below

From the documentation in the design:

This is meant for hobbyist use, not intended for medical, psychiatric, or research use, no
claims for fitness of purpose, cure, or any functional guarantee. No warranty.
Use at your own risk.

This design approximates the "mystical" or "altered states" protocol by Jeff Tarrant.
See the presentation here: https:www.youtube.com/watch?v=eLwj3tf1jDU
Starting at 53:40

No association, approval or collaboration with Jeff Tarrant is implied or intended.
In fact, he may not like these designs. But, here they are anyway, for you to play with.

Basically it is a squash protocol for Delta and Alpha 1 at Pz

Squash protocols usually cover 1-20 Hz, but at Pz the, Alpha 1 band when eyes are closed
is very likely the highest power band in many individuals.

While this design is for Muse 2 using its AUX input, it could be adapted to another eeg. The thresholds
would need to be re-assessed depending on the output values of other devices.
The general functionality and the features that could be repurposed to other eegs
are below:

1. Signal Cleanup - pre-processes incoming signal to clean up signal drift, filter out 60 Hs
noise, and caps high amplitude signals such as from blinking or EMG. There
is an oscilloscope block that allows the incomming raw signal to be compared
against the cleaned signal.

2. Uses FFTs to avoid compounding filter ringing - Splits up the incoming signal into bands
using FFT which avoids producing extra ringing from Butterworth Filters. This is
a special consideration here because of the filter in the signal cleanup section.
Additional filters on top of that preprocessing filter would compound ringing &
spurious signals especially in the gamma range. There is an oscilloscope block
that allows the FFT powers to be visualized

3. Squash Threshold - the single threshold is based on the highest value of 4 bands:
Delta, Theta, Alpha 1 and MidBeta. In practice, Alpha 1, and sometimes Mid Beta
are the highest power bands when eyes are closed and body is still. But, this
protocol will always find the highest power band at that moment. An output Limiter
ensures that the output of the Threshold stays within the boundaries of 50 (min)
to 100 (typical max, given Muse 2 input on Aux electrode. Other devices may
have a different tolerance).

4. Reward Interpolator - As this is a squash protocol, it rewards lower-than-threshold values.
Therefore, the value is also inverted (simply by multiplying threshold output by -1).
Also, the reward is given as the volume of a song played via a mediaplayer block.
So this interpolator maps the input mninum and max values against volume
min and max values of 20 to 1000. As the value is inverted, it needs to be shifted
into a range suitable for the volume. The formula is:
volMin + ((inputThis - inputMin)*((volMax - volMin)(inputMax - inputMin))) + shift

5. Reward Output -
Media Player block - you will have to choose an appropriate song to play as a
reward. Per Tarrant, it should not have a strong rhythm or any lyrics.
Meditative, space-age, ambient music should be chosen. This music
should always be audible even when reward is not given, but in this case
only at low volumes.
Reward oscilloscope trace - allows visualization of when and how much reward
is given, in volume
Score counter - tracks how many FALSE->TRUE transitions were hit in the session

6. A start button - starts the session, easier to see with glasses off compared to the Play
button at bottom of the screen

Note that in the user interface, the training threshold can be set by clicking in the threshold widget
(marked in the attached UI diagram circled with an asterisk * )
Attachments
BB_Squash_Pz.con
The design file, place in the \AppData\Local\BrainBay\CONFIGURATIONS folder
(31.46 KiB) Downloaded 35 times
BB_Squash_Pz_design.PNG
The design file annotations
BB_Squash_Pz_design.PNG (104.28 KiB) Viewed 133 times
BB_Squash_Pz_interface.PNG
The user interface
BB_Squash_Pz_interface.PNG (96.35 KiB) Viewed 134 times
Last edited by encoded_evolution on Thu 29. Sep 2022, 21:59, edited 2 times in total.
encoded_evolution
 
Posts: 10
Joined: Tue 6. Sep 2022, 19:50

by Advertising » Thu 29. Sep 2022, 21:42

Advertising
 

Re: Design w/ artifact/jaw removal, FFT band filters and mor

Postby encoded_evolution » Thu 29. Sep 2022, 21:48

Find attached a recording with Pz that can be used to see how the design works.

In actual use, you would not have both an EEG and an EDF reader feeding into the design, so you would remove the EDF reader
Attachments
EC-5th-Mystical_5.zip
Unzip and place the EDF into your \AppData\Local\BrainBay\ARCHIVES folder
(1.83 MiB) Downloaded 33 times
encoded_evolution
 
Posts: 10
Joined: Tue 6. Sep 2022, 19:50


TAGS

Return to BrainBay Designs and Experiences

Who is online

No registered users

cron