# Automating Stimulation Frequency Selection for SSVEP-Based Brain-Computer Interfaces
## 3 Selection Criteria of BCI Frequencies  
In our study, we propose an algorithm for selecting recommended photostimulation frequencies for SSVEP-based BCIs. The goal of the algorithm is to choose the individual photostimulation frequencies that would be the most suitable for each user. We suggest that the following individual user response characteristics be considered in this algorithm:  
1. Reaction onset speed as a response to the presented visual stimuli;
2. Ability to maintain a stable response at an acceptable level during a continuous visual stimuli presentation;
3. User satisfaction with the presented photostimulus. The reaction onset speed is an extremely important factor since it directly affects how quickly the user can send commands to the BCI. We hypothesize that by excluding photostimuli to which the user does not respond within a reasonable timeframe, and focusing solely on frequencies with the quickest reaction speeds, BCI performance will see significant improvement [13]. In this paper, we consider a stimuli frequency range from 5 to 25 Hz, and use a threshold method based on the signal-to-noise ratio (SNR) to measure the reaction speed. The stability of the user response level is another important criterion. The more stable the response level, the higher the probability of the correct recognition of the SSVEP potential by the neurointerface. Each user has an individual response to each presented frequency, which will be further demonstrated in this study. Finally, the user's satisfaction, when presented with a given photostimulus frequency, is another equally important factor. The photostimuli should not cause discomfort or fatigue to the user when using the neurointerface, as this can negatively affect the duration of comfortable interaction with it. Many scientific publications usually do not consider the possibility of response occurrences at multiples of stimulation frequencies (higher harmonics) when detecting SSVEP responses. In the proposed algorithm, we analyze the fundamental frequency of photostimulus \(f\), as well as the second harmonic stimulation frequency \(2^{\prime}\!f\) when estimating the reaction onset and SSVEP response stability. This allows us to take into account individual user characteristics and expand the frequency range, especially in the low-frequency range (8-15 Hz), where SNR may be low. Although SSVEP-based BCIs are quite attractive for solving a variety of practical tasks, as mentioned earlier, it should be noted that the user's reaction may be unpredictable. The response to individual frequencies of visual stimulation by a particular person may be so uncertain that the algorithm will not be able to detect the response. This should certainly be taken into account, and only frequencies with the highest probability of detection should be used. Other important UX components are the speed and quality of communication. The information transfer rate (ITR) is used for this purpose, which is measured in bits/min [48]. This parameter can be calculated using the following formula:  
\[ITR(P,T)=\left(\log_{2}M+P\log_{2}P+(1-P)\log_{2}\left[\frac{1-P}{M-1}\right] \right)\frac{60}{T}\]  
where P is the prediction accuracy (in the range of 0 to 1), M is the stimuli number, and T is the stimulation duration in seconds. In most studies, accuracy is calculated as the ratio of correct predictions in the experiment to the total number of predictions in the experiment. Thus, communication speed can be increased by increasing accuracy, which depends on the used method. Another option is to reduce the stimulation time. However, it should be noted that reducing the stimulation time will lead to a decrease in BCI accuracy. Therefore, one way to increase ITR is to select the optimal stimulation duration. Moreover, stimuli frequencies also influence the results; thus, another way to increase the ITR in SSVEP-based BCIs is to choose frequencies for stimulation that elicit the fastest and/or most pronounced responses.