A c-VEP speller encoded with non-binary m-sequences
Tested on MEDUSA© Platform v2022.0 & 2023.0
This app provides a BCI speller based on code-modulated visual evoked potential (c-VEP) under the circular-shifting paradigm that can encode commands using non-binary codes. The app allows to develop high-speed, reliable BCIs for communication and control by encoding the application commands using shifted versions of p-ary m-sequences. Read the description below to learn more.
What is the basis of this paradigm?
The c-VEPs are visual evoked potentials generated by looking at a flickering source that follows a pseudorandom sequence. Usually, this sequence is binary (i.e., it only has values 0 or 1), and thus the flickering is encoded with black and white flashes. This high-contrast stimuli may cause visual eyestrain for some users. However, it is possible to encode commands using non-binary codes, encoded with different shades of gray or different colors, with the objective to be more comfortable to the end user. If you want to learn more about binary-based c-VEP spellers and/or circular shifting paradigms, please check the "c-VEP speller" app: https://medusabci.com/market/cvep_speller/
Finding non-binary codes with good autocorrelation functions is not trivial, thus this app does that for you. Here, we have use different primitive polynomials over Galois Fields GF(p^r), where p is the base (i.e., number of levels or colors) and r is the order of the polynomial; to generate p-ary m-sequences. Currently, bases 2, 3, 5, 7, 11 and 13 are implemented for different orders to vary the code length. Please, refer to the basic "c-VEP speller" app if you are interested in the signal processing pipeline.
Relevant functionalities of the “P-ary c-VEP Speller” app
- The app has two functioning modes: “Train” and “Online”. Use “Train” to record the data for calibrating the system. Use “Online” when you already has a decoding model to select speller commands freely.
- The number of trials and the number of cycles can be configured for the “Train” mode. See the recommendations section below to know more.
- This app does not implement an early stopping approach, so it is required to specify the number of cycles per trial for the “Online” mode.
- The app allows you to specify the presentation rate of the m-sequence. Use 60 Hz if you are using a standard monitor, read the recommendations section to know more.
Encoding and matrix
- This app supports the use of p-ary m-sequences of bases 2, 3, 5, 7, 11 and 13, select the one that you want to use! The length (in bits) and the cycle duration (in seconds) of the final code is automatically shown when you select the base and the desired order.
- Configure the number of commands in the online mode as you wish. Please note that the length of the m-sequence must be enough to encode all commands! To make sure of this, press the button “Update encoding” to check the lags associated to each command. The app will try to space the lags as much as possible.
- Use also the "Update encoding" button to show the distribution of the lags of each command to avoid local autocorrelation maxima and minima for p-ary m-sequences. A deterministic algorithm is used to avoid these points. Make sure to check the correlation values of each command to avoid unexpected errors (if all the cells are green, everything would be fine).
- The colors functionality allows you to use different colors for the GUI and the encoding of the p-ary m-sequences. Try it out!
- Use the button “Train model” to train the decoding model. Signal processing is entirely based on the “reference processing pipeline” for c-VEP-BCIs based on circular shifting (check this out to know more).
- Use a filter bank to improve the decoding accuracy for 120 Hz monitor rates!
C-VEPs are exogenous signals generated naturally by our brains in response to stimuli. For that reason, c-VEP-based BCIs do not require users to be trained, but just a small calibration. In calibration stage, user is asked to pay attention to a flickering command encoded with the original m-sequence. We recommend to user, at least, 100 entire cycles (i.e., a full stimulation of the m-sequence) to train the model. That is, two runs of 5 trials each, in which trials are composed of 10 cycles. It is important to avoid blinking when trials are being displayed. Users can freely blink in the inter-trial time window.
If your monitor is capable to refresh at 120 Hz, we recommend using a “Target FPS (Hz)” that matches the monitor refresh rate. Imagine that you are using a 63-bit m-sequence. For a 60 Hz presentation rate, each cycle will last 1.05 s (i.e., 63/60). You can reduce that duration by half using 120 Hz, lasting 0.525 s (i.e., 63/120).
If you are using a 120 Hz presentation rate, we recommend you use more than a single filter. For instance, a filter bank composed of 3 IIR filters: (1, 60), (12, 60) and (30, 60) usually gives good results.
If you want to know more about the paradigm, the signal processing pipeline or the state-of-the-art methods that are used in c-VEP-based BCIs, we recommend to read the following paper: Martínez-Cagigal, Víctor, et al. "Brain–computer interfaces based on code-modulated visual evoked potentials (c-VEP): a literature review." Journal of Neural Engineering (2021).