Goertzel Transformation for Identification of Visual Evoked Potentials in Augmented Reality System
Reginaldo B Nunes1* ,Sandra MT Müller2 and Renato S Botacim3
Federal Institute of Espirito Santo Vitória-ES, Brazil
Submission:August 09, 2023; Published:August 24, 2023
*Corresponding author:Reginaldo B Nunes, Federal Institute of Espirito Santo Vitória-ES, Brazil
How to cite this article:Reginaldo B N ,Sandra MT M, Renato S B. Goertzel Transformation for Identification of Visual Evoked Potentials in Augmented Reality System. Curr Trends Biomedical Eng & Biosci. 2023; 21(5): 556071 DOI:10.19080/CTBEB.2023.21.556071
Abstract
Human-Machine Interfaces (HMIs) are suitable tools for communication between man and the environment around him. A strategy to achieve this interaction is to use biological signals such as the Electroencephalogram (EEG) signals. Thus, the EEG signals are acquired and processed aiming at translating the HMI user intention into machine language, and then sent it to an output device. Usually, these interfaces must take a decision outcome in a short time, such as from 1 s to 2 s. This short decision update time demands a process optimization and reduction of computational cost. Among the EEG signal paradigms used in the HMIs, there are the Steady-State Visual Evoked Potentials (SSVEPs). Here, the users are stimulated with visual flickering stimuli and the interface is responsible For identify the stimulus frequency and the correspondent output action. The actual work proposes the development of a smartphone application using Augmented Reality (AR). This application emulates a maze game and the EEG signals are processed using the Goertzel transform, which is able to deal with short decision time.
Introduction
Currently, technology provides advances in the interaction between the human being and the computer known as Human-Machine Interface (HMI) or Human-Computer Interface (HCI). These interfaces, which were previously limited to traditional methods such as keyboard and mouse, gained new perspectives with the advent of new technologies such as touch screen interfaces, voice commands using natural language, and also through brain signals [1]. Commonly, the HMIs based on brain signals use the Electroencephalogram (EEG) signal. Among the EEG paradigms, this work uses the Steady-State Visual Evoked Potentials (SSVEPs). These potentials are brain responses well-measured in the visual and parietal cortical areas considering flickering visual stimulation [2]. The SSVEPs are widely used in Brain Computer Interfaces (BCIs), as well as other kinds of Human-Machine Interfaces (HMIs), which allow their user to choose commands associated with different stimulus frequencies.
SSVEPs are predominantly characterized in the frequency domain. Therefore, the Fourier transform is the most used mathematical tool for identifying the stimulation frequencies. However, this paper proposes the use of Goertzel transform with low computational cost and processing time, allowing system portability. This work also presents the integration of EEG signal processing with an augmented reality application, for the improvement of usability and accessibility of this portable system. The remainder of this paper is organized as follows. Section 2 describes the applied methodology; Section 3 discusses about the EEG signal processing; Section 4 describes the achieved results and Section 5 provides some discussion and conclusion.
Materials and Methods
Equipment and EEG Electrodes
The EEG signals were acquired using BrainNet-36 equipment, developed by the company LYNx Electronic Technology, Figure 1(a). The 12 EEG electrodes used were P7, P5, P6, P8, PO7, PO3, POz, PO4, PO8, O1, O2 and Oz, Figure 1(b). The reference and ground electrodes were positioned in the left ear and the forehead, respectively. The sampling frequency was 600 sample/s.
Acquisition Protocol and Volunteers
Four volunteers (2 males and 2 females) with an average age of 37.3 years and a standard deviation of 15.9 observed four stimuli flashing at different frequencies, one at a time for 1 min each. The stimulus frequencies were 5.6, 6.4, 7.9, and 8.9 Hz, in this order. A rest time of 30 s was taken between the trials. The experiments were performed according to the rules of the Ethics Committee of the Federal Institute of Espirito Santo, under registration number CAAE 24521019.0.0000.5072. Here, the volunteers were called as V_A, V_B, V_R, V_S. The total number of samples for each EEG channel and each stimulus frequency was 36000 samples (60 seconds x 600 samples/s). The data were also organized in a multidimensional structure of 4 (volunteers) x 4 (frequencies) x 12 (channels) x 36000 (samples). Analysis windows of 4 s (2400 samples) with an overlap of 3 seconds (1800 samples) were used, allowing decision-making every second. These parameters are according to [3].
Maze Game
The smartphone game was built using the Unity engine according to the layout presented in Figure 2. The layout has been mirrored across two images to create a single maze image when they are overlapped. This is a requirement for using augmented reality glasses. The stimulus frame scripts (green frames placed on the top and bottom parts and on the sides) were developed in the C# programming language and structured using system threads, to increase the accuracy of the stimulation frequencies.
Pre-Processing
The raw acquired EEG signal was processed in three steps. Firstly, is was the filtering procedure, to prepare the signal for the second stage, which was the Goertzel transform. Then, the outcome is rated by three decision heuristics that will identify the stimulus frequency and the command associated. The four stimulus frequencies were 5.6 Hz, 6.4 Hz, 7.9 Hz, and 8.9 Hz, corresponding to the movement commands of up, right, down, and left, respectively.
Filtering Procedure
Initially, the continuous components are withdrawn from the raw EEG signal (signalc). The mean value μ was determined for each channel and the resulting signal (signals), was calculated such as presented in Equation (1).

Then, a Common Average Reference (CAR) was applied as spatial filtering. For that, the mean value ρ was determined for each sample considering all the twelve EEG channels. The resulting signal (signalf) was calculated for each sample and each channel as presented in Equation (2).

The final filtering operation consists of applying a 5-order elliptic IIR filter to the signalf over a frequency range from 3 to 35 Hz.
Goertzel Transform
The Goertzel transform evaluates individual terms of the Discrete Fourier Transform (DFT) [4,5]. It operates in a twostep proceeding. The first step acts as a second order IIR filter to calculate an intermediate sequence z[n] from the discrete sequence x[n] (signalf). The sequence z[n] is determined as described in Equations (3) and (4):

where z[n − m] is the intermediate sequence delayed of m samples, N is the total number of samples used in the calculation, Fi is the desired frequency, and Fs is the sampling frequency. In Equation (5), k is the ratio of the desired frequency to the sample frequency, multiplied by the number of samples. The second step corresponds to the FIR filter of the output sequence y[n] (signalg). This output represents the amplitude of the signal spectrum at the desired frequency and considers the intermediate sequence z[n] according to Equation (5):

The Goertzel transform output, signalg, is examined to identify the frequency stimulus in which the user was submitted. The spectral amplitude at each known stimulus frequency is used to identify the stimulus. The Goertzel algorithm is applied to each signal window in the database for all the twelve channels (Cj) and the four stimulus frequencies (Fi). Equation (6) shows how to determine this value.

where Fe is the stimulus frequency identified; Fi is the i-th stimulus frequency of interest; Y is the maximum spectral amplitude and y[n]ij is the spectral amplitude corresponding to the stimulus frequency Fi in the channel Cj.
Decision Heuristics
Three heuristics were developed to evaluate the stimulus frequency from the Goertzel transform outcome. These heuristics considered three rates: (i) correct identification rate of stimulus frequency under analysis, equivalent to True Positive (TP); (ii) stimulation frequency misidentification rate, equivalent to False Positive (FP); and, (iii) non-identification rate of any stimulation frequency, equivalent to the sum of True Negative and False Negative, which was named as Non-Identified (NI) [6-10]. Goertzel algorithm was applied for all possible stimulus frequencies (5.6 Hz, 6.4 Hz, 7.9 Hz, and 8.9 Hz). In some cases, the second harmonics of these frequencies (11.2 Hz, 12.8 Hz, 15.8 Hz, and 17.8 Hz) were also considered to improve the stimulation frequency identification heuristic. Once the stimulus frequency is identified, the toy dummy moves accordingly in the Maze game, shown in Figure 2. The three heuristics are described as follows.
i. First Heuristic - The highest spectral density peak was determined considering the 12 EEG signal channels and the four stimulus frequencies at their fundamental component. The statistical mode was obtained, i.e., the stimulation frequency that appears most. The same procedure is performed considering the second harmonics of these frequencies. If the stimulus frequency identified considering the fundamental components is identical to the choice considering the second harmonics, then it is the stimulation frequency. Otherwise, the frequency is considered unidentified (NI). The success (VP) or error (FP) identification is made by comparing the identified frequency to the actual one.
ii. Second Heuristic - Here, the highest spectral density peak was determined considering just the three occipital channels (O1, O2, and Oz) at the stimulus frequency fundamental component. The same procedure is performed considering their second harmonic. The outcome from first harmonic analysis is compared to the second harmonic analysis outcome for each occipital canal. If these two outcomes are the same, the stimulus frequency was identified for that occipital. Otherwise, the result from this channel is discarded. Next, if the outcome from Oz channel was not discarded, it will be the stimulus frequency identified in this heuristic, even if O1 and O2 gave another outcome. This means that the response of the Oz channel takes precedence over the other two occipital channels. If the analysis of the Oz channel is discarded, the outcome from O1 and O2 channels are compared. In case of these two channels have the same result, it will be the identified frequency. Otherwise, the frequency is considered unidentified (NI). The success (VP) or error (FP) identification is made by comparing the identified command with the actual stimulus frequency.
iii. Third Heuristic - Again, the highest spectral density peak was determined considering just the three occipital channels (O1, O2, and Oz) at the stimulus frequency fundamental component. The same procedure is performed considering their second harmonic. Once again, the statistic mode among the stimulation frequencies is determined considering the fundamental components and the second harmonics of the three occipital canals. Unlike the second heuristic, if the mode corresponds to the stimulation frequency identified only by the OZ channel, it will be the stimulation frequency identified. Otherwise, the frequency is considered unidentified (NI). The success (VP) or error (FP) identification is made by comparing the identified command with the actual stimulus frequency.
Results
The results about the heuristics performance in stimulus frequency identification are presented in Table 1. It can be seen that volunteer V_A has the best performance, regardless of the heuristic employed. However, the other volunteers have a variation in performance according to the heuristic used. Note that just as important as having a high hit rate (TP) is having a low misclassification rate (FP). This is a crucial characteristic in the development of an HMI, as its user must be sure that the identified command corresponds to the desired one. After these initial results, the volunteer V_A tested the entire system with the electrode cap and the AR glasses, as shown in Figure 3(a). He was instructed to gaze at the stimulus frames following the sequence: right, up, left, up, right, and down, for 15 s each patch, totalizing a stimulation interval of 90 seconds. The path taken by the volunteer V_A is shown in Figure 3(b). This would correspond to the toy movement in the maze game shown in Figure 2.




Conclusion
This work demonstrated that the Goertzel transform is suitable for SSVEP-based interfaces since it simplifies these potential representations with low computational cost. For instance, this HMI was also implemented in a raspberry pi 4, with 4 GB of RAM. The game development on the smartphone, coupled with the VR glasses allowed greater comfort for the volunteers during the signal collection process. All the developed heuristics that use the first and second harmonic from the stimulus frequencies presented higher performance, reducing the erroneous commands and avoiding frustrating the volunteers. As future work, the processing algorithm and heuristics should be optimized aiming at obtaining better performance. It is also recommended to redesign the layout of the maze game so that its interface is more friendly and comfortable for the users.
References
- Muller, Sandra MT (2012) Interface Cérebro-computador Baseada em Potenciais Evocados Visuais em Regime Permanente para Comando de uma Cadeira de Rodas Robó 141 f. Thesis (Doctoral Thesis) Federal University of Espírito Santo.
- Vialatte FB, Maurice M, Dauwels J, Cichocki A (2010) Steady-state visually evoked potentials: focus on essential paradigms and future perspectives. Progress in neurobiology 90(4): 418-438.
- Botacim RS, Franca IPL, Nunes RB, Muller SMT (2021) Incremental EEG Analysis using Goertzel Transform for SSVEP-based HMI. In: Brazilian Symposium on Intelligent Automation-SBAI 1(1).
- Sridharan K, Chitti Babu B, Muthu Kannan P, Krithika V (2015) Modelling of Sliding Goertzel DFT (SGDFT) based phase detection system for grid synchronization under distorted grid conditions. Procedia Technology 21: 430-437.
- Sundararajan P, Santik MHM, Sasongko F, Tan CS, Pou J, et al. (2020) Condition monitoring of dc-link capacitors using goertzel algorithm for failure precursor parameter and temperature estimation. IEEE Transactions on Power Electronics.
- Goertzel G (1958) An algorithm for the evaluation of finite trigonometric series. The American Mathematical Monthly 65(1): 34-35.
- Manolakis DG, Ingle VK, Kogon SM (2005) Statistical and adaptive signal processing: spectral estimation, signal modeling, adaptive filtering, and array processing. Boston: Artech House.
- Muller, Sandra MT, Bastos-Filho TF, Sarcinelli-filho M (2015) Monopolar and bipolar electrode settings for SSVEP-based brain-computer interface. Journal of Medical and Biological Engineering (4): 482-491.
- Volosyak I, Luth T, Malechka T, Graser A (2011) BCI demographics II: How many (and what kinds of) people can use a high frequency SSVEP BCI? IEEE Transactions on Neural Systems and Rehabilitation Engineering 19(3): 232239.
- Zapała D, Augustynowicz P, Cudo A, Jaśkiewicz M, Szewczyk M, et al. (2020) The effects of handedness on sensorimotor rhythm desynchronization and motor-imagery BCI control. Scientific reports 10(1): 1-11.