I. Biophysical & Mathematical Principles of Spectral Analysis
A spectrogram is a visual representation of the spectrum of frequencies in a signal as they vary with time. When analyzing complex physiological telemetry such as neural oscillations or cardiac action potentials, static time-domain waveforms often mask the underlying harmonic components [14]. By transforming these signals into the joint time-frequency domain, we reveal localized energetic signatures that represent distinct physiological actions.
The mathematical bridge between the time domain and the frequency domain is defined by the Fourier Transform. For a continuous-time signal $x(t)$, its classical Fourier representation $\hat{x}(f)$ is given by:
$$X(f) = \int_{-\infty}^{\infty} x(t) e^{-i 2\pi f t} \, dt$$
However, because a standard Fourier Transform integrates across all time, it loses temporal localization—rendering it ineffective for non-stationary signals whose statistical properties change dynamically. To capture dynamic changes, we apply the Short-Time Fourier Transform (STFT). The STFT divides the continuous signal into localized overlapping segments, windowing each chunk to limit spectral leakage before running individual Discrete Fourier Transforms:
$$\mathbf{STFT}\{x(t)\}(\tau, f) = \int_{-\infty}^{\infty} x(t) w(t - \tau) e^{-i 2\pi f t} \, dt$$
where $w(t)$ represents the window function. Spectral leakage arises because truncating a signal introduces sharp discontinuities at the boundaries, producing artificial high-frequency artifacts. To combat this, we apply a Hanning window $w[n]$, which tapers the boundaries smoothly toward zero:
$$w[n] = 0.5 \left( 1 - \cos\left( \frac{2\pi n}{N-1} \right) \right)$$
This operation suppresses spectral leakage by maximizing the sidelobe roll-off, ensuring that structural peaks are correctly identified. However, time-frequency analysis is inherently bound by the Gabor Uncertainty Principle, which dictates that one cannot simultaneously achieve infinite resolution in both time and frequency:
$$\sigma_t \sigma_f \ge \frac{1}{4\pi}$$
Increasing the analysis window size improves frequency resolution but blurs temporal boundaries, while a shorter window achieves precise time tracking at the cost of frequency smearing.
III. Digital Signal Processing & Biomedical Pipeline
To maintain real-time frame rates during rendering, this application employs an optimized, iterative Radix-2 Cooley-Tukey FFT algorithm. While a direct Discrete Fourier Transform requires $O(N^2)$ computations, the Radix-2 Cooley-Tukey algorithm recursively splits a signal into even and odd indices to reduce computational complexity to $O(N \log_2 N)$.
This implementation uses an in-place bit-reversal sorting phase followed by an iterative calculation loop. This approach avoids recursive array allocations, minimizing overhead and keeping the rendering pipeline running smoothly:
$$\hat{x}_k = E_k + e^{-i \frac{2\pi k}{N}} O_k$$
For our biomedical simulations, the application implements specialized synthesis models:
- Electroencephalography (EEG): Synthesizes a composite waveform containing Delta ($\delta$: 1-4 Hz), Theta ($\theta$: 4-8 Hz), Alpha ($\alpha$: 8-12 Hz), and Beta ($\beta$: 13-30 Hz) rhythm bands, with options to trigger eye blinks (using low-frequency Gaussian envelopes) and muscle artifacts (stochastic high-frequency bursts) [14].
- Electrocardiography (ECG): Simulates regular cardiac action potentials using a multi-phase pulse generator that models individual P-waves, QRS complex spikes, and T-waves [14]. In arrhythmia mode, a randomized heart rate drift is introduced to simulate real-world irregular heart rhythms.
- Electromyography (EMG): Employs a bandpass-filtered stochastic noise model representing motor unit action potential (MUAP) recruitment bursts during muscle contractions.
- Photoplethysmography (PPG): Synthesizes arterial blood-volume changes over time using a dual-exponential waveform to model the characteristic systolic peak and subsequent dicrotic notch during aortic valve closures.
Open Access License: This interactive educational module is released under
CC BY-NC 4.0 (Attribution-NonCommercial)
for non-commercial research, academic study, and clinical education.
Commercial & Enterprise Licensing: For white-labeling, proprietary LMS/course embedding, hardware dashboard telemetry integration, or custom feature engineering, secure a commercial license at
BioniCloud.com or contact
Dr. Yuri Beno.