5.2. Pre-Processing and Descriptive Statistics
After obtaining the records from all participants, we used the MATLAB software package, version r2022b, for technical computing tasks. We utilized a band-pass filter with a bandwidth frequency range of 3 to 49 Hz to preprocess the EEG signals. Despite the fact that the occipital electrodes used in our calculations showed less prominent artifacts, such as EOG artifacts compared to frontal electrodes [
53], we filtered out any activity in the frequency range up to 3 Hz. Additionally, due to the functioning of the notch filter used during the recording stage of the EEG signals, the frequency range of 45–55 Hz was unsuitable for our calculations; therefore, we suppressed all frequencies above 49 Hz.
Then, for each of the channels of occipital leads O1, O2, and Oz, we performed a procedure of extracting fragments of the EEG signal with photostimulation. Each fragment consisted of a 10 s interval before the presentation of the photostimulus, a 60 s fragment recorded during the presentation of the photostimulus, and a 20 s fragment after the end of the presentation of the photostimulus. Thus, for each participant, we obtained 21 × 3 EEG signal fragments of 90 s each. We carefully checked all obtained fragments for the absence of any artifacts that would prevent further computations. Finally, for each fragment, we calculated all the coefficients described in
Section 4.
Thus,
Figure 3 represents the dependence of the reaction speed coefficient
on the photostimuli frequency for subject 3. This chart is presented for the fundamental and second harmonics of the stimulation frequencies for all occipital leads. It is important to note that, in our case, due to the effect of the notch filter, the results of calculating the second harmonic coefficients for frequencies beginning from 45 to 55 Hz do not provide any useful information and are not taken into account by us, since this frequency range was affected by the filter.
As can be seen from the figure above, subject 3 demonstrates the best response speed (close to one) for photostimuli frequencies from 13 to 25 Hz, according to the
coefficients calculated for the fundamental and second (excluding 23 Hz and above) harmonics (O2 and Oz leads). It can also be noted that for the
coefficient, calculated for the second harmonic, photostimuli frequencies from 6 to 9 Hz can also be characterized as good in terms of the speed of response (O2 lead). For this subject it can be seen only for the second harmonic, but not for the fundamental. This once again emphasizes the importance of considering the response at multiples of frequencies.
Table 1 and
Table 2 present the results of calculating the
coefficient in the Oz lead for all subjects who participated in the experiment.
As can be seen from the data presented in
Table 1 and
Table 2, each subject’s reaction speed is highly individualized. Thus, subject 7 demonstrates extremely high
coefficient values at all presented photostimulus frequencies for both the fundamental and second harmonics. In contrast, subject 6 showed some of the worst results, up to a complete absence of response at the fundamental (
Table 1, frequencies 6, 10, and 11 Hz) and second (
Table 2, frequencies 10, 16, 18, and 20 Hz) harmonics. This once again emphasizes the need for an individual approach to each user when selecting stimulation frequencies in BCIs.
Figure 4 represents the dependence of the threshold, overcoming coefficient
on the photostimuli frequency for subject 3. This chart is presented for the fundamental and second harmonics of the stimulation frequencies for all occipital leads.
As can be seen from the figure above, subject 3 demonstrated the most stable threshold overcoming response at photostimuli frequencies from 13 to 18 Hz, as well as at 21 and 24 Hz, according to the
coefficient, calculated for the fundamental frequency (O2 and Oz leads). Although the level of his response in terms of the reaction
criterion
at the fundamental frequency was high enough from the stimulus frequency of 13 Hz to 25 Hz (
Figure 3), the coefficient
showed that not all of these photostimulus frequencies were able to produce a
response. It can also be noted that while the
coefficient, calculated for the second harmonic, (
Figure 3) identified photostimuli frequencies from 6 to 9 Hz as acceptable in terms of reaction
, the
coefficient showed that only the stimulus frequency at 9 Hz from the mentioned range was able to produce a
response at the second harmonic of photostimulus (O1, O2, and Oz leads). This example demonstrates that if one photostimulus frequency may be acceptable under one criterion, it does not mean that it will be acceptable under another criterion.
Table 3 and
Table 4 contain the results of calculating the
coefficient in the Oz lead for all subjects who participated in the experiment.
An analysis of the data presented in
Table 3 and
Table 4 also demonstrates the highly individual stability of the SSVEP potential response level caused by the photostimuli presentation. Thus, whereas subject 7 previously demonstrated an extremely high value of the
coefficient over the entire frequency range (
Table 1 and
Table 2), in this case, the 5 and 6 Hz photostimulus frequencies do not exhibit as consistent a response level as the subsequent frequencies for which the
coefficient was calculated at the fundamental frequency (
Table 3). This subject was also characterized by a significant decrease in the
coefficient calculated for the second harmonic from the photostimulus frequency of 16 Hz (32 Hz in
Table 4) to 20 Hz, as well as to 22 and 23 Hz. At the same time, for subject 6, who demonstrates an extremely low speed of response
(
Table 1 and
Table 2), the results obtained for the
coefficient values remain very low, except for the 13–16 Hz photostimulus frequencies for the
coefficient calculated at the fundamental frequency and the 22 Hz photostimulus frequency for the
coefficient calculated for the second harmonic (44 Hz in
Table 4).
The results of calculating the
coefficient for subject 3 are shown in
Figure 5. According to the
coefficient formula (Equation (
5)), the values close to one correspond to the photostimuli frequencies that evoke the fastest and most stable SSVEP potentials. Thus, this coefficient integrates both
and
coefficients and provides an indication of the frequency optimality according to two criteria at once.
Thus, in the case of subject 3, the photostimuli frequencies at 13, 15–18, 21, and 24 Hz correspond to high-enough (at least 0.95) values of the coefficient , calculated for the fundamental frequency (O2 and Oz leads). At the same time, for the coefficient calculated for the second harmonic, the photostimuli frequencies of 9, 13, 15, and 17 Hz correspond to values exactly equal to one (O1, O2, and Oz leads). It should be noted that for this participant, the photostimulus frequencies of 13, 15, and 17 Hz have maximum values of the coefficient at the second harmonic. This further validates the relevance of evaluating the response not only at the fundamental frequency but also at its harmonics.
The
coefficient values calculated for all other subjects are presented in
Table 5 and
Table 6.
Due to the fact that the
coefficient takes into account both
and
coefficients, it can be used as an indicator of frequency optimality in terms of response speed and stability. For example, subject 7 demonstrated equal-to-one values for the
coefficient calculated for fundamental frequency (
Table 5) in the photostimuli frequency range from 7 to 24 Hz because of high values for
(
Table 1) and
(
Table 3) coefficients. Similar values of the
coefficient calculated for the second harmonic are achieved for this subject in the first half of the used frequency range (
Table 6). Analyzing the
coefficient values for subject 3, who previously demonstrated very low values of
(
Table 1 and
Table 2) and
(
Table 3 and
Table 4) coefficients, the corresponding results can be seen. Thus, according to
Table 5, the subject only has 3 values of the
coefficient calculated for the fundamental frequency, namely, for 13, 15, and 16 Hz, which are close enough to one. The result of the calculation of the
coefficient at the second harmonic in the case of the photostimulus frequency of 22 Hz (44 Hz in
Table 6) can also be considered acceptable. These results suggest an extremely low ability of this subject to produce fast and stable SSVEP potentials, although this claim remains to be verified in practice. Nevertheless, even in this case, there were frequencies considered to be optimal, and one of them only corresponded to the second harmonic. This demonstrates that, by taking subharmonics into account, the frequency range used by the subject can theoretically be extended when the response at the fundamental frequency is too low or absent.
The values of the
coefficient calculated for the fundamental and second harmonics can be averaged to obtain an even more strict value of the
coefficient, since it equally accounts for the results achieved at the fundamental and multiple harmonics of a particular photostimulus frequency. The results of calculating the mean value of the
coefficients for the fundamental and second harmonics are shown in
Figure 6 for subject 3.
According to the values of this coefficient, we can assess which photostimuli frequencies are capable of producing the fastest and most stable SSVEP potentials on both the fundamental and second harmonics simultaneously. Thus, for subject 3, these are photostimuli with frequencies of 13 (O2 and Oz leads), 15–16 (O1 lead), and 17 (O2 and Oz leads) Hz. The results of calculating this coefficient for the remaining subjects are presented in
Table 7.
Based on
Table 7, the most optimal (exactly equal to one) frequencies for subject 7, who demonstrates the best results among all participants in terms of the
and
coefficients, are the photostimuli frequencies of 7–10 Hz and 12 Hz. At the same time, the subject still has enough numbers of the averaged coefficient
, as close to one as possible, namely, for the photostimuli frequencies 11, 13, 15, and 21 Hz. Subject 3, on the other hand, did not show any photostimulus frequency that could be recognized as optimal in terms of this coefficient because the maximum values of the coefficients
for the fundamental and second harmonics did not overlap with each other in the frequency range (
Table 5 and
Table 6).
Additionally, as mentioned above, for each of the participants involved in the experiment, and for each stimulation frequency, we calculated the theta–beta ratio. This ratio is considered in the context of this study as an indicator of subjective stress or discomfort experienced during prolonged stimulation at a specific frequency. Individual values of these calculated ratios are presented in
Table 8.
The analysis of the obtained data revealed that the mean value of the index for the entire sample was 6.09 (SD = 3.54) during stimulation session and 5.47 (SD = 4.14) during the resting state with eyes closed. These data, among other things, indicate high values of inter-subject variability of the measured index. When examining the plot of the index values for individual frequencies, a noticeable decline in theta–beta ratio scores is observed for males at frequencies of 20–21 Hz, with a tendency to return to average values with further increases in stimulation frequency (
Figure 7). The overall downward trend of the obtained values may indicate a decrease in discomfort when transitioning from a low- to high-frequency stimulation, which is consistent with existing literature data [
21]. Conducting a more detailed statistical analysis across groups that differ in terms of gender or stimulation frequency is challenging due to the small sample size within this pilot study.
The resulting theta–beta ratios are then normalized to a range of 0 to 1 according to Equation (
8) to obtain a discomfort coefficient
. An example of such normalization for subject 3 is shown in
Figure 8.
The values of this coefficient can additionally be used to filter out some of the optimal frequencies selected by the values of the coefficients, although it should be noted that they are highly empirical in nature, and the same value of this coefficient can mean a completely different level of discomfort for different subjects.
5.3. Coefficients Analysis Application
We used the C++ programming language and the Qt library version 5.14 to create an application with a graphical user interface. With the help of this application, it is possible to analyze the calculated coefficients and generate a list of optimal photostimuli frequencies for each subject. The app’s appearance is shown in
Figure 9.
This application consists of two sections. In the first section, located on the left, the user specifies the necessary input data used for analyzing the coefficients and generating a list of recommended stimulation frequencies. In the second section, located on the right, the user can view the results of the coefficient analysis performed according to the input parameters specified by them. Thus, in the upper part of this section, the user can view detailed information about any stimulation frequency for which coefficients have been calculated. In particular, this will allow the user to find out which criteria led to the exclusion of a particular frequency from the recommended list. The corresponding values that did not pass any criteria are colored in red. In the lower part of this section, there is a final list of recommended frequencies presented in the form of a table. Each row of the table is sorted in descending order of the stimulation frequency rating.
When starting to use the application, it is necessary to specify the path to the file with the coefficients calculated in MATLAB for each stimulation frequency (in the left part of the application). Then, the user must provide a set of criteria for selecting stimulation frequencies in the corresponding sections. The list of selection criteria available for setting was chosen in such a way that the user can adapt the behavior of the application to their goals and tasks. For example, the user can specify occipital leads for which the coefficient analysis needs to be performed. We added this feature to the application for the reason that a subject’s individual response to the presented frequencies may appear not only in the reaction level of the occurring SSVEP potential but also in the location of this response among the occipital electrodes. For example, in the previous section, in the phase of calculating the basic coefficients for subject 3, the vast majority of optimal coefficients were at the O2 and Oz electrodes, while the values for the O1 electrode were lower. However, this is not a strict rule and is highly dependent on subject differences. Thus, even in the case of subject 3, an example can be given where the highest response was found on electrode O1; it can be seen in
Figure 5 for photostimulus frequencies of 15 Hz (for the coefficient
calculated for the fundamental frequency) and 16 Hz (for the coefficient
calculated for the second harmonic). This allows for determining the rating of each frequency and identifying the most suitable EEG channel for searching for SSVEP potential at any stimulation frequency. If necessary, the user can specify the exact number of frequencies recommended by the application, depending on the requirements of the BCI, or leave this section disabled to turn off the frequency number limitation. In the following sections, the user needs to set the minimum permissible threshold values for the
and
coefficients proposed in this article.
Establishing minimum acceptable thresholds for these coefficients provides fine control over how the application prioritizes certain frequencies. For example, setting the coefficient threshold closer to one and decreasing the coefficient threshold will cause the application to prioritize stimulation frequencies with the most stable threshold overshoot of SNR. And if the user needs the fastest response to a stimulus, then it is possible to set the coefficient threshold close to one, and slightly decrease the coefficient threshold. In cases where there are strict requirements for response speed and SNR threshold overshoot, both thresholds of these coefficients can be set closer to one, although this may significantly reduce the final list of recommended frequencies.
The application also includes the ability to set minimum values for the three coefficients. The proximity of these coefficients to one depends heavily on the values of the and coefficients. Therefore, setting the minimum allowable values for the coefficients ensures that the mutual influence of the and coefficients will not result in the application selecting a frequency with a maximum value for one coefficient at the expense of significantly reducing the other. Instead, the application will maintain a balance between the values of the and coefficients by selecting stimulation frequencies that best satisfy the established thresholds for the , , and coefficients simultaneously. In this case, only the threshold coefficient with the maximum value will be considered for each photostimulus frequency. As a result, the list of recommended frequencies will also indicate which coefficient formula should be used to detect SSVEP potential at a given photostimulus frequency. This allows us to additionally consider stimulation frequencies where the SSVEP potential is exclusively present at the main or multiple stimulation frequencies. Additionally, this approach takes into account different time delays or response stabilities at the main and multiple frequencies, selecting the best option. Considering these factors expands the final list of recommended frequencies.
The process of selecting recommended frequencies in our application was designed in such a way that the first priority is given to searching for stimulation frequencies that exceed the threshold value of the coefficient. This ensures that the list primarily includes frequencies that produce a high response at both the main and multiple stimulation frequencies. The remaining frequencies are then selected in descending order of the values of the and coefficients, which are analyzed as a unified list. This approach allows us to properly take into account those subjects who are most characterized by SSVEP potentials occurring at multiple stimulation frequencies rather than at the main stimulation frequencies.
Finally, the user can set the maximum allowable discomfort coefficient
as the last threshold value. This allows the list of recommended frequencies to be adjusted by excluding frequencies that cause discomfort for the subject. For example, as shown in
Figure 9, our application excluded the frequency of photostimulation at 17 Hz from the list of recommended frequencies due to its high discomfort coefficient. However, this frequency passed all other threshold values set for the
,
, and
coefficients.
It is important to note that because SSVEP potentials can arise not just at the primary frequency but also at its multiples, some chosen frequencies might be mathematically incompatible. For example, the photostimuli presentation with a frequency of 5 and 10 Hz in both cases can provoke a reaction at 10 Hz, 20 Hz, etc. This feature is not taken into account in our application because its primary goal is to generate the most complete list of potentially usable frequencies.