Emotion Detection from EEG signals with Continuous Wavelet Analyzing

Majid Memarian Sorkhabi

  Open Access OPEN ACCESS  Peer Reviewed PEER-REVIEWED

Emotion Detection from EEG signals with Continuous Wavelet Analyzing

Majid Memarian Sorkhabi

Instructor in University College of Roshdiyeh Group of Electronics Eng. Tabriz, Iran


Recently, the field of Brain-Computer interface has gained a great deal of attention. In this work, we present some promising results of our research in classification of emotions induced by watching music videos. More specially, we aim to analyze users' passive physiological responses as they watch video clips. We use DEAP data base for this purpose. We show robust correlations between users’ self-assessments of arousal and valence and the frequency Entropy and powers of their EEG activity. Also we found that high frequency bands give higher accuracy than low frequency bands especially EEG in Gamma band that give accuracy at 73.84% (for valence) and 69.82% (for arousal). EEG signals were decomposed to 5 frequency bands by Continuous Wavelet Transform (CWT) using the 2.8 Biorthogonal wavelet.

At a glance: Figures

Cite this article:

  • Sorkhabi, Majid Memarian. "Emotion Detection from EEG signals with Continuous Wavelet Analyzing." American Journal of Computing Research Repository 2.4 (2014): 66-70.
  • Sorkhabi, M. M. (2014). Emotion Detection from EEG signals with Continuous Wavelet Analyzing. American Journal of Computing Research Repository, 2(4), 66-70.
  • Sorkhabi, Majid Memarian. "Emotion Detection from EEG signals with Continuous Wavelet Analyzing." American Journal of Computing Research Repository 2, no. 4 (2014): 66-70.

Import into BibTeX Import into EndNote Import into RefMan Import into RefWorks

1. Introduction

The interaction between humans and computers is one of the hot research topics in the world. Most people use a simple keyboard and mouse to give instructions to the computer, and that works fine for most tasks. But newer forms of human computer interaction have been invented.

The quality of speech recognition by computers is improving every day and becoming more and more common in consumer products. Arm movement is used when playing games on Nintendo's new game console.

In addition to these existing ways of interacting with computers, the use of brain activity is becoming increasingly popular. This method is called a Brain Computer Interface (BCI). In theory, everything somebody does or says has its origin in his brain, and when using that activity for human computer interaction, much other information could be used, and the possibilities seem endless [1].

Other side, Emotion is an important aspect in the interaction and communication between people. Even though emotions are intuitively known to everybody, it is hard to define emotion. The Greek philosopher Aristotle thought of emotion as a stimulus that evaluates experiences based on the potential for gain or pleasure. Years later, in the seventeenth century, Descartes considered emotion to mediate between stimulus and response [2].

A. Ease of Use Continuous Models of Emotion

Continuous models of emotion have also been proposed. The arousal-valence scale, first proposed by Russell [3] is a much used scale in research on affect. The concept is that each emotional state can be placed on a two-dimensional plane with arousal and valence as the axes. Arousal can range here from inactive (e.g. uninterested, bored) to active (e.g. alert, excited), whereas valence ranges from unpleasant (e.g. sad, stressed) to pleasant (e.g. happy, elated). Figure 1 illustrates this concept.

Figure 1. An illustration of the arousal-valence scale

B. EEG Signals Analysis

Traditionally, Electroencephalography (EEG) measurements have been used for clinical purposes, for instance to diagnose epilepsy and locate the origin of epileptic seizures. Patients that suffer from locked-in syndrome are almost completely paralyzed and incapable of communicating with the outside world, in spite of retaining functionality in the upper brain and full consciousness and awareness of their surroundings.

The brain activity can be coarsely divided into different classes. This division follows the way the activity is produced by the brain.

The neurons of the brain produce together a rhythmic signal that is constantly present. This signal can be divided into several bands, based on the frequency. This division is illustrated in Figure 2.

Delta band: The delta band is the frequency band up to 3Hz. Delta activity is mainly seen in deep sleep. In this stage delta waves usually have large amplitudes (75-200 μV) and show strong coherence all over the scalp.

Theta band: The theta band consists of frequencies between 4Hz and 7Hz. This activity can be observed with drowsiness or meditation. In the latter case theta waves are associated with gamma activity. Occurrence of theta rhythm can also be connected with the slowing of alpha rhythms due to pathology. Theta waves are predominant in rodents; in this case the frequency range is broader (4-12 Hz) and waves have high amplitude and characteristic saw tooth shape.

Alpha band: The alpha band is the so-called `basic rhythm' and contains the frequencies between 8Hz and 12Hz. It is seen when people are awake, and is known to be more apparent when eyes are opened. They are blocked or attenuated by attention (especially visual) and by mental effort. These waves have a frequency band similar to alpha, but their shape resembles the Greek letter μ. They are prevalent in the central part of the head and are related to the function of motor cortex, namely they are blocked by motor actions.

Beta band: The beta band contains frequencies between 13Hz and 30Hz. This band is apparent with active thinking or concentration. Beta activity is characteristic for the states of increased alertness and focused attention, as was shown in several animal and human studies.

Gamma band: The Gamma band consists of frequencies up to 30Hz. It is connected with information processing, e.g., recognition of sensory stimuli and the onset of voluntary movements. High frequency gamma rhythms are linked to neuronal spikes. They are correlated with the degree of functional activation of the brain and are relevant to cortical computations.

For these cases, several applications have been developed that use EEG to restore some communicative abilities, for instance a system for spelling words, and a system to move a mouse cursor on a screen. EEG is also frequently used in research for understanding cognitive processes [4].

More recently, research has begun in tapping the potential of using EEG as a brain computer interface. In this paradigm, EEG can also be used by healthy people as an additional method of human machine interaction. One emerging application of BCIs are their use in games. In Brain ball [5], the ratio between participants' alpha and beta brainwaves is measured and used to control the movement of a ball. Object of the game is to relax more than your opponent and thereby move the ball to the opponent's side of the table.

The analysis of EEG signals for brain-computer interfaces mainly focuses on Event Related Potentials (ERPs) or Spectral-power features. Other possible features, such as different kinds of evoked potentials, can also be used for games and control mechanisms.

The voltage changes comprising an ERP are generally on the order of micro volts, where as the EEG waveform overall contains amplitudes of tens of micro volts. This means the ERP is not readily visible in the EEG, so signal processing techniques are required to discriminate between the ERP and the background EEG. The predominant technique to increase this discrimination is the averaging of (synchronized) samples recorded in response to several repetitions of the same stimulus. The ERP is assumed to be time-locked to the external stimulus, in contrast to the background EEG, which is assumed to vary randomly from trial to trial. Therefore, the averaging should reduce the background EEG, while leaving the ERP mostly intact.

2. Methods and Materials

A. DEAP Database

The DEAP database based on Valence-Arousal-Dominance emotion model was published in [7]. 32 Healthy participants (50% male), aged between 19 and 37 (mean age 26.9), participated in the data collection. The stimuli to elicit emotions used in the experiment were one-minute long music videos, which are considered as combined visual and audio stimuli. Each user was shown 40 music video clips and for each video; ERP modalities were recorded. The 40 video clips were carefully pre-selected so that their intended arousal and valence values span as large as possible an area of the arousal-valence space.

Each participant was asked to grade each clip after the viewing giving discrete values from 1 to 9 for arousal and valence. The participant’s labels for arousal and valence were taken as the true labels of the predominant emotion experiences throughout viewing the clip. Here, we used the dataset of the preprocessed EEG provided in MATLAB format [7]. The sampling rate of the original recorded data is 512 Hz, and the set of preprocessed data is down sampled to 128 Hz. The preprocessing included also removing artifacts from EOG and applying a band pass frequency filter from 4.0–45.0 Hz to the EEG data.

As suggested by the developers of DEAP, this dataset is well-suited for testing new algorithms. Thus, in our work, we used the dataset to validate the proposed algorithm. More details about the DEAP database would be found in [7].

B. Channel Selection

Different EEG channels have different characteristics. This has to do with the electrode montage, the electrode itself also with the location on the skull. These variations might introduce noise or artifacts, but can also result in a deviation of the mean of the signal from zero. All possible channels are shown in Figure 3.

Coan et al. [8] showed that positive emotions are associated with relatively greater left frontal brain activity whereas negative emotions are associated with relatively greater right frontal brain activity. They also showed that the decrease in the activity in other regions of the brain such as the central, temporal and mid-frontal was less than the case in the frontal region. Therefore in this research we use frontal pairs of channels: FP1-FP2. FP1 is used for positive emotions detection and FP2 is used for negative emotions detection[9].

C. Future Extraction

In this study, continuous wavelet transform was used to extract statistical features from ERP signals. CWT is a non-linear transform that gives a time-resolved description for a large variety of signals.

Continuous analysis is often easier to interpret, since its redundancy tends to reinforce the features and makes all information more visible. When the signal is recorded in continuous time (like this paper), it is apparent that CWT is more useful than discrete wavelet transform (DWT).

The mother wavelet function is given as:


Where , and R is the wavelet space. Parameters ‘a’ and ‘b’ are the scaling factor and the shifting factor, respectively, since choosing a prototype function as the mother wavelet should always satisfy the admissibility condition (Equation 2):


Where is the Fourier transform of .

3. Results and Discussion

First of all we plot FP1-FP2 pair channels in time domain when participant watched valance video. This is shown in Figure 4. As you see, not any valuable and interpretive signals are plotted.

Now Fourier transform of this signals are plotted. This is shown in Figure 5. It is clear that during the valance emotion in participant, high frequency change is occurred in the electrical activity of the neurons inside the brain.

For many signals, Fourier analysis is extremely useful because the signal’s frequency content is of great importance. So why do we need other techniques, like wavelet analysis?

Fourier analysis has a serious drawback. In transforming to the frequency domain, time information is lost. When looking at a Fourier transform of a signal, it is impossible to tell when a particular event took place.

If the signal properties do not change much over time - that is, if it is what is called a stationary signal - this drawback isn’t very important. However, most interesting signals (like EEG) contain numerous non stationary or transitory characteristics: drift, trends, abrupt changes, and beginnings and ends of events. These characteristics are often the most important part of the signal, and Fourier analysis is not suited to detecting them.

Wavelet analysis represents the next logical step: a windowing technique with variable-sized regions. Wavelet analysis allows the use of long time intervals where we want more precise low-frequency information, and shorter regions where we want high-frequency information.

Figure 6 shows 2D plot and Figure 7 depicts 3D plot of the wavelet transform of FP1-FP2 EEG channels with 2.8 Biorthogonal wavelet. At this diagram, time variances of EEG signals are obviously clear.

Figure 6. 2D plot of Continous wavelet of FP1-FP2 EEG channels
Figure 7. 3D plot Continous wavelet of FP1-FP2 EEG channels

We can detect the electrical activity of the neurons inside the brain at the each second. So ERP analyzing is so meaningful in wavelet transform.

For extract details change in the wavelet coefficient, we can use Energy concept in the wavelet. The energy can be calculated by squaring the wavelet coefficients on each frequency sub-bands:


Where SC is the percentage of the scalogram coefficient Energy. Figure 8 shows the SC of FP1-FP2 EEG channels in the valance Emotions. We can easily find peak of emotion time in the video. Wavelet Coefficient energy histogram is plotted in Figure 9.

Entropy is a numerical measure of the randomness of a signal. Entropy can act as a strong feature and used to analyze psychological time series data. Here, the entropy refers to the entropy of the wavelet coefficients, instead of the one signal itself. The energy distribution of the wavelet coefficients can be described by Shannon entropy. Equation (5) shows this phenomenon.

Figure 8. FP1-FP2 EEG channels wavelet transform coefficient energy
Figure 9. Wavelet Coefficient energy histogram is plotted

where is the energy probability distribution of wavelet coefficients and calculated in Equation (6).


From the probability principle, we find the bound of the entropy of the wavelet coefficients in Equation (7).


If all the other wavelet coefficients are equal to zero except for one coefficient, the entropy equals to zero. If the probability distribution is uniform, which means all the wavelet coefficients are the same (i.e. 1/N), the entropy equals to log2N. Therefore, the lower the entropy is, the higher energy concentration is.

4. Conclution

Given their multi resolution temporal and spectral locality, wavelets are powerful candidates for decomposition, feature extraction, and classification of non-stationary electroencephalographic signals for brain-computer interface applications.

The reliable and accurate classification of features extracted from electroencephalographic signals is a central task to the deployment of a brain computer interface.

In this research, DEAP data based signals were used for emotion detection from EEG signals. For this purpose EEG signals was decomposed to 5 frequency bands by Continuous Wavelet Transform using the 2.8 Biorthogonal wavelet. Then the energy and entropy from each band widths computed to be the features. In Gamma band that give accuracy at 73.84% (for valence) and 69.82% (for arousal). All of these are beneficial to the development of emotion classification system using CWT.


I would like to thank Dr. Sehhat khah, chancellor of university collage of Roshdiyeh, for his support and advice was invaluable in the production of this research. Thanks also go out to Mr. Daj, Vice chancellor of university collage of Roshdiyeh, for the great collaboration over the years.


[1]  R. Horlings, Emotion recognition using brain activity, PhD dissertation, March 2008.
In article      
[2]  J. Villegas. Definition of emotion. http://www.ciadvertising.org/studies/student/97_fall/theory/emotion/ea/definition.html, 1997.
In article      
[3]  J. Russell., A circumplex model of a_ect. Journal of personality and social psychology, Vol. 39 (6), 1980, pp. 1161-1178.
In article      CrossRef
[4]  E. Niedermeyer and F. Da Silva., Electroencephalography: basic principles, clini-cal applications, and related fields, Lippincott Williams & Wilkins,, 2005, pp. 13-15.
In article      
[5]  S. Hjelm and C. Browall. Brainball-Using brain activity for cool competition, In Proceedings of NordiCHI, 2000, pp. 177.
In article      
[6]  J. Katarizna, and others, Practical Biomedical signal Analysis, CRC press, 2012.
In article      
[7]  S. Koelstra, and others, DEAP: A Database for Emotion Analysis using Physiological Signals, IEEE Transactions on Affective Computing, 2011, pp. 1-15.
In article      
[8]  J. Coan, J. Allen, and E. Harmon-Jones, Voluntary facial expression and hemispheric asymmetry over the frontal cortex, Psychophysiology, Vol. 38, No. 06, 2002, pp. 912-925.
In article      CrossRef
[9]  Thibodeau, R., Jorgensen, R. S., & Kim, S., Depression, anxiety, and resting frontal EEG asymmetry, a meta-analytic review. Journal of Abnormal Psychology, 115 (4), 2006, 715-729.
In article      CrossRefPubMed
  • CiteULikeCiteULike
  • MendeleyMendeley
  • StumbleUponStumbleUpon
  • Add to DeliciousDelicious
  • FacebookFacebook
  • TwitterTwitter
  • LinkedInLinkedIn