[Feature Extraction] Extract brainwave delta, theta, alhpa, beta, and gamma based on Matlab

v

Personal homepage: Matlab Research Studio

Personal credo: Investigate things to gain knowledge.

For more complete Matlab code and simulation customization content, click

Intelligent optimization algorithm Neural network prediction Radar communication Wireless sensor Power system

Signal processing Image processing Path planning Cellular automaton Drone

Content introduction

Brain waves are electrical signals emitted by the human body, which can be analyzed and studied through brain wave algorithms. Brainwave algorithms can be divided into five types: delta, theta, alpha, beta and gamma, each type has its unique characteristics and applications. The steps of these five brainwave algorithms will be introduced in detail below.

The first is the delta wave algorithm. Delta wave is a low-frequency brain wave with a frequency range between 0.5-4Hz. Delta waves mainly appear in deep sleep and coma. The steps of the Delta wave algorithm are as follows:

1. Collect EEG signals: Use EEG acquisition equipment to collect EEG signals from the subject’s head.

2. Preprocess data: Preprocess the collected EEG signals, including filtering, removing noise, etc.

3. Analyze data: Analyze the preprocessed EEG signals and extract the delta waves.

4. Statistical analysis: Perform statistical analysis on the extracted delta waves, including average value, standard deviation, etc.

5. Interpretation of results: Interpret the results based on the statistical analysis results to further study the characteristics and applications of delta waves.

Next is the theta wave algorithm. Theta waves are lower frequency brain waves with a frequency range between 4-8Hz. Theta waves mainly occur during sleep, relaxation and meditation states. The steps of the Theta wave algorithm are as follows:

1. Collect EEG signals: Use EEG acquisition equipment to collect EEG signals from the subject’s head.

2. Preprocess data: Preprocess the collected EEG signals, including filtering, removing noise, etc.

3. Analyze data: Analyze the preprocessed EEG signal and extract the theta wave.

4. Statistical analysis: Perform statistical analysis on the extracted theta waves, including average value, standard deviation, etc.

5. Interpretation of results: Interpret the results based on the statistical analysis results to further study the characteristics and applications of theta waves.

The second is the alpha wave algorithm. Alpha wave is a higher frequency brain wave with a frequency range between 8-13Hz. Alpha waves mainly appear in states of relaxation, rest and meditation. The steps of Alpha wave algorithm are as follows:

1. Collect EEG signals: Use EEG acquisition equipment to collect EEG signals from the subject’s head.

2. Preprocess data: Preprocess the collected EEG signals, including filtering, removing noise, etc.

3. Analyze data: Analyze the preprocessed EEG signals and extract the alpha waves.

4. Statistical analysis: Perform statistical analysis on the extracted alpha waves, including average value, standard deviation, etc.

5. Interpretation of results: Interpret the results based on the statistical analysis results to further study the characteristics and applications of alpha waves.

Then there is the beta wave algorithm. Beta waves are high-frequency brain waves with a frequency range between 13-30Hz. Beta waves mainly appear in states of anxiety and tension. The steps of the Beta wave algorithm are as follows:

1. Collect EEG signals: Use EEG acquisition equipment to collect EEG signals from the subject’s head.

2. Preprocess data: Preprocess the collected EEG signals, including filtering, removing noise, etc.

3. Analyze data: Analyze the preprocessed EEG signals and extract the beta waves.

4. Statistical analysis: Perform statistical analysis on the extracted beta waves, including average value, standard deviation, etc.

5. Interpretation of results: Interpret the results based on the statistical analysis results to further study the characteristics and applications of beta waves.

Finally, there is the gamma wave algorithm. Gamma waves are very high-frequency brain waves with a frequency range between 30-100Hz. Gamma waves mainly appear when the intensity of brain activity is high. The steps of the Gamma wave algorithm are as follows:

1. Collect EEG signals: Use EEG acquisition equipment to collect EEG signals from the subject’s head.

2. Preprocess data: Preprocess the collected EEG signals, including filtering, removing noise, etc.

3. Analyze data: Analyze the preprocessed EEG signals and extract the gamma waves.

4. Statistical analysis: Perform statistical analysis on the extracted gamma waves, including average value, standard deviation, etc.

5. Interpretation of results: Interpret the results based on the statistical analysis results to further study the characteristics and applications of gamma waves.

In summary, the brainwave delta, theta, alpha, beta, and gamma algorithm steps are to study the characteristics and applications of brainwaves at different frequencies through the steps of collecting brainwave signals, preprocessing data, analyzing data, statistical analysis, and result interpretation. These algorithms can be applied to the research and analysis of brain electrical signals, providing important tools and methods for studying the functions and behaviors of the human brain.

Part of the code

function [ pxx,fpow,powerFeatures ] = powerSort( inSignal,fs )
%powerSort finds the power spectral density and signal power of each rhythm band
% inSignal input signal
% fs sampling frequency
% pxx power spectral density
% fpow frequency vector
% powerFeatures Array composed of signal power of each rhythm band
    %Use welch method to extract power spectral density
    [pxx, fpow] = pwelch(inSignal, [], [], [], fs); % Calculate the power spectral density of the signal with baseline and power frequency removed
    %Calculate the average signal power of each rhythm band
    power_delta = bandpower(pxx, fpow, [0.5, 3], 'psd');
    power_theta = bandpower(pxx, fpow, [4, 7], 'psd');
    power_alpha = bandpower(pxx, fpow, [8, 13], 'psd');
    power_beta = bandpower(pxx, fpow, [14, 30], 'psd');
    power_gamma = bandpower(pxx, fpow, [31, 60], 'psd');% It can be seen from the power spectrum that there is basically no amplitude after 50HZ
    %average power array of each rhythm
    powerFeatures=[power_delta,power_theta,power_alpha,power_beta,power_gamma];
end

Running results

[Feature Extraction] Extract brainwave delta, theta, alhpa, beta, gamma_drone

[Feature Extraction] Extract brain waves delta, theta, alhpa, beta, gamma_drone_02
edit

References

[1] Dong Yan, Xu Ruijuan, Shi Yali, et al. Effects of hormone pulse therapy on the path length of brain functional network attributes in children with infantile spasms [J]. Chinese Journal of Practical Diagnosis and Treatment, 2022, 36(4):5 .

[2] Zhu Xiujin. Music adjustment system based on EEG signals of autistic children[D]. Jinan University[2023-10-21].

Some theories are quoted from online literature. If there is any infringement, please contact the blogger to delete it
Follow me to receive massive matlab e-books and mathematical modeling materials

Private message complete code, paper reproduction, journal cooperation, paper tutoring and scientific research simulation customization

1 Improvement and application of various intelligent optimization algorithms
Production scheduling, economic scheduling, assembly line scheduling, charging optimization, workshop scheduling, departure optimization, reservoir scheduling, three-dimensional packing, logistics location selection, cargo space optimization, bus scheduling optimization, charging pile layout optimization, workshop layout optimization, Container ship stowage optimization, water pump combination optimization, medical resource allocation optimization, facility layout optimization, visible area base station and drone site selection optimization
2 Machine learning and deep learning
Convolutional neural network (CNN), LSTM, support vector machine (SVM), least squares support vector machine (LSSVM), extreme learning machine (ELM), kernel extreme learning machine (KELM), BP, RBF, width Learning, DBN, RF, RBF, DELM, XGBOOST, TCN realize wind power prediction, photovoltaic prediction, battery life prediction, radiation source identification, traffic flow prediction, load prediction, stock price prediction, PM2.5 concentration prediction, battery health status prediction, water body Optical parameter inversion, NLOS signal identification, accurate subway parking prediction, transformer fault diagnosis
2. Image processing
Image recognition, image segmentation, image detection, image hiding, image registration, image splicing, image fusion, image enhancement, image compressed sensing
3 Path planning
Traveling salesman problem (TSP), vehicle routing problem (VRP, MVRP, CVRP, VRPTW, etc.), UAV three-dimensional path planning, UAV collaboration, UAV formation, robot path planning, raster map path planning , multimodal transportation problems, vehicle collaborative UAV path planning, antenna linear array distribution optimization, workshop layout optimization
4 UAV application
UAV path planning, UAV control, UAV formation, UAV collaboration, UAV task allocation, and online optimization of UAV safe communication trajectories
5 Wireless sensor positioning and layout
Sensor deployment optimization, communication protocol optimization, routing optimization, target positioning optimization, Dv-Hop positioning optimization, Leach protocol optimization, WSN coverage optimization, multicast optimization, RSSI positioning optimization
6 Signal processing
Signal recognition, signal encryption, signal denoising, signal enhancement, radar signal processing, signal watermark embedding and extraction, EMG signal, EEG signal, signal timing optimization
7 Power system aspects
Microgrid optimization, reactive power optimization, distribution network reconstruction, energy storage configuration
8 Cellular Automata
Traffic flow, crowd evacuation, virus spread, crystal growth
9 Radar
Kalman filter tracking, track correlation, track fusion