Signal Processing for EEG/ECG
1. Characteristics of EEG Signals
Characteristics of EEG Signals
Electroencephalography (EEG) signals are voltage fluctuations resulting from ionic current flows within the neurons of the brain. These signals exhibit distinct characteristics in terms of amplitude, frequency, and spatial distribution, which are critical for both clinical diagnostics and research applications.
Time-Domain Characteristics
EEG signals are typically in the range of 1–100 µV when measured at the scalp, with intracranial recordings reaching up to 1–2 mV. The signals are non-stationary, meaning their statistical properties change over time due to varying neural activity. Key time-domain features include:
- Amplitude: Ranges from 10–100 µV (scalp) to 0.5–2 mV (intracranial).
- Morphology: Waveforms may be transient (e.g., spikes in epilepsy) or sustained (e.g., alpha rhythms).
- Signal-to-Noise Ratio (SNR): Often low (≤ 10 dB) due to physiological and environmental noise.
Frequency-Domain Characteristics
EEG signals are conventionally categorized into frequency bands, each associated with specific brain states:
Power spectral density (PSD) analysis reveals that EEG signals follow a 1/fα power law, where α typically ranges from 1 to 2.5, indicating scale-free dynamics.
Spatial and Topographic Properties
EEG signals are spatially correlated due to volume conduction through cerebrospinal fluid, skull, and scalp. The electric potential Φ at the scalp can be modeled by the Poisson equation:
where σ is tissue conductivity and Im is the transmembrane current density. Spatial resolution is limited to 5–10 cm due to signal smearing, but high-density EEG (256+ electrodes) improves localization accuracy.
Nonlinear and Non-Gaussian Behavior
EEG signals exhibit nonlinear dynamics, evidenced by:
- Chaotic attractors: Dimensionality estimates (e.g., correlation dimension) suggest low-dimensional chaos.
- Phase synchronization: Transient coupling between frequency bands (e.g., theta-gamma cross-frequency coupling).
Higher-order statistics (e.g., bispectral analysis) reveal non-Gaussian properties, particularly during epileptic seizures or cognitive tasks.
Artifacts and Noise Sources
EEG recordings are contaminated by multiple noise sources:
- Physiological artifacts: Ocular (50–100 µV), muscular (high-frequency), cardiac (1–2 Hz).
- Technical noise: 50/60 Hz line noise, electrode impedance fluctuations (>5 kΩ degrades SNR).
Independent Component Analysis (ICA) and adaptive filtering (e.g., LMS, RLS) are commonly used for artifact suppression.

Characteristics of ECG Signals
Morphological Components
An electrocardiogram (ECG) signal represents the electrical activity of the heart and is characterized by distinct waveforms and intervals. The primary components include:
- P-wave — Atrial depolarization, typically 0.08–0.12 seconds in duration and 0.1–0.3 mV in amplitude.
- QRS complex — Ventricular depolarization, lasting 0.06–0.10 seconds with amplitudes ranging from 0.5–3.0 mV.
- T-wave — Ventricular repolarization, exhibiting lower amplitude (0.1–0.5 mV) and longer duration (0.1–0.25 seconds).
- U-wave — Occasionally observed, representing late repolarization of Purkinje fibers.
Temporal and Spectral Properties
ECG signals exhibit quasi-periodic behavior with a fundamental frequency determined by the heart rate (HR). The power spectral density (PSD) of an ECG signal is concentrated in two main bands:
The dominant spectral components lie below 40 Hz, with over 90% of the signal energy contained within 0.05–30 Hz. High-frequency components (up to 150 Hz) may be present during the QRS complex.
Noise and Artifacts
ECG signals are susceptible to several noise sources that complicate analysis:
- Baseline wander — Low-frequency (≤0.5 Hz) drift caused by respiration or electrode movement.
- Powerline interference — 50/60 Hz noise from electrical equipment.
- Muscle artifacts (EMG) — Broadband noise (5–500 Hz) from skeletal muscle activity.
- Motion artifacts — Non-stationary disturbances from patient movement.
Signal Amplitude and Dynamic Range
The typical ECG signal amplitude ranges from 0.5–5 mV peak-to-peak, requiring amplifiers with:
Modern ECG systems employ instrumentation amplifiers with high common-mode rejection ratios (CMRR > 100 dB) to maintain signal integrity.
Clinical Parameters Derived from ECG
Key diagnostic metrics include:
- RR interval — Time between successive R-peaks, used for heart rate variability (HRV) analysis.
- QT interval — Duration of ventricular depolarization and repolarization, corrected for heart rate (QTc).
- ST segment elevation/depression — Indicator of myocardial ischemia or infarction.
Digital Representation
For accurate digital processing, ECG signals require sampling at:
Clinical systems typically use 250–1000 Hz sampling rates with 12–16 bit resolution to preserve morphological details while minimizing storage requirements.

1.3 Common Noise Sources in EEG/ECG
Physiological Noise
Physiological artifacts arise from the subject's own biological activity unrelated to the neural or cardiac signals of interest. In EEG, electromyographic (EMG) noise from facial muscles contaminates the signal above 20 Hz, while electrooculographic (EOG) artifacts from eye movements dominate below 4 Hz. ECG recordings suffer from baseline wander due to respiration (0.1–0.5 Hz) and motion artifacts from electrode-skin impedance changes. The power spectral density of these noise sources often overlaps with the signal band:
where α ≈ 2 for EMG and fc ≈ 1 Hz for EOG. Adaptive filtering and independent component analysis (ICA) prove effective for separation when noise and signal subspaces are non-orthogonal.
Environmental Interference
Power line interference at 50/60 Hz and harmonics manifests as a comb spectrum with amplitudes reaching 20% of the EEG signal. The differential-mode coupling occurs through:
where M is mutual inductance (≈10-8 H) and Cstray is stray capacitance (≈10-12 F). Twisted-pair cabling and driven-right-leg circuits reduce common-mode noise by 40–60 dB. Notch filters should be avoided as they distort phase information; instead, adaptive cancellation using a reference channel yields better results.
Instrumentation Noise
Front-end electronics contribute thermal noise (4kTRB) and flicker noise (KfIα/fβ). For a typical EEG amplifier with Rin = 10 MΩ and B = 100 Hz:
Capacitive non-idealities in electrode-tissue interfaces create additional noise through the 1/(jωCd) term in the impedance model. Silver-silver chloride electrodes exhibit the lowest noise floor (0.1–1 μV/√Hz) due to their reversible electrochemical properties.
Motion Artifacts
Electrode displacement generates triboelectric potentials reaching 100 mV through the double-layer capacitor mechanism:
where ζ is the zeta potential (≈100 mV for Ag/AgCl) and d is the Debye length (≈1 nm). Modern systems employ active electrodes with impedance converters (Zin > 1 TΩ) to mitigate this effect. Accelerometer-based motion tracking enables artifact subtraction when correlated with signal disturbances.

2. Filtering Methods (Low-pass, High-pass, Band-pass)
2.1 Filtering Methods (Low-pass, High-pass, Band-pass)
Frequency-Domain Filtering Fundamentals
Biological signals like EEG and ECG contain both physiological and non-physiological components spanning different frequency ranges. The power spectral density of typical EEG shows dominant activity below 40 Hz, while ECG contains fundamental components between 0.5-40 Hz. Filter design must account for these characteristics while preserving signal integrity.
where fc is the cutoff frequency and n is the filter order. This magnitude response equation governs all basic filter types, with variations in stopband and passband definitions.
Low-Pass Filter Implementation
For EEG applications, low-pass filters typically target 30-100 Hz cutoff frequencies to remove high-frequency noise while preserving neural oscillations. A Butterworth implementation provides maximally flat passband response:
where s is the complex frequency variable. In digital implementations, the bilinear transform converts this to the z-domain:
Practical implementations must account for phase distortion effects, often addressed using forward-backward filtering or minimum-phase designs.
High-Pass Filter Considerations
High-pass filters remove baseline wander in ECG (typically below 0.5 Hz) and slow cortical potentials in EEG. A first-order RC high-pass filter has the transfer function:
For physiological signals, higher-order filters (4-8 poles) with steep roll-offs are preferred to avoid attenuating desired low-frequency components. Chebyshev Type II designs are particularly effective, offering equiripple stopband behavior:
Band-Pass Filter Optimization
EEG analysis often requires isolating specific frequency bands (delta: 0.5-4 Hz, theta: 4-8 Hz, alpha: 8-13 Hz, beta: 13-30 Hz, gamma: 30-100 Hz). A cascaded low-pass and high-pass implementation provides independent control:
For real-time applications, IIR implementations offer computational efficiency, while FIR filters provide linear phase response. The Parks-McClellan algorithm optimizes FIR band-pass designs:
where W(ω) is the weighting function and Hd(ω) is the desired response.
Practical Implementation Challenges
Filter choice impacts clinical interpretation - excessive high-pass filtering may distort ST segments in ECG, while aggressive low-pass filtering can attenuate high-frequency components in EEG spikes. Finite impulse response (FIR) filters avoid phase distortion but require higher computational resources. Infinite impulse response (IIR) filters offer efficiency but may introduce nonlinear phase effects.
Modern digital implementations often employ adaptive filtering techniques, particularly for motion artifact removal in ambulatory EEG/ECG systems. The normalized least mean squares (NLMS) algorithm provides stable adaptation:
where μ is the step size and ε prevents division by zero.

2.2 Artifact Removal (ICA, PCA)
Independent Component Analysis (ICA)
ICA is a blind source separation technique that decomposes a multichannel signal into statistically independent components. Given an observed signal X with dimensions m × n (m channels, n samples), ICA models it as:
where A is the mixing matrix and S contains the independent sources. The goal is to estimate the unmixing matrix W such that:
Maximizing non-Gaussianity through measures like kurtosis or negentropy yields the independent components. For EEG/ECG, artifacts like eye blinks or muscle activity often manifest as isolated components that can be manually or automatically rejected.
Principal Component Analysis (PCA)
PCA performs orthogonal transformation to decorrelate components by eigenvalue decomposition of the covariance matrix C:
The eigenvectors form the principal components, ordered by descending eigenvalues (variance). Unlike ICA, PCA only guarantees decorrelation, not statistical independence. It is effective for dimensionality reduction but may mix artifact and neural sources.
Practical Implementation
Key steps for artifact removal:
- Centering: Subtract mean from each channel to ensure zero-mean data.
- Whitening: Normalize covariance to identity matrix for ICA stability.
- Component rejection: Visual inspection or automated thresholds (e.g., kurtosis > 3 for ocular artifacts).
- Reconstruction: Project back to sensor space excluding rejected components.
For EEG, ICA typically outperforms PCA due to its ability to separate non-Gaussian sources like neural activity from artifacts. However, PCA remains computationally efficient for preliminary noise reduction.

2.3 Baseline Correction and Normalization
Baseline drift in EEG/ECG signals arises from low-frequency artifacts such as respiration, electrode impedance changes, or patient movement. These drifts obscure high-frequency components of interest, necessitating baseline correction before further analysis. Normalization ensures signals are scaled uniformly, facilitating comparison across datasets or subjects.
Baseline Correction Methods
The simplest approach is linear detrending, where a least-squares fit line is subtracted from the signal. For a signal x[n] of length N, the trend is modeled as:
The coefficients a and b are estimated via:
More sophisticated methods employ high-pass filtering or polynomial fitting. A zero-phase high-pass Butterworth filter with cutoff frequency fc eliminates baseline drift while preserving signal morphology. The transfer function for a second-order filter is:
where coefficients are derived from the bilinear transform of the analog prototype.
Normalization Techniques
Normalization adjusts signal amplitude to a standard range. Common approaches include:
- Z-score normalization: Centers data on zero with unit variance:
$$ x'[n] = \frac{x[n] - \mu}{\sigma} $$where μ and σ are the mean and standard deviation of x[n].
- Min-max scaling: Maps signals to a fixed interval (e.g., [0, 1]):
$$ x'[n] = \frac{x[n] - \min(x)}{\max(x) - \min(x)} $$
Practical Considerations
In EEG, baseline correction is typically applied per epoch to account for non-stationary drifts. For ECG, median filtering (window width ~200 ms) effectively removes baseline wander without distorting QRS complexes. Normalization is critical in machine learning pipelines to prevent feature magnitude biases.

3. Peak Detection Algorithms
3.1 Peak Detection Algorithms
Peak detection in EEG/ECG signals is critical for identifying physiological events such as QRS complexes in ECG or epileptic spikes in EEG. Advanced algorithms must account for noise, baseline wander, and morphological variability. The following methods are widely used in biomedical signal processing.
Threshold-Based Peak Detection
A simple yet effective approach involves setting amplitude thresholds. For an ECG signal x[n], a peak is detected if:
where θ is a dynamic or fixed threshold. Adaptive thresholds improve robustness against varying signal amplitudes:
Here, μ is the moving average, σ the standard deviation, and k a tunable parameter (typically 3–5).
Matched Filtering
Matched filters optimize the signal-to-noise ratio (SNR) by convolving the input signal with a template of the expected peak shape. For a template h[n] of length L, the output y[n] is:
Peaks are identified at local maxima of y[n]. This method excels in ECG for QRS detection when the template resembles a typical R-wave.
Wavelet Transform
Wavelet-based peak detection decomposes the signal into time-frequency components. The continuous wavelet transform (CWT) at scale s and translation τ is:
where ψ(t) is the mother wavelet. Peaks correspond to modulus maxima in the wavelet domain, particularly at scales matching the QRS duration (e.g., 2–40 ms).
Pan-Tompkins Algorithm
A classic real-time QRS detector combines derivative, squaring, and moving window integration:
- Bandpass filtering (5–15 Hz) to suppress noise.
- Differentiation to highlight steep slopes.
- Squaring to emphasize large differences.
- Integration over a 150-ms window to merge nearby peaks.
Peaks are detected when the integrated signal exceeds an adaptive threshold.
Hidden Markov Models (HMM)
HMMs model the signal as a sequence of states (e.g., P-wave, QRS, T-wave). The Viterbi algorithm identifies the most likely state sequence, with peaks corresponding to transitions. The observation probability is often modeled as a Gaussian mixture:
where cjm are mixture weights and μjm, Σjm the mean and covariance of the m-th Gaussian in state j.
Performance Metrics
Algorithm efficacy is quantified using:
- Sensitivity (Se): $$ Se = \frac{TP}{TP + FN} $$
- Positive Predictivity (+P): $$ +P = \frac{TP}{TP + FP} $$
- F1-score: $$ F1 = 2 \cdot \frac{Se \cdot +P}{Se + +P} $$
where TP, FP, and FN are true positives, false positives, and false negatives, respectively.

3.2 Heart Rate Variability (HRV) Analysis
Time-Domain Analysis
Time-domain HRV metrics quantify statistical properties of RR intervals (the time between successive R-peaks in an ECG). The most common measures include:
- SDNN (Standard Deviation of NN intervals): Reflects overall autonomic activity. Calculated as:
$$ \text{SDNN} = \sqrt{\frac{1}{N-1} \sum_{i=1}^{N} (RR_i - \overline{RR})^2 } $$
- RMSSD (Root Mean Square of Successive Differences): Measures parasympathetic influence:
$$ \text{RMSSD} = \sqrt{\frac{1}{N-1} \sum_{i=1}^{N-1} (RR_{i+1} - RR_i)^2 } $$
Frequency-Domain Analysis
Power spectral density (PSD) decomposes HRV into frequency components via Fourier transform or autoregressive modeling. Key bands are:
- VLF (0.003–0.04 Hz): Linked to thermoregulation and hormonal factors
- LF (0.04–0.15 Hz): Baroreflex activity (mixed sympathetic/parasympathetic)
- HF (0.15–0.4 Hz): Parasympathetic respiratory modulation
The LF/HF ratio serves as a proxy for sympathovagal balance, though its interpretation remains debated.
Nonlinear Methods
Poincaré plots visualize RR interval dynamics by plotting each RRn against RRn+1. Ellipse fitting yields:
Multiscale entropy (MSE) and detrended fluctuation analysis (DFA) assess complexity and fractal-like properties.
Practical Considerations
ECG-derived HRV requires:
- High sampling rates (≥250 Hz) for precise R-peak detection
- Artifact correction (e.g., cubic spline interpolation for ectopic beats)
- Stationary segments (5-min minimum for frequency-domain analysis per Task Force standards)

3.3 Event-Related Potentials (ERPs) in EEG
Definition and Neurophysiological Basis
Event-Related Potentials (ERPs) are voltage fluctuations in the EEG signal elicited by specific sensory, cognitive, or motor events. These potentials are time-locked to the onset of a stimulus and reflect neural activity associated with information processing. ERPs are typically in the range of 1–20 µV, making them orders of magnitude smaller than background EEG activity, which necessitates specialized signal processing techniques for extraction.
The neurophysiological origin of ERPs lies in synchronized postsynaptic potentials (PSPs) from large populations of pyramidal neurons in the cortex. When these neurons fire in a coordinated manner, their dipolar fields summate, producing measurable scalp potentials. The most studied ERP components include:
- P300 – A positive deflection peaking ~300 ms post-stimulus, associated with attention and decision-making.
- N170 – A negative deflection at ~170 ms, linked to facial recognition.
- MMN (Mismatch Negativity) – An automatic response to deviant stimuli in a repetitive sequence.
Mathematical Model of ERP Extraction
ERPs are extracted by averaging multiple EEG epochs time-locked to the same event type. Let Xi(t) represent the i-th epoch of EEG data, where t is time relative to stimulus onset. The ERP Y(t) is computed as:
where N is the number of epochs. This averaging suppresses uncorrelated noise (e.g., muscle artifacts, background EEG) by a factor of √N, while preserving the time-locked ERP signal.
Time-Frequency Decomposition of ERPs
ERPs are non-stationary, with varying spectral properties over time. A wavelet transform provides a joint time-frequency representation:
where ψ(t) is the mother wavelet, a is the scale parameter (inversely related to frequency), and b is the time shift. The Morlet wavelet is commonly used for its balance between time and frequency resolution.
Spatial Filtering and Source Localization
To enhance ERP components and localize their neural generators, spatial filtering techniques are applied:
- Laplacian Filtering – Emphasizes local activity by subtracting weighted contributions from surrounding electrodes.
- Beamforming – Uses a linear spatial filter to maximize signal-to-noise ratio (SNR) from a specific brain region while suppressing interference.
The forward model for source localization is given by:
where Φ is the scalp potential, L is the lead field matrix, J is the current dipole density, and ϵ is noise. Solving this inverse problem requires regularization techniques like L2-minimum norm estimation.
Applications in Cognitive Neuroscience
ERPs are widely used to study:
- Attention – The P3 component reflects allocation of attentional resources.
- Memory – Differences in ERP morphology distinguish remembered vs. forgotten items.
- Clinical Diagnosis – Abnormal ERPs are biomarkers for schizophrenia, ADHD, and Alzheimer’s disease.
Recent advances include single-trial ERP detection using machine learning, enabling real-time brain-computer interfaces (BCIs).
4. Fourier Transform and Power Spectral Density
Fourier Transform and Power Spectral Density
Fourier Transform in EEG/ECG Analysis
The Fourier Transform (FT) decomposes a time-domain signal into its constituent frequency components. For a continuous signal x(t), the FT is defined as:
In EEG/ECG processing, we typically work with discrete signals sampled at frequency fs. The Discrete Fourier Transform (DFT) for N samples becomes:
The Fast Fourier Transform (FFT) provides an efficient O(N log N) algorithm to compute the DFT. When analyzing EEG signals, the frequency resolution Δf depends on the acquisition duration T:
Power Spectral Density Estimation
The Power Spectral Density (PSD) describes how signal power distributes across frequencies. For EEG/ECG, we commonly use:
Periodogram Method:- Divide signal into K overlapping segments
- Apply window function (e.g., Hamming) to each segment
- Compute periodogram for each segment
- Average the periodograms
Practical Considerations in Biosignal Analysis
For EEG signals (typically 0.5-100 Hz), we must account for:
- DC offsets: Remove before analysis (high-pass filter >0.5 Hz)
- Power line interference: Notch filter at 50/60 Hz
- Spectral leakage: Use window functions (Hanning, Blackman-Harris)
- Stationarity: EEG is non-stationary - consider Short-Time Fourier Transform (STFT) for time-frequency analysis
Example: Alpha Rhythm Detection
To detect the alpha rhythm (8-13 Hz) in EEG:
- Preprocess with 0.5-100 Hz bandpass filter
- Compute PSD using Welch's method (2s windows, 50% overlap)
- Integrate power in 8-13 Hz band
- Normalize by total power (1-40 Hz) to compute relative alpha power
Multitaper Spectral Estimation
For improved spectral estimation in EEG, the multitaper method uses orthogonal tapers (Slepian sequences) to reduce variance:
where wk[n] are the K orthogonal tapers. This approach provides better statistical properties for detecting weak oscillatory components in noisy EEG signals.

4.2 Wavelet Transform for Time-Frequency Analysis
Mathematical Foundations of Wavelet Transform
The wavelet transform decomposes a signal into a set of basis functions called wavelets, which are localized in both time and frequency. Unlike the Fourier transform, which uses infinite sine and cosine waves, wavelets are finite-duration functions with zero mean. The continuous wavelet transform (CWT) of a signal x(t) is defined as:
where:
- a is the scale parameter (inversely proportional to frequency),
- b is the translation parameter (time shift),
- ψ(t) is the mother wavelet,
- ψ*(t) denotes its complex conjugate.
Discrete Wavelet Transform (DWT) for EEG/ECG
The DWT is computationally efficient and implemented using filter banks. It decomposes a signal into approximation (low-frequency) and detail (high-frequency) coefficients through successive high-pass and low-pass filtering:
where g[n] and h[n] are the low-pass and high-pass filters, respectively, derived from the wavelet function. For EEG/ECG signals, common wavelets include:
- Daubechies (dbN): Orthogonal wavelets with compact support, widely used for transient detection.
- Morlet: Complex wavelet suitable for oscillatory pattern analysis.
- Symlet: Near-symmetric wavelets minimizing phase distortion.
Time-Frequency Localization Trade-offs
Wavelets provide a trade-off between time and frequency resolution:
- High frequencies (small scales): Better time resolution, poorer frequency resolution.
- Low frequencies (large scales): Better frequency resolution, poorer time resolution.
This property is advantageous for EEG/ECG analysis, where high-frequency components (e.g., spikes in epilepsy) require precise time localization, while low-frequency components (e.g., alpha waves) benefit from frequency resolution.
Applications in EEG/ECG Signal Processing
Wavelet transforms are used for:
- Denoising: Thresholding detail coefficients to remove high-frequency noise.
- Feature extraction: Identifying QRS complexes in ECG or epileptiform discharges in EEG.
- Compression: Storing only significant coefficients.
For example, in ECG analysis, the DWT can isolate the QRS complex by thresholding coefficients at scales corresponding to 10–25 Hz, while suppressing baseline wander (near 0.5 Hz).
Comparison with Short-Time Fourier Transform (STFT)
Unlike STFT, which uses a fixed window size, wavelets adapt their time-frequency resolution:
- STFT: Fixed resolution across all frequencies.
- Wavelet transform: Variable resolution (narrow windows at high frequencies, wide at low frequencies).
This makes wavelets superior for analyzing non-stationary signals like EEG/ECG, where frequency components evolve over time.
Practical Implementation Considerations
When applying wavelet transforms to EEG/ECG:
- Boundary effects: Zero-padding or symmetric extension mitigates artifacts at signal edges.
- Choice of wavelet: Daubechies wavelets (e.g., db4) are common for ECG, while Morlet suits EEG rhythm analysis.
- Computational cost: DWT is O(N) for N samples, while CWT is O(N²).

EEG Frequency Bands and Their Clinical Significance
Electroencephalography (EEG) signals are categorized into distinct frequency bands, each associated with specific neural activities and clinical implications. These bands are extracted using spectral analysis techniques such as Fourier transforms or wavelet decomposition. The primary frequency bands, their physiological correlates, and diagnostic relevance are as follows:
Delta Band (0.5–4 Hz)
The delta band dominates during deep sleep (stage N3) and is characterized by high-amplitude, slow oscillations. Its power spectral density (PSD) is computed as:
where Sxx(f) is the power spectral density of the EEG signal. Elevated delta activity in awake adults may indicate pathological conditions such as traumatic brain injury or encephalopathy. Conversely, suppressed delta waves are observed in sleep disorders like insomnia.
Theta Band (4–8 Hz)
Theta oscillations are prominent during light sleep (stages N1-N2), meditation, and memory consolidation. The instantaneous theta power can be extracted using a Hilbert transform:
where xθ(t) is the bandpass-filtered signal. Excessive frontal theta in awake states correlates with attention deficits in ADHD, while hippocampal theta bursts are biomarkers for epilepsy.
Alpha Band (8–13 Hz)
Alpha waves exhibit maximal amplitude over occipital regions during eyes-closed resting states. The alpha peak frequency (APF) is a key metric:
APF below 8.5 Hz may indicate neurodegenerative diseases like Alzheimer's. Event-related desynchronization (ERD) of alpha waves during cognitive tasks reflects cortical activation patterns.
Beta Band (13–30 Hz)
Beta activity is associated with active thinking, focus, and sensorimotor processing. Its modulation is quantified using beta rebound:
Abnormally high beta power occurs in Parkinson's disease patients under dopaminergic treatment, while suppressed beta indicates stroke-induced motor impairment.
Gamma Band (30–100 Hz)
Gamma oscillations underlie perceptual binding and cognitive processing. Their short-term power is often analyzed using Morlet wavelets:
where ψt,f is the complex wavelet. Reduced gamma synchrony is observed in schizophrenia, while excessive gamma coherence occurs during epileptic seizures.
Cross-Frequency Coupling
Phase-amplitude coupling (PAC) between bands reveals functional network interactions. The modulation index quantifies theta-gamma coupling:
where H denotes entropy. Altered PAC profiles are biomarkers for depression and autism spectrum disorders.

5. Machine Learning for Feature Extraction
5.1 Machine Learning for Feature Extraction
Dimensionality Reduction via Principal Component Analysis (PCA)
Principal Component Analysis (PCA) is a linear transformation technique that projects high-dimensional EEG/ECG data into a lower-dimensional subspace while preserving maximal variance. Given a dataset X with n samples and m features, PCA computes the covariance matrix:
where μ is the mean vector. Eigenvalue decomposition of Σ yields eigenvectors (principal components) and eigenvalues (explained variance). The transformed data Z is obtained by:
where W is the matrix of top-k eigenvectors. PCA is particularly effective for removing redundant noise in multichannel EEG.
Time-Frequency Feature Extraction with Wavelets
Discrete Wavelet Transform (DWT) decomposes signals into approximation (low-frequency) and detail (high-frequency) coefficients. For an EEG signal x(t), the DWT is:
where ψ is the mother wavelet (e.g., Daubechies, Morlet), and j, k are scale and translation parameters. Energy and entropy of wavelet coefficients serve as discriminative features for seizure detection or arrhythmia classification.
Convolutional Neural Networks (CNNs) for Spatial Features
CNNs automatically extract spatially invariant features from raw EEG/ECG through hierarchical convolution-pooling operations. A 1D convolution layer applies filters w to input x:
Max-pooling downsamples activations to reduce computational complexity. CNNs outperform manual feature engineering in tasks like sleep stage classification, achieving >90% accuracy on benchmark datasets.
Recurrent Networks for Temporal Dynamics
Long Short-Term Memory (LSTM) networks model sequential dependencies in EEG/ECG via gated mechanisms. The cell state c_t and hidden state h_t update as:
where σ is the sigmoid function, and ∘ denotes element-wise multiplication. Bidirectional LSTMs capture past-future context for improved R-peak detection in ECG.
Attention Mechanisms for Interpretability
Self-attention layers compute weighted sums of input features, enabling model interpretability. The attention score α between queries Q and keys K is:
where d_k is the key dimension. Transformer-based architectures localize clinically relevant EEG waveforms (e.g., epileptic spikes) without manual segmentation.
Case Study: MI-EEG Classification
On the BCI Competition IV 2a dataset, a hybrid CNN-LSTM model with attention achieves 78.4% accuracy in motor imagery classification, outperforming traditional Common Spatial Patterns (CSP) by 12%. Key features include:
- Mu/beta band power (8–30 Hz) extracted via Butterworth filtering
- Time-domain variance computed over 500ms windows
- Cross-channel correlations from the Laplacian montage

5.2 Deep Learning Approaches in EEG/ECG Classification
Deep learning has revolutionized biomedical signal processing by automating feature extraction and improving classification accuracy. Unlike traditional machine learning, which relies on handcrafted features, deep neural networks learn hierarchical representations directly from raw or preprocessed EEG/ECG signals.
Architectures for EEG/ECG Classification
Three primary deep learning architectures dominate EEG/ECG classification:
- Convolutional Neural Networks (CNNs): Extract spatial and temporal features through convolutional filters. For EEG, 1D CNNs process time-series data, while 2D CNNs handle spectrograms. ECG classification benefits from dilated convolutions to capture long-range dependencies.
- Recurrent Neural Networks (RNNs): Model temporal dynamics using LSTM or GRU cells. Bidirectional variants improve performance by capturing both forward and backward dependencies in signals.
- Hybrid Architectures: Combine CNNs for feature extraction with RNNs for temporal modeling. Attention mechanisms further enhance performance by weighting critical signal segments.
Mathematical Foundations
The core operation in CNNs for 1D signals is the discrete convolution:
where \(x\) is the input signal and \(w\) represents the learnable kernel weights. For EEG signals sampled at 256Hz with 30ms temporal context, a kernel size of 8 samples provides optimal receptive fields.
LSTMs mitigate vanishing gradients through gating mechanisms:
Data Preprocessing Pipeline
Effective deep learning requires specialized preprocessing:
- Normalization: Scale signals to zero mean and unit variance per channel
- Augmentation: Apply time warping, amplitude scaling, and additive noise
- Segmentation: Divide into epochs aligned with physiological events
Performance Metrics
Evaluation requires domain-specific metrics beyond accuracy:
For imbalanced datasets (e.g., rare arrhythmias), the geometric mean of sensitivity and specificity provides more robust assessment.
Implementation Challenges
Key practical considerations include:
- Computational Constraints: Model compression via quantization and pruning for edge deployment
- Explainability: Gradient-weighted class activation mapping (Grad-CAM) for clinical interpretability
- Cross-subject Generalization: Domain adaptation techniques to handle inter-patient variability
State-of-the-art models achieve >95% accuracy on benchmark datasets like MIT-BIH Arrhythmia Database and BCI Competition IV, surpassing traditional signal processing methods by 15-20% margin.

5.3 Real-time Processing Challenges and Solutions
Latency Constraints in Real-Time Systems
Real-time EEG/ECG processing imposes strict latency requirements, typically demanding end-to-end delays of <100 ms for clinical applications. The total latency (L) comprises:
where Tacq is sensor sampling time, Tproc includes filtering/feature extraction, and Ttrans covers data transmission. For implantable devices, L must often be <10 ms to enable closed-loop neuromodulation.
Computational Complexity vs. Resource Limitations
Multichannel biosignals (e.g., 256-channel EEG) require processing at sampling rates of 1–10 kHz. A 10-channel ECG with 16-bit resolution at 1 kHz generates:
Common operations like discrete wavelet transforms (DWT) have complexity O(N) per level, while adaptive filters (e.g., LMS) scale as O(N2). This conflicts with embedded processors' power budgets (often <1 mW/channel).
Optimization Strategies
- Algorithmic pruning: Approximate computing for non-critical operations (e.g., fixed-point Q15 arithmetic)
- Hardware acceleration: Dedicated co-processors for FFT/DWT (e.g., TI C55x DSP’s wavelet library)
- Event-driven processing: Compressive sensing to reduce active sampling periods
Artifact Rejection in Real-Time
Motion artifacts in EEG exhibit amplitudes 10–100× larger than neural signals (0.5–100 µV). A typical artifact rejection pipeline involves:
where rk[n] are reference signals (e.g., accelerometer data) and wk are weights updated via recursive least squares (RLS). RLS achieves convergence in ~50 ms vs. LMS’s 200+ ms, at the cost of higher computational load (O(M2)).
Hardware-Software Co-Design Solutions
Modern systems leverage heterogeneous architectures:
Example partitioning: The MCU handles IIR filtering (5 µs latency), FPGA performs 5-level DWT (12 µs), and wireless transmits only QRS complexes (reducing data by 92%).
Case Study: Closed-Loop Epilepsy Detection
The NeuroPace RNS System processes 4 channels of 250 Hz EEG with 5 ms latency using:
High-γ power is computed via Goertzel’s algorithm (reducing FFT overhead by 70%). Detection thresholds adapt every 10 minutes using exponentially weighted moving averages.
Emerging Approaches
- Edge-AI: TinyML models (e.g., 8-bit quantized CNNs) for anomaly detection
- Analog preprocessing: Continuous-time ΣΔ modulation for direct feature extraction
- Time-domain encoding: Address-event representation (AER) for sparse signals

6. Key Research Papers in EEG/ECG Signal Processing
6.1 Key Research Papers in EEG/ECG Signal Processing
- EEG SIGNAL PROCESSING - Wiley Online Library — 2 Fundamentals of EEG Signal Processing 35 2.1 EEG Signal Modelling 36 2.1.1 Linear Models 42 2.1.2 Nonlinear Modelling 45 2.1.3 Generating EEG Signals Based on Modelling the Neuronal Activities 47 2.2 Nonlinearity of the Medium 50 2.3 Nonstationarity 50 2.4 Signal Segmentation 51 2.5 Signal Transforms and Joint Time-Frequency Analysis 55
- PDF EEG Signal Processing - UW Faculty Web Server — 2 Fundamentals of EEG Signal Processing 35 2.1 EEG Signal Modelling 36 2.1.1 Linear Models 42 2.1.2 Nonlinear Modelling 45 2.1.3 Generating EEG Signals Based on Modelling the Neuronal Activities 47 2.2 Nonlinearity of the Medium 50 2.3 Nonstationarity 50 2.4 Signal Segmentation 51 2.5 Signal Transforms and Joint Time-Frequency Analysis 55
- EEG Analysis: Theory and Practice - Oxford Academic — Research and Information ... C44.S4 The Evolution of EEG Signal Processing Since the Middle of the Last Century. Expand 2. C44.S5 General Characteristics of EEG Signals 2. ... C44.S50 Pre-Processing of Raw EEG Signals 6.1.3.1. C44.S50 Pre-Processing of Raw EEG Signals. 6.1.3.2.
- EEG Signal Processing and Machine Learning: Front Matter — 4 Fundamentals of EEG Signal Processing 77 4.1 Introduction 77 4.2 Nonlinearity of the Medium 78 4.3 Nonstationarity 79 4.4 Signal Segmentation 80 4.5 Signal Transforms and Joint Time-Frequency Analysis 83 4.5.1 Wavelet Transform 87 4.5.1.1 Continuous Wavelet Transform 87 4.5.1.2 Examples of Continuous Wavelets 89 4.5.1.3 Discrete-Time ...
- A review of channel selection algorithms for EEG signal processing ... — Digital processing of EEG signals consists of different components: signal acquisition unit, feature extraction unit, and a decision algorithm as shown in Fig. 1. The input to the system in Fig. 1 is an EEG signal acquired from the scalp, brain surface, or brain interior. The signal acquisition unit is represented by electrodes whether they are ...
- An Efficient Signal Processing Algorithm for Detecting Abnormalities in ... — The system is a well-established three-stage paradigm for EEG signal processing. The DWT was used to obtain split frequency components in the first phase; in this phase, a three-level DWT was utilized to divide the EEG signal into the estimate and a detailed parameter; and then attempts were taken to remove worthless and noise data and obtain ...
- (PDF) EEG Signal Processing - Academia.edu — The development of novel sensors for EEG recording, digital signal processing algorithms, feature engineering, and detection algorithms increases the need for efficient diagnostic systems. ... as it provides a summary of recent developments and highlights key areas for future research. This paper can help researchers and clinicians to stay up ...
- EEG Signal Processing and Feature Extraction - Academia.edu — Sanei/EEG Signal Processing, 2013. Introduction to EEG The neural activity of the human brain starts between the 17th and 23rd week of prenatal development. It is believed that from this early stage and throughout life electrical signals generated by the brain represent not only the brain function but also the status of the whole body.
- (PDF) EEG SIGNAL ACQUISITION - Academia.edu — The purpose of this paper is to develop EEG signal acquisition using embedded systems. This system has been designed that recorded biological signal conditioning is a successive analog and digital transformation. These transformations are necessary to provide signals for efficacious signal processing and pattern recognition methods.
- A comparative analysis of signal processing and classification methods ... — Electroencephalogram (EEG) measures the neuronal activities in the form of electric currents that are generated due to the synchronized activity by a …
6.2 Recommended Textbooks and Online Resources
- EEG SIGNAL PROCESSING - Wiley Online Library — 2 Fundamentals of EEG Signal Processing 35 2.1 EEG Signal Modelling 36 2.1.1 Linear Models 42 2.1.2 Nonlinear Modelling 45 2.1.3 Generating EEG Signals Based on Modelling the Neuronal Activities 47 2.2 Nonlinearity of the Medium 50 2.3 Nonstationarity 50 2.4 Signal Segmentation 51 2.5 Signal Transforms and Joint Time-Frequency Analysis 55
- PDF EEG Signal Processing - UW Faculty Web Server — 2 Fundamentals of EEG Signal Processing 35 2.1 EEG Signal Modelling 36 2.1.1 Linear Models 42 2.1.2 Nonlinear Modelling 45 2.1.3 Generating EEG Signals Based on Modelling the Neuronal Activities 47 2.2 Nonlinearity of the Medium 50 2.3 Nonstationarity 50 2.4 Signal Segmentation 51 2.5 Signal Transforms and Joint Time-Frequency Analysis 55
- EEG Signal Processing and Machine Learning: Front Matter — 4 Fundamentals of EEG Signal Processing 77 4.1 Introduction 77 4.2 Nonlinearity of the Medium 78 4.3 Nonstationarity 79 4.4 Signal Segmentation 80 4.5 Signal Transforms and Joint Time-Frequency Analysis 83 4.5.1 Wavelet Transform 87 4.5.1.1 Continuous Wavelet Transform 87 4.5.1.2 Examples of Continuous Wavelets 89 4.5.1.3 Discrete-Time ...
- EEG Signal Processing and Machine Learning, 2nd Edition — Explore cutting edge techniques at the forefront of electroencephalogram research and artificial intelligence from leading voices in the field The newly revised Second Edition of EEG Signal Processing and Machine Learning delivers an inclusive and thorough exploration of new techniques and outcomes in electroencephalogram (EEG) research in the areas of analysis, processing, and decision making ...
- PDF Principles of Biomedical Instrumentation - Cambridge University Press ... — 5.3 ECG System Design 149 5.3.1 Common-Mode Signals and Other Noise Sources 150 5.3.2 Reducing the Common-Mode Signal 152 5.3.3 Design of Lead-Off Circuitry 154 5.3.4 Filtering and Sampling 155 5.4 Signal Processing of the ECG Signal and Automatic Clinical Diagnosis 156 5.4.1 University of Glasgow (Formerly Glasgow Royal In rmary) Algorithm 157
- EEG Signal Processing and Feature Extraction - Academia.edu — Sanei/EEG Signal Processing, 2013. Introduction to EEG The neural activity of the human brain starts between the 17th and 23rd week of prenatal development. It is believed that from this early stage and throughout life electrical signals generated by the brain represent not only the brain function but also the status of the whole body.
- EEG signal processing and feature extraction [digital] — Stanford Libraries' official online search tool for books, media ... Email a reference question Using SearchWorks Connection Connect to e-resources Report a connection problem If we ... Selections (0) Clear all lists. Back to results. Toggle navigation. Send to text email RefWorks. EndNote printer. EEG signal processing and feature extraction ...
- EEG Technology - 2nd Edition - Elsevier Shop — Some other Methods of Processing EEG Signals 8.11.1. Introduction 8.11.2. Hjorth Analysis 8.11.3. Autoregressive Analysis 8.11.4. Pattern Recognition Applied to EEG Signals 8.11.5. Pattern Recognition Applied to Factual EEG Reports 8.12. Statistical Treatment of EEG Data 8.13.
- PDF Foundations of Signal Processing - Cambridge University Press & Assessment — "Foundations of Signal Processing by Vetterli, Kovaceviˇ c, and Goyal, is a pleasure to read. Draw-´ ing on the authors' rich experience of research and teaching of signal processing and signal rep-resentations, it provides an intellectually cohesive and modern view of the subject from the geo-metric point of view of vector spaces.
- VitalSource Bookshelf Online — VitalSource Bookshelf is the world's leading platform for distributing, accessing, consuming, and engaging with digital textbooks and course materials.
6.3 Open-source Tools and Datasets
- eeg-signals-processing · GitHub Topics · GitHub — EEGLAB is an open source signal processing environment for electrophysiological signals running on Matlab and developed at the SCCN/UCSD. matlab eda meg eeg ecg octave electrophysiology compiled hrv brain spectral-analysis eeglab ecog source-localization neurophysiology eeg-signals-processing ... An open source tool for large-scale EEG datasets ...
- Open Software for Human Electrophysiology - GitHub — Neural Ensemble is an initiative for open-source software in neuroscience and includes a set of tools for managing and analyzing electrophysiology data. ... Signaleeg is a general purpose tool for processing and analyzing EEG data, with a focus on signal-data mining. Code ... Ghostipy is a toolbox for signal processing and spectral analyses ...
- EEGLAB is an open source signal processing environment for ... — EEGLAB is an open source signal processing environment for electrophysiological signals running on Matlab and Octave (command line only for Octave). This folder contains original Matlab functions from the EEGLAB (formerly ICA/EEG) Matlab toolbox, all released under the Gnu public license (see eeglablicence.txt).
- OpenBCI - Open-source EEG - Open Source Imaging — The OpenBCI Board is a versatile and affordable analog-to-digital converter that can be used to sample electrical brain activity (EEG), muscle activity (EMG) and heart rate (ECG) amongst others. It is compatible with any type of electrode and is supported by an open-source framework of signal processing applications.
- SOFTWARE AND HARDWARE - Designing EEG Experiments for Studying the ... — The Net Station software (as explained in Chapter 7, 2D and 3D Educational Contents) consists of a toggle button on the toolbar that shows or hides all the PIB channels. 2. Biosignal Toolbox: This is an open source software library for biomedical signal processing available for both MATLAB and C++ platforms for data analysis.
- openelectronicslab/OpenHardwareExG @ GitHub - GitHub Pages — The OpenHardwareExG is a platform for ECG, EEG, EMG, ENG, EOG, and evoked potential applications. ... The main goal of the project is to build a device that allows the creation of electrophysiologic signal processing applications. In addition: Hardware and software that we develop will have a free/open source license. We also prefer to use ...
- What is the best open source software to analyse EEG signals? — This presentation explains the usage OCTAVE open source software in Signal Processing, Analog and Digital Communication and Digital Image Processing View EEG + Software Detects Early Conversion to ...
- Digitizing ECG image: a new method and open-source software code — The overview and the representative example of the digitization process. 2.2.2. Image pre-processing. Graphical User Interface. First, the application prepares the ECG scan, allows rotation/normalization, crops individual ECG leads, and integrates the digitized data from all leads ().The inputs consist of the color image of the scanned ECG and user inputs for rotation, lead locations, lead ...
- OpBox: Open Source Tools for Simultaneous EEG and EMG ... - eNeuro — Amplifier design. The main hardware component of our physiology system is a multichannel amplifier designed to collect electrophysiologic data, including EEG and EMG ().The OpBox amplifier is a four channel extension of a prior open source amplifier (Land et al., 2001).All four channels are referenced to a single electrode input, with an additional ground connection.
- (PDF) An Open-Source Feature Extraction Tool for the Analysis of ... — Our Bio-SP tool pipeline. The input (left) to the Bio-SP tool is a raw segment of either ECG, EDA, EMG, BP, or ICG biosignal (or modality). The Bio-SP tool output (right) is the signal-specific ...








