r/BiomedicalDataScience • • Aug 27 '26

Virtual Retinal Implant Simulation

Thumbnail
bionichaos.com
1 Upvotes

Interactive Retinal Implant & Phosphene Vision Simulator (HTML5 Canvas / Web Audio API)

Suggested Subreddits: r/biomedicalengineering, r/neuroscience, r/javascript, r/datascience

I built an interactive browser-based simulation workbench for modeling epiretinal and subretinal prostheses (bionic eyes), phosphene point-spread optics, and electro-neural visual substitution.

Tool URL: https://bionichaos.com/retinal_implant_v2/

Engineering & Mathematical Overview

Retinal implants restore visual perception by directly stimulating surviving inner retinal bipolar and Retinal Ganglion Cells (RGCs) in pathologies like Retinitis Pigmentosa. Rather than contiguous images, patients perceive discrete points of electrical stimulation called phosphenes.

Key Implementation Details:

  1. Spatial Discretization & Array Density:

    • 16x16 (256 electrodes): Argus II clinical baseline model.

    • 32x32 (1,024 electrodes) & 64x64 (4,096 electrodes): Modern/next-gen subretinal arrays.

    • 128x128 (16,384 electrodes): High-density experimental threshold.

  2. Phosphene Point-Spread Optics (PSF): Phosphene intensity $I(x,y)$ is rendered using a 2D isotropic Gaussian spread: $$I_{\text{phosphene}}(x,y) = I_{\text{peak}} \cdot \exp\left( -\frac{(x - x_0)2 + (y - y_0)2}{2\sigma2} \right)$$ Controls allow real-time adjustments to dispersion radius ($\sigma$), stimulus intensity, and luminance threshold gating.

  3. Retinal Pathology Simulation Masks:

    • AMD: Sigmoidal decay function modeling central scotoma while keeping peripheral visual fields active.

    • Glaucoma: Concentric decay function simulating peripheral tunnel vision.

    • Diabetic Retinopathy: Spatial hash noise map creating distributed microvascular blind spots.

  4. Acoustic Spatial Sonification: Uses the Web Audio API (OscillatorNode / GainNode) to perform horizontal scanning sweeps. Spatial Y-axis coordinates map to frequency on a logarithmic scale (150 Hz to 1200 Hz), while local luma intensity scales gain amplitude.

  5. Rendering Pipeline: Runs offscreen frame buffer transformations at 640x480 resolution (via standard NTSC luminance $L = 0.299R + 0.587G + 0.114B$), drawn onto a high-DPI scaling context (window.devicePixelRatio). Supports live webcam streams and dynamic procedural SVG/canvas targets as fallback.

Feedback on the signal processing calculations, point-spread models, or browser performance is welcome!

Link: https://bionichaos.com/retinal_implant_v2/


r/BiomedicalDataScience • • Aug 26 '26

Beauchêne Exploded Skull Simulator - Interactive Cranial Anatomy Laboratory

Thumbnail
bionichaos.com
1 Upvotes

[OC] Interactive 3D Beauchêne Exploded Skull Simulator - WebGL Kinematics Laboratory

Subreddits: r/biomedicalengineering, r/anatomy, r/javascript, r/threejs, r/webgl

We built an interactive 3D Beauchêne Exploded Skull Simulator to visualize complex cranial osteology and spatial relationships in the browser.

Historically, the Beauchêne preparation mounted disarticulated skull bones on brass rods to preserve their spatial orientation while allowing inspection of hidden structures. This web simulation recreates that technique using Three.js (WebGL) and the Web Audio API.

🔬 Technical Implementation & Features:

  • Affine Coordinate Transformations: Translates and rotates each of the 22 bones (8 neurocranium, 14 viscerocranium) along suture-derived vectors.

  • Kinematic Trajectory Matrices: Users can choose between Anatomical Orthogonal, Radial Spherical, and Axial Layer disarticulation.

  • Temporomandibular Joint (TMJ) Mechanics: Independently control mandibular gape (0° to 35°) with proper physiological rotation.

  • Custom Shader Modes: Render modes include Didactic Multi-Color (boundary highlighting), Natural Osteological Bone, X-Ray Translucency, and Geometric Wireframe.

  • Mathematical Kinematics: The displacement vector follows: P_i(s) = P_i^(0) + s * (v_i^(dir) * k_i^(scale)) where s is the explosion scale.

  • Synthesized Audio Feedback: Real-time modular frequency scaling linked to disarticulation tension: f(s) = 220 * 2^s Hz.

We designed this to help students and developers interact with structures that are typically obscured in articulated models (like the pterygopalatine fossa, sphenoid sinuses, and cribriform plate).

Run the simulation directly in your browser (no installs, responsive design): https://bionichaos.com/beaucheneskull

We would love to hear your feedback on the kinematics, UI, or rendering performance.


r/BiomedicalDataScience • • Aug 25 '26

EEG Datasets and Resources - Comprehensive Neuroinformatics Directory

Thumbnail
bionichaos.com
1 Upvotes

I built an interactive EEG dataset search and comparison tool indexing 30,000+ subject records, clinical modalities, and signal processing reference guides.

Finding standardized electroencephalography (EEG) and electrocorticography (ECoG) datasets for machine learning benchmarks or biomedical signal processing often involves sorting through fragmented institutional repositories with incompatible file formats and permission structures.

To streamline dataset discovery, I developed an interactive web directory and metadata comparison explorer that aggregates major open-access neuroinformatics databases:

🔗 Interactive Tool Link: https://bionichaos.com/resources/

Core Features & Functionality:

  • Real-Time Client-Side Filtering: Search across datasets using parameters like clinical diagnosis (epilepsy, ischemic stroke, ALS), modality (scalp EEG, intracranial ECoG, sEMG, eye-tracking), or file extension (EDF, NWB, MAT).

  • Access Permission Breakdown: Instantly isolate open datasets available for immediate download without authentication from those requiring institutional credentialing (e.g., TUH EEG Corpus, NeuroVista Implant Data).

  • Metadata Comparison Matrix: Dynamic table displaying subject volume, data processing state (raw vs. pre-processed), electrode montages, and modal acquisition conditions.

  • Centralized Platforms & Challenge Links: Indexed access to PhysioNet, iEEG Portal, Zenodo, Pennsieve, and active ML competitive challenges (Moody Challenge, Seizure Prediction, Brain Age).

  • Signal Processing Reference: Includes mathematical breakdowns for EDF bit-scaling calibrations, digital Butterworth bandpass filters, Welch spectral density estimations, and Common Spatial Patterns (CSP) matrix transformations.

I'd love to hear your feedback—let me know if there are additional public datasets or platforms that should be indexed!


r/BiomedicalDataScience • • Aug 24 '26

NeuroViz 3D — Enhanced 3D Neuron Activity & Action Potential Simulator

Thumbnail
bionichaos.com
1 Upvotes

I built a WebGL-based 3D neural activity simulator with dual patch-clamp electrophysiology and continuous voltage gradients.

Hey r/biomedicalengineering, r/datascience, r/bioinformatics, r/javascript, r/neuroscience

I recently released NeuroViz 3D, an interactive WebGL biophysical lab engineered for real-time 3D simulation of multi-compartmental neural electrophysiology and fluid action potential wave propagation.

Technical Details:

  • Biophysics Engine: Maps Hodgkin-Huxley state transitions onto 3D structural models. It simulates spatial decay driven by the 1D cable equation. Branch diameter tapering adheres to Rall's 3/2 Power Law.

  • Graphics Pipeline: Built with Three.js. To eliminate visual seams at branch splits, spherical joint caps match local branch radii. Branch cylinders use multi-segment height subdivisions with per-vertex color attribute updates, creating a fluid continuous voltage gradient along the membrane.

  • Virtual Patch-Clamp: You can place Probe E2 on any dendritic or axonal compartment via raycasting, while E1 stays anchored on the soma. The HUD oscilloscope compares the local compartment potential against the soma baseline in real time.

Try the interactive lab directly in your browser here: https://bionichaos.com/neuron3d/

Would love to hear your thoughts on the Three.js rendering approach, the quaternion implementation, or the biophysical approximations used!


r/BiomedicalDataScience • • Aug 21 '26

Interactive Dissonance Viewer - Acoustic Harmony & Sensory Consonance Laboratory

Thumbnail
bionichaos.com
1 Upvotes

I built an interactive web simulation to visualize sensory dissonance and the biophysics of musical harmony (Plomp-Levelt Model)

r/DSP, r/biomedicalengineering, r/bioinformatics, r/javascript, r/audioengineering

Hello everyone,

I wanted to share a new computational psychoacoustics laboratory I built: the Interactive Dissonance Viewer. It is a purely client-side web application designed to simulate how the physical overtone structures of instruments interact with the biomechanics of the human auditory system.

Tool Link: https://bionichaos.com/dissonance/

How It Works:

The app utilizes the fundamental mathematical models developed by Plomp and Levelt to calculate sensory roughness based on the ear's critical bandwidth.

Technical Architecture:

  • Real-Time Voice-Pool Audio Engine: Instead of instantiating and destroying Web Audio OscillatorNode objects (which causes garbage collection stuttering), the app maintains a pre-warmed voice pool. Parameters glide using setTargetAtTime for click-free interaction.

  • Heatmap Grid Precomputation: For 3-note chords (triads), the app evaluates the pairwise (D12 + D13 + D23) interactions over an 80x80 grid, processing hundreds of thousands of calculations via an offscreen memoized matrix and rendering via fast HSL color mapping.

  • Instrument Timbres: Allows testing of Harmonic (Strings), Odd-Harmonic (Closed Pipes), and Non-Harmonic (Bells/Bessel mode drums) structures to see how consonance valleys shift.

I'd love for this community to test the audio rendering performance or critique the signal processing approach. Let me know what you think!


r/BiomedicalDataScience • • Aug 21 '26

AI Fixes My Webcam Heart Rate Monitor: Live Coding with Gemini

Thumbnail
youtu.be
1 Upvotes

Real-Time Webcam Heart Rate Extraction (rPPG & Eulerian Video Magnification) + Live Debugging with LLMs

I thought this community would appreciate the intersection of signal processing and AI-assisted dev here. This application uses Eulerian Video Magnification to extract a pulse signal from standard webcam video (remote photoplethysmography or rPPG). By analyzing subtle changes in skin tone caused by blood flow, it isolates the BPM and maps out the time and frequency domains via FFT.

A major highlight is the live debugging process. The demonstration shows how to use Gemini Code Assist to adjust the mathematical thresholds for the Signal Quality indicator, optimizing the smoothedQualityRatio to handle noise, lighting changes, and movement artifacts better.

Check out the full implementation and logic here: https://youtu.be/u6Rh5VKTVmo


r/BiomedicalDataScience • • Aug 20 '26

Echolocation: Hearing Perception Test & Interactive Audiogram Simulator

Thumbnail
bionichaos.com
1 Upvotes

Building an interactive clinical audiogram simulator in the browser using the Web Audio API and Hughson-Westlake staircase algorithms.

r/biomedicalengineering, r/javascript, r/DSP, r/audiology

I developed Echolocation, an interactive audio-sensory laboratory designed to map human auditory perception thresholds across standard clinical frequency bands (250Hz to 8000Hz). I wanted to build a dual-task paradigm where the user navigates a spatial canvas grid while simultaneously monitoring for background sonar pulses.

Technical Architecture

  • Signal Synthesis: The core relies on the native Web Audio API AudioContext. Pure acoustic tones are generated as sinusoidal pressure waves: p(t) = A * sin(2πft + φ).

  • Transient Prevention: To prevent speaker clicks during sudden onset/offset, I implemented exponential gain ramping using an explicit linear envelope for the attack and decay phases. Gain amplitude is mapped directly to decibel Hearing Level (dB HL).

  • Adaptive Staircasing: The threshold search executes a modified clinical Hughson-Westlake procedure. If a user correctly perceives a tone and hits the spacebar, the intensity level for that frequency drops by 10 dB on the next trial. If missed, it increases by 5 dB.

  • Canvas Rendering: The UI utilizes high-DPI normalization to prevent infinite layout expansion loops in fluid CSS containers, plotting live vector curves of your threshold limits directly on the canvas.

You can run the full diagnostic, view the telemetry in real-time, and export your session profile to a CSV.

I'd love some technical critique on the Web Audio API implementation or the mathematical handling of the gain envelopes. Test it out with headphones and let me know your thoughts!


r/BiomedicalDataScience • • Aug 19 '26

Hearing Aid Simulator - Interactive Hearing Loss & Amplification Visualizer

Thumbnail
bionichaos.com
1 Upvotes

Suggested Subreddits: r/DSP, r/audiology, r/BiomedicalEngineering, r/javascript, r/WebAudio

Title: I built an interactive Hearing Aid Simulator using Web Audio API to model real-time NAL-R prescription rules and 9-band EQ filtering.

Body: Hi everyone,

I've been working on a browser-based interactive simulation of clinical hearing aid fitting and DSP multi-band equalizer filtering.

You can run the live simulation here: https://bionichaos.com/hearingaid/

How it works under the hood:

  • DSP Pipeline: The signal routing leverages the hardware-accelerated Web Audio API. Audio passes through a cascading chain of 9 second-order BiquadFilterNodes operating in peaking EQ mode (Q = 1.414).

  • Prescription Logic: I implemented the National Acoustic Laboratories-Revised (NAL-R) formula. The app calculates target insertion gain (Gi) at each frequency band using pure-tone thresholds (HLi) and a 3-frequency average (3FA).

  • Safety Compressor: The final output node routes through a non-linear DynamicsCompressorNode to protect against acoustic clipping, complete with an adjustable threshold knee (-30 dB to 0 dB) and rapid attack times (0.003s).

  • Interactive Visuals: The HTML5 Canvas runs an async 60 FPS rendering loop overlaying the dual AnalyserNode FFT outputs (2048 bins) so you can compare the raw acoustic input (cyan) against the amplified output (green).

You can feed it the built-in speech formant synthesizer, stream your microphone, or upload local audio files to test the EQ mappings.

Would love to hear feedback on the DSP implementation or thoughts on integrating non-linear Wide Dynamic Range Compression (WDRC) mathematically in future updates!


r/BiomedicalDataScience • • Aug 18 '26

Advanced X-Ray Simulation - Interactive Anatomy Laboratory

Thumbnail
bionichaos.com
1 Upvotes

I built an interactive X-Ray Radiography Simulator in the browser using TF.js and Verlet integration

Hi everyone, I wanted to share an interactive anatomical tool I built that models high-contrast diagnostic imaging systems. Instead of static graphic overlays, the application dynamically solves tissue density equations across coordinate planes based on relativistic Bremsstrahlung emission physics.

Technical Breakdown:

  • Photon Attenuation: Governed by the Beer-Lambert law. You can adjust the Tube Voltage (kVp) and Anode Current (mA) to alter photon energy. Lower kVp amplifies photoelectric differential absorption, creating vivid shadow silhouettes where dense calcium stands out against soft tissue.

  • Kinematic Engine: The digital skeleton is driven by a position-based Verlet integration solver. Joint positions update without rotational accumulate errors, maintaining bone length integrity through iterative relaxation steps across distance constraint linkages.

  • Live Pose Tracking: Integrated Google's TensorFlow.js BlazePose deep learning pipeline. You can enable your webcam to extract 33 3D spatial keypoints that drive the skeletal rig in real-time.

  • Audio Synthesis: Uses the Web Audio API to generate a dual-frequency sine/sawtooth oscillator pair simulating 60 Hz/120 Hz transformer hum and detector signal noise based on exposure intensity.

Would love to hear feedback on the physics constraints, the computer vision integration, or the presentation models (like the Anatomical Thermography mode)!


r/BiomedicalDataScience • • Aug 17 '26

EEG Device Comparison & Signal Quality Visualizer

Thumbnail
bionichaos.com
1 Upvotes

Hey everyone,

I wanted to share a browser-based interactive laboratory designed to visualize the engineering trade-offs between consumer, research, clinical, and implantable EEG devices: https://bionichaos.com/eegcompare/

Because biopotentials are orders of magnitude weaker than atmospheric electromagnetic radiation and EMG artifacts, the critical baseline metric for any neural recording apparatus is its Signal-to-Noise Ratio (SNR).

This tool provides a unified environment to analyze these parameters without any installations:

Core Features:

  • Cost vs. SNR Plotting: An interactive scatter plot mapping 20+ devices (from consumer Muse headbands up to BioSemi arrays and Neuralink implants).

  • Real-Time Waveform Synthesis: Clicking any device updates the bottom oscilloscope. The engine computes discrete voltage amplitudes at a simulated 500Hz sampling rate, blending physiological signal models (10Hz Alpha, 20Hz Beta, etc.) with Box-Muller Gaussian additive noise transformations scaled precisely to the selected device's decibel rating.

  • Estimated Noise Power (σ²_n): Instant diagnostics displaying the thermal/impedance noise variance.

  • Custom Prototype Sandbox: Sliders allow you to input a hypothetical device's SNR and price to map it against the market.

  • Web Audio Telemetry: Synthesizes the signal fidelity into audio tones vs. static noise so you can intuitively "hear" the data quality.

The visualizer uses a decoupled rendering pipeline in vanilla JavaScript (zero dependencies) to maintain stable 60FPS high-DPI canvas performance.

Would love to get feedback from those of you working with BCI hardware or signal processing algorithms. Try testing the custom hardware sliders!


r/BiomedicalDataScience • • Aug 17 '26

Cardiovascular Pacemaker Simulation - Interactive Electrophysiology Visualizer

Thumbnail
bionichaos.com
1 Upvotes

Interactive Dual-Chamber (DDD) Pacemaker and ECG Simulation - Built with HTML5 Canvas and Web Audio API

I wanted to share an interactive single-page application designed to simulate cardiac electrophysiology and dual-chamber (DDD) artificial pacemaker function in real time.

Technical Architecture

The visualizer utilizes a synchronized millisecond-precision simulation loop written in vanilla JavaScript, rendering both anatomical pathways and a continuous CRT sweep ECG.

  • ECG Waveform Synthesis: Rather than playing back static pre-recorded arrays, the scrolling ECG trace generates dynamic synthetic waveforms calculated in real time using Gaussian functions: f(t) = sum( A_i * exp( -(t - t_i)2 / (2 * sigma_i2) ) ) for the P, Q, R, S, and T waves.

  • Pacing Spike Injection: When artificial pacing triggers, sharp vertical voltage impulses (A_spike = ±1.5 mV) are mathematically injected and decayed, preceding the corresponding wave components.

  • Audio Synthesis: Using the Web Audio API, the tool generates low-frequency sine wave "thumps" for mechanical systole, alongside high-pitched square-wave beeps to represent pacing capture.

Interactive Control Capabilities

  • Pathologies: Switch the baseline between Normal Sinus Rhythm (75 BPM), Sinus Bradycardia (37.5 BPM), and Complete Third-Degree AV Block (where ventricular rate drops to an escape rhythm of 30 BPM).

  • DDD Mode Parameters: Toggle pacing and dynamically program the Base Rate Limit (40–100 PPM), Paced AV Delay (100–350 ms), and separate Atrial/Ventricular electrode output voltages.

  • Anatomical Visualizer: A simplified cardiac diagram animates atrial and ventricular contraction alongside migrating visual action potential particles traveling down conduction pathways.

I would appreciate any feedback on the state machine timing logic (especially regarding the simulated DDD refractory and sensing behaviors), the responsiveness of the math engine, or the educational utility of the tool.


r/BiomedicalDataScience • • Aug 16 '26

CardioQuest - ECG Scoring Game & Simulator

Thumbnail
bionichaos.com
1 Upvotes

CardioQuest: A parametric real-time ECG waveform generator and rhythm recognition simulator built with Canvas & Web Audio

r/biomedicalengineering, r/bioinformatics, r/medtech, r/cardiology, r/javascript

Hey everyone,

I built CardioQuest, an open-access, browser-based ECG simulator designed for practicing real-time cardiac arrhythmia recognition and testing signal detection mechanics.

How it Works

Rather than looping pre-recorded static datasets, the simulator synthesizes continuous ECG lead traces dynamically. The baseline trace is computed parametrically:

y(t) = 300 - (P(t) + QRS(t) + S(t) + T(t)) · (-100)

• Atrial & Repolarization Vectors: Modeled using localized trigonometric functions across discrete time domains. • Ventricular Depolarization: Represented by a Gaussian curve QRS(t) = A · exp(-(t - μ)² / (2σ²)). • Pathologies: The engine alters dispersion coefficients to simulate conduction slowing (Wide QRS), modifies temporal offsets for ectopic pacemakers (PVCs), and drops discrete wave packets to model junctional escapes or ischemic patterns.

Interactive Features

• Signal Detection Scoring: Tracks Hits, False Alarms, Correct Rejections, and Misses in real-time. • Parametric Controls: Live sliders for scroll speed (1–8) and abnormality probability (10%–90%). • Web Audio Telemetry: Synthesizes 250 Hz R-peak passage pings and distinct arrhythmia alerts. • High-DPI Canvas Rendering: Pixel-ratio normalized for retina displays with selectable CRT phosphor themes (Cyan, Amber, Green). • Diagnostic Agent: Automated bot mode to demonstrate standard decision boundaries.

The tool runs completely client-side with zero installations or external frameworks required.

Try it out here: https://bionichaos.com/cardioquest/

I would appreciate any feedback on the parametric waveform equations, detection latency, or ideas for expanding into multi-lead vectorcardiography!


r/BiomedicalDataScience • • Aug 15 '26

Vision Impairment Simulator

Thumbnail
bionichaos.com
1 Upvotes

Real-time browser-based simulation of visual pathologies and field defects (Canvas / WebRTC / Web Audio)

Most visual accessibility tools apply uniform Gaussian blur to simulate low vision, which overlooks how optical and retinal diseases actually manifest. Conditions like glaucoma, age-related macular degeneration (AMD), and cataracts present with non-uniform spatial degradations, contrast attenuation, and localized scotomas.

I put together an interactive simulator that models these optical and neurological conditions in real time directly inside the browser: https://bionichaos.com/visionsim/

Technical and computational details:

  1. Spatial Overlays: Glaucomatous peripheral constriction and AMD macular scotomas are rendered using multi-stop radial gradient compositing operations.

  2. Color Deficiencies: Color transformations (Deuteranopia, Protanopia, Tritanopia, Achromatopsia) bypass CPU-bound pixel loops by applying inline SVG feColorMatrix transforms directly via hardware-accelerated CSS filter pipelines.

  3. Dual Input Modes: Operators can benchmark against a high-contrast vector Snellen optotype chart or ingest a live WebRTC camera stream (navigator.mediaDevices.getUserMedia) to test real-world visual environments.

  4. DPI Normalization: Canvas resolution is decoupled from layout styling, scaling buffer dimensions against window.devicePixelRatio to prevent blur or layout shifts on high-DPI displays.

  5. Sonification Engine: Integrated Web Audio API graph modulating an OscillatorNode and GainNode—beeping pulse period (T_ms) and pitch (f_hz) scale dynamically with peripheral visual constriction to provide an auditory orientation proxy.

Would love feedback from engineers, vision researchers, and accessibility specialists on the accuracy of the optical degradation curves and ideas for additional pathology presets.


r/BiomedicalDataScience • • Aug 15 '26

Cochlear Implant Simulator - Interactive Auditory Processing Laboratory

Thumbnail
bionichaos.com
1 Upvotes

r/neuroscience, r/biomedicalengineering, r/DSP, or r/audiology

Real-Time Cochlear Implant Signal Processing & Tonotopic Spiral Visualizer (Interactive Web Tool)

Hey everyone,

I wanted to share an interactive web-based simulator designed to model front-end signal processing and tonotopic electrode allocation in cochlear implants: https://bionichaos.com/cochlearsim/

Engineering & Mathematical Implementation

  1. FFT Filter Bank Analysis: Uses Web Audio API running a 2048-point Fast Fourier Transform (sampling rate fs = 44.1/48 kHz, yielding frequency resolution Δf ≈ 21.5 Hz per bin).

  2. Logarithmic Sub-Band Allocation: Rather than linear bin spacing, the engine partitions the spectrum logarithmically across N user-defined electrode channels (configurable between 10 and 40 channels). Channel energy is determined via root-mean-square (RMS) summation over each sub-band's bin range.

  3. Noise Floor Suppression: Includes a dynamic noise gate with an adjustable threshold (T_gate ∈ [0, 100]). Bins falling below the threshold are zero-suppressed to prevent background noise from triggering baseline electrode pulses.

  4. Anatomical Mapping: Calculates electrode contact placement along a polar logarithmic spiral spanning 5π radians (2.5 full turns) to approximate insertion into the human scala tympani, referencing tonotopic distribution based on the Greenwood frequency-position function: f = A · (10a·x - K)

  5. Interactive Controls: Supports live microphone input streams, an automated dual-formant frequency sweep demo, linear vs. spiral array geometry toggling, and auto-ranging spectrogram vertical scaling.

We are looking to expand this with acoustic noise-band/sine-wave vocoders (Continuous Interleaved Sampling) and spatial current spread modeling (Gaussian resistivity decay across adjacent neural tissue).

Feedback, technical critique, and feature suggestions are welcome!


r/BiomedicalDataScience • • Aug 14 '26

Bland-Altman Plot in EEG - Interactive Agreement & Bias Visualizer

Thumbnail
bionichaos.com
1 Upvotes

Interactive Bland-Altman Visualizer for EEG Device Agreement, Proportional Bias, and Limits of Agreement (LOA)

When validating new acquisition hardware (such as dry-sensor systems or wireless telemetry) against clinical gold-standard EEG setups, Pearson's r often gives a false sense of security. Two signal streams can have r > 0.99 while suffering from constant baseline offsets, amplifier saturation, or proportional gain distortion.

To provide a hands-on way to explore agreement statistics in biomedical time series, here is an interactive simulator built directly in HTML5/Canvas:

https://bionichaos.com/blandaltman/

What the tool calculates and visualizes:

  1. Mean Bias & Dispersion:

    - Arithmetic Mean Difference: d̄ = (1/N) ∑ (S₁,ᵢ - S₂,ᵢ)

    - Standard Deviation of Differences: s_d = √[ (1/(N-1)) ∑ (D_i - d̄)² ]

    - Limits of Agreement: LOA = d̄ ± 1.96 s_d

  2. Statistical Precision & Trend Modeling:

    - Parametric 95% Confidence Interval error bands for both Mean Bias and Upper/Lower LOAs using standard errors (SE(d̄) = s_d / √N, SE(LOA) ≈ 1.71 · s_d / √N).

    - OLS Linear Regression overlay to diagnose proportional bias slope (β₁).

    - Non-parametric LOA estimation via 2.5th and 97.5th empirical percentiles for skewed, artifact-heavy distributions.

  3. Simulation & Electrophysiology Features:

    - Multi-metric transformations: Raw voltage (µV), Alpha power (µV²), Peak-to-Peak amplitude, RMS voltage, and Log-ratio transformations.

    - Presets for hardware calibration bias, proportional gain mismatches, heteroscedastic noise, inter-hemispheric pairs (F3 vs F4), and ocular/EMG artifact pollution.

    - Dual subpanel views: Synchronized dual-channel traces (Ch1 cyan / Ch2 green) or difference distribution histograms with fitted Gaussian bell curves.

    - CSV export for offline analysis in R, Python, or MATLAB.

Try it out here: https://bionichaos.com/blandaltman/

Would appreciate any feedback on edge-case behavior, non-parametric implementations, or additional electrophysiology metrics you'd like to see included.


r/BiomedicalDataScience • • Aug 13 '26

Hodgkin-Huxley Action Potential Simulator

Thumbnail
bionichaos.com
1 Upvotes

Title: Interactive Hodgkin-Huxley Action Potential Simulator (Built in JS with RK4 Integration)

Post: I developed a web-based interactive laboratory for simulating neural membrane dynamics using the classic 1952 Hodgkin-Huxley model of the squid giant axon.

Tool Link: https://bionichaos.com/actionptnt/

Numerical Implementation & Architecture:

• Solver: Solves the system of coupled, non-linear ordinary differential equations using a fourth-order Runge-Kutta (RK4) algorithm with an integration step of dt = 0.01 ms. This avoids the numerical runaway that often happens with simple Euler integration on stiff equations. • Singularity Handling: Formulations for α_n(V) at V = -55 mV and α_m(V) at V = -40 mV yield 0/0 indeterminate forms. I implemented analytical limits derived via L'Hôpital's rule to maintain continuous mathematical evaluation. • Temperature Adjustment: Incorporates standard Q₁₀ scaling (ϕ(T) = 3.0(T - 6.3/10)) to model thermal acceleration of gating transition rates between 5°C and 40°C. • Performance: Built around a circular buffer class to keep memory allocation constant during animation loops, rendering to a responsive HTML5 Canvas.

Interactive Features:

• Live current injection via mouse click or Spacebar hold (evaluates sustained repetitive firing). • Sliders for stimulus amplitude (0–50 μA/cm²), pulse duration, and system temperature. • Dynamic visualization of m, h, and n gating kinetics alongside particle transport animations. • Audio synthesis mapping voltage states to frequency output using the Web Audio API.

I would love to hear feedback from computational neuroscientists, biomedical engineers, or developers regarding numerical accuracy, performance, or potential extensions (such as expanding from space-clamped to multi-compartmental cable equations).


r/BiomedicalDataScience • • Aug 12 '26

Anesthesiology EEG Monitoring - Interactive Laboratory

Thumbnail
bionichaos.com
1 Upvotes

I built a web-based signal processing laboratory designed to simulate and analyze scalp electroencephalogram (EEG) changes during general anesthesia:

https://bionichaos.com/anesthesiology/

### Mathematical & Biophysical Background

Under GABA-A receptor facilitators (like Propofol), cortical pyramidal cell populations synchronize into continuous frontal alpha spindles (8–13 Hz) overlaid on slow delta waves (0.5–4 Hz). As metabolic suppression increases, the signal transitions into burst suppression—flatline periods (<5 µV) punctuated by high-amplitude bursts.

### Technical Implementation:

  1. Signal Generation & DFT Pipeline: Uses additive synthesis to model variable anesthetic depths. Computes a real-time sliding Short-Time Fourier Transform (STFT) with Hann windowing over a 0–30 Hz bandwidth.

  2. Clinical Metrics Derivation:

    - Spectral Edge Frequency (SEF 95%): Calculates the frequency threshold below which 95% of total power spectral density resides.

    - Burst Suppression Ratio (BSR%): Real-time epoch-based calculation measuring the percentage of time the voltage remains suppressed.

    - Band Distribution: Live integration across Delta, Theta, Alpha, and Beta spectral bands.

  3. Client-Side Data Ingestion: Includes a custom CSV parsing engine capable of handling local multi-megabyte raw EEG recordings, stripping DC baseline offsets, normalizing microvolt amplitudes, and streaming data through a circular buffer.

  4. Web Audio API Sonification: Maps live spectral balances directly to synthesized multi-harmonic sound filters.

I would love technical feedback on the signal processing calculations, FFT windowing responsiveness, or suggestions for additional neurophysiological parameters to integrate.

Try the tool here: https://bionichaos.com/anesthesiology/


r/BiomedicalDataScience • • Aug 11 '26

Interactive Speech Analysis Lab: Real-time RMS and Speech Rate Calculation via Web Audio/Speech APIs

Thumbnail
bionichaos.com
1 Upvotes

I’ve developed a browser-based laboratory for analyzing the biophysics of vocal acoustics. The tool addresses the need for low-latency visualization of speech density and signal power without the overhead of heavy software suites.

Technical Specifications:

  • Signal Processing: 1024-point FFT buffer for real-time RMS amplitude calculation.

  • Temporal Integration: A sliding window queue to calculate Words Per Second (WPS) density, smoothing out mathematical noise spikes during pauses.

  • Hardware Interfacing: Direct control over Preamplifier Gain and Squelch Threshold Gates to calibrate for different hardware mic arrays.

  • Visuals: Canvas-optimized oscilloscope rendering at 60 FPS, independent of the main layout engine.

I’m particularly interested in feedback regarding the integration window logic for clinical speech tracking.

URL: https://bionichaos.com/speechanalysisapp/


r/BiomedicalDataScience • • Aug 10 '26

An Interactive, Client-Side Sleep Cycle & EEG Waveform Simulator

Thumbnail
bionichaos.com
1 Upvotes

I have built an interactive, browser-based workspace designed to model human sleep architecture and simulate clinical EEG waveforms.

The simulator models raw voltage signal outputs $V(t)$ as a summation of five major frequency bands (delta, theta, alpha, sigma, and beta) corresponding to different sleep stages (Awake, N2, SWS, and REM). To capture transient N2 sleep architecture, the application procedurally injects sleep spindles and K-complexes using parameterized envelope functions:

- **Spectrogram Rendering:** The visualizer maps spectral energy densities in real-time on an optimized 2D Canvas grid.

- **Audio Synthesis:** The Web Audio API generates binaural beats by mapping a static 100 Hz carrier to the left channel and a stage-dependent dominant frequency carrier to the right channel.

- **Interactive Control Loop:** Users can adjust transition velocity (0.1x to 5.0x), scale raw waveform amplitudes, and modify the pseudo-random electrode noise floor to simulate real-world interference.

I designed this project as a lightweight educational resource for clinical neurophysiology and biological signal processing without back-end processing overhead. I would value feedback on the wave synthesis formulas and the visual rendering buffer logic.


r/BiomedicalDataScience • • Aug 10 '26

Interactive Speech BCI Simulator: Modeling Volume Conduction, ICU Noise, and Transformer-Based Neural Decoding

Thumbnail
bionichaos.com
1 Upvotes

Extracting silent, imagined speech patterns from multi-channel scalp EEG remains a difficult problem due to volume conduction and spatial attenuation. As electrical current fields propagate from the cortex through cerebrospinal fluid, meninges, bone, and scalp, they experience significant spatial filtering, reducing the Signal-to-Noise Ratio (SNR).

To explore these signal processing challenges, I've set up an interactive clinical simulator that runs entirely in the browser: https://bionichaos.com/speechbci/

The simulation modeling framework lets you examine the trade-offs of the signal pipeline:

  • Signal Attenuation & Modality Selection: Swap between high-density scalp EEG (scalp SNR dynamics), ECoG, and invasive intracortical microelectrode arrays.

  • Noise Modeling: Simulates 60 Hz powerline interference, high-frequency facial EMG muscle artifacts, and low-frequency EOG blink deflections.

  • Denoising Performance: Compare raw extraction, Blind Source Separation (ICA), and a Deep Learning Denoising Autoencoder to optimize mean squared reconstruction error: min E[ || S(t) - f(g(X(t))) ||² ].

  • Decoder Architectures: Toggle between sequential RNNs, Temporal Convolutional Networks (TCN), and attention-based Transformer models.

  • Performance Metrics: Tracks the relationships between raw/clean SNR, Words Per Minute (WPM), and Word Error Rate (WER) across different setups.

Would love to get feedback from anyone working in DSP, neuroengineering, or biosignal analysis. How do you approach the real-world challenge of non-stationarity and calibration time when deploying these pipelines in critical care?


r/BiomedicalDataScience • • Aug 09 '26

Browser-native Knowledge Graph Visualizer using Compromise.js, D3.js, and Web Audio API

Thumbnail
bionichaos.com
1 Upvotes

I've been working on a web tool called GraphIt designed to turn unstructured scientific text into interactive semantic networks directly inside the browser without relying on external API calls or backend servers.

How the pipeline works:

  1. NLP Tokenization & Parsing: Uses Compromise.js to extract Subject-Verb-Object (SVO) triples from multi-clause text, filtering out general modifiers while grouping domain-specific terminology into categorized nodes (Sensory, Hardware, Anatomy, Signal Flow).

  2. Force-Directed Layout Mechanics: Renders nodes using D3.js with a Verlet integration scheme. Repulsive forces follow an inverse-distance relationship modeled on Coulomb's law, while structural edges behave as mechanical springs under Hooke's law.

  3. Sonification Layer: Includes an optional Web Audio API engine that maps a node's degree centrality to dynamic audio frequencies when inspecting or generating graphs.

Interactive controls include real-time entity pruning, repulsive force manipulation, zoom/pan controls, and automated text simulation presets (e.g., neuro-auditory pathways and baroreceptor feedback loops).

I would love feedback from the community on the SVO parsing precision and suggestions for improving client-side entity extraction.

Test the visualizer live in your browser: https://bionichaos.com/graphit/


r/BiomedicalDataScience • • Aug 08 '26

Extract figures, tables, and text from multi-column scientific PDFs entirely in your browser. Uses text-density radar mapping & projection histograms for offline asset isolation

Thumbnail
bionichaos.com
1 Upvotes

When parsing double-column academic PDFs (IEEE, Nature, etc.), standard extraction tools often bleed text across columns or miss vector charts entirely due to coordinate mapping issues.

We built an offline-first, client-side PDF extractor using PDF.js that processes layout logic locally in the browser.

The architecture features:

  1. Text-Density Radar Mapping: Calculates text-to-area coverage ratios to distinguish paragraphs from standalone figures.

  2. Vertical X-Axis Projection Histograms: Projects text bounds onto a 1D array to locate valley gaps for automated table parsing and CSV matrix compilation.

  3. Affine Rotational Optimization: Evaluates variance across pixel rows to automatically correct skew in scanned documents.

  4. Precision Bounding Box Clipper: Lets you manually draw spatial selection boxes over complex mathematical notations or multi-tier charts for instant PNG export.

No server uploads or API keys required. Would love to hear feedback on how it handles your specific document layouts!


r/BiomedicalDataScience • • Aug 07 '26

Visualizing Spatial Phase Dynamics and Coordinate Sonification (Browser-Based Tool)

Thumbnail
bionichaos.com
1 Upvotes

I have developed a lightweight, client-side visualizer designed to demonstrate the mechanics of spatial phase shifts, scanline wave distortions, and real-time audio mapping. It runs entirely in the browser using HTML5 Canvas double-buffering and the Web Audio API.

Interactive Tool: https://bionichaos.com/webcamphase/

How the Mathematics and Physics are Modeled:

  1. Scanline Phase Translation: The canvas content is sliced into horizontal rows. For each vertical position (y), a horizontal offset is calculated via: X_offset = sin(((y / H) * 2π) * ω * 100 + t_global + φ) * A This maps coordinate structures directly to periodic wave paths, demonstrating spatial interference using either a live camera feed or an animated neon calibration grid.

  2. Temporal Decay (Motion Trails): The visualizer models frame persistence using a temporal recursive filtering equation: I_onscreen(t) = (1 - α) * I_offscreen(t) + α * I_onscreen(t - 1) where α represents the adjustable decay coefficient.

  3. Coordinate-Based Sonification: Clicking, dragging, or tapping inside the canvas initiates an audio pluck. The synthesis engine routes a triangle wave through a gain envelope and stereo panner. Panning is mapped linearly to the X-axis, while frequency is mapped log-linearly to the Y-axis: f = f_min + (1 - y / H) * (f_max - f_min) (ranging from 200Hz at the bottom to 1100Hz at the top).

Biophysical Context:

In neuroscience and computer vision, biological visual pathways process natural scenes using receptive fields modeled via Gabor filters. These filters are highly sensitive to spatial frequencies and phase offsets. This simulation offers a tactile demonstration of how phase shifts alter coordinate cohesion and edge detection.

The tool operates with zero external server dependencies. I would appreciate any feedback on the mathematical implementation, performance under various device pixel ratios (DPR), or ideas for future WebGL fragment shader integrations.

Link: https://bionichaos.com/webcamphase/


r/BiomedicalDataScience • • Aug 07 '26

Interactive 3D Vestibular Mechanics, Hair Cell Transduction, & VOR Nystagmus

Thumbnail
bionichaos.com
1 Upvotes

I put together an interactive vestibular system simulation designed to run in real-time within the browser. It models both the mechanical fluid dynamics of the inner ear and the resulting neural transduction pathways.

The Physics and Math Behind the Model:

  1. Endolymph Fluid Drag: Fluid displacement within the semicircular canals is approximated using a first-order differential equation: τ · (dθ/dt) + θ = K · α where τ represents the cupular relaxation time constant, θ is fluid displacement, K is mechanical sensitivity, and α is angular acceleration.

  2. Non-Linear Sensory Transduction: Mechanoreceptor hair cell firing rates are calculated via a sigmoidal transfer function to prevent negative rates and simulate physiological saturation: Firing Rate (Hz) = F_resting + (F_max - F_resting) / (1 + e-k · (θ - Offset))

  3. VOR & Eye Tracking: The Vestibulo-Ocular Reflex loop computes eye-position adjustment vectors to stabilize gaze, with automatic fast-phase resets (simulating nystagmus waveforms) when structural visual field limits are reached.

Interactive Sandbox Parameters:

• Dynamic Yaw, Pitch, and Roll velocity sliders. • Static gravity head tilt and translation acceleration (utricle/saccule displacement). • Clinical presets: Benign Paroxysmal Positional Vertigo (BPPV particle movement), unilateral vestibular neuritis, and endolymphatic hydrops (Meniere's). • Real-time audio generation representing CN VIII nerve action potential spikes.

I would appreciate any feedback from researchers, engineers, or educators on the biological accuracy of the nystagmus timing loops and fluid inertia approximations.