Skip to main content

Crate elata_eeg_models

Crate elata_eeg_models 

Source
Expand description

EEG Analysis Models

This crate provides analysis models that process EEG data from the HAL. Currently implemented models:

  • Alpha Bump Detection: Detects changes in alpha band power, indicating transitions between relaxed (eyes closed) and alert (eyes open) states.

  • Alpha Peak Model: Finds the dominant frequency within the alpha band (8-13 Hz) and reports its power and signal-to-noise ratio.

  • Calmness Model: Computes a continuous calmness score based on the ratio of relaxation-associated frequencies (alpha, theta) to alertness-associated frequencies (beta).

§Usage

use elata_eeg_models::{Model, AlphaBumpDetector, AlphaPeakModel, CalmnessModel};
use elata_eeg_hal::SampleBuffer;

// Create models
let mut alpha_detector = AlphaBumpDetector::new(256);
let mut alpha_peak = AlphaPeakModel::new(256);
let mut calmness = CalmnessModel::new(256);

// Process data (assuming buffer is filled from a device)
let buffer = SampleBuffer::new(256, 4);
// ... fill buffer ...

// Get analysis results
// let alpha_result = alpha_detector.process(&buffer);
// let alpha_peak_result = alpha_peak.process(&buffer);
// let calmness_result = calmness.process(&buffer);

Structs§

AlphaBumpDetector
Alpha bump detection model
AlphaBumpOutput
Output from the alpha bump detector
AlphaPeakModel
Alpha peak analysis model
AlphaPeakOutput
Output from the alpha peak model
CalmnessModel
Calmness analysis model
CalmnessOutput
Output from the calmness model

Enums§

AlphaState
Detected alpha state

Traits§

Model
Core trait for EEG analysis models
ModelOutput
Output from a model analysis