CortEX is a cutting-edge, real-time web application designed to empower users through neurofeedback during meditation. Built using Next.js and TypeScript, the platform integrates EEG and ECG biopotential signals via Bluetooth Low Energy (BLE) to deliver a personalized, data-driven meditation experience.
To use CortEX effectively, you'll need:
A BLE-enabled biopotential signal board designed for:
- β EEG (Electroencephalogram)
- β ECG (Electrocardiogram)
- β EMG (Electromyogram)
- β EOG (Electrooculogram)
π‘ CortEX uses the NPG Liteβs BLE stream for real-time brain and heart activity visualization.
- EEG waveforms: Raw EEG data of the Left and Right hemispheres
- EEG FFT spider plot The Left and Right hemispheres EEG FFT data display Delta, Theta, Alpha, Beta, Gamma brainwave signals.
- ECG line graphs: Clean, real-time ECG plots to extract heart metrics.
- Heart Rate Variability chart: Displays real-time heart rate variability.
- Rendering: Uses WebGL for performance and Recharts for intuitive graphing.
- Relaxed: High Alpha, moderate Theta.
- Focused: High Beta and Gamma.
- Drowsy: Dominance of Delta/Theta.
- Meditative: Balanced Alpha and Theta with suppressed Beta.
- HRV Metrics:
- BPM (Beats Per Minute): Heart rate over time.
- SDNN (Standard Deviation of NN intervals): General variability (resilience).
- RMSSD (Root Mean Square of Successive Differences): Short-term parasympathetic activity.
- pNN50 (Percentage of successive NN intervals differing by >50 ms): % of adjacent NN intervals differing >50ms.
- High HRV β Relaxed, Low HRV β Stress/Fatigue.
- Start, pause, and end meditation sessions.
- Automatically logs:
- Session duration
- Time in each mental state
- Average EEG band power
- Heart rate trends & HRV indicators
- Summary dashboard:
- Radar/pie charts for brainwave distribution
- State classification timeline
- Focus and relaxation scores
- Tracks brain symmetry for cognitive balance:
- Separate EEG band power for left vs. right (e.g., F3 vs. F4)
- Visual meters and difference plots
- Real-time UI adjustments (e.g., color shift, waveform smoothness)
- Breathing circle animation synced with heart rate
- Motivational quotes between sessions
Handled in Web Workers to ensure real-time performance:
- EEG/ECG filtering (bandpass, notch)
- FFT
- Band power integration
- HRV computation (SDNN, RMSSD, pNN50)
- FFT on sliding EEG windows
- Band power extraction
- Normalization & ratio calculation
- Rule-based or ML-based classification
-
Detect R-peaks using threshold and derivative methods
-
Calculate RR intervals (time between successive heartbeats)
-
Derive the following HRV (Heart Rate Variability) metrics:
- BPM (Beats Per Minute): Average heart rate over time
- SDNN (Standard Deviation of NN intervals): Reflects overall variability and resilience
- RMSSD (Root Mean Square of Successive Differences): Measures short-term vagal (parasympathetic) activity
- pNN50 (Percentage of successive NN intervals differing by >50 ms): Indicator of parasympathetic nervous system strength
- Tailwind CSS for styling
- Light/Dark modes for comfort
- Responsive animations for feedback
- Radar plots, progress bars, symmetry meters for clarity
- Frontend: Next.js, React, TypeScript
- Visualization: WebGL (webgl-plot), Recharts
- Data Streaming: Web Bluetooth API (BLE)
- Performance: Web Workers
- Styling: Tailwind CSS
Built with great tools and libraries:
- Next.js, React, TypeScript
- Tailwind CSS, Framer Motion, Lucide React
- Radix UI components (
accordion
,dialog
,popover
, etc.) - Recharts, webgl-plot for visualization
- Embla Carousel for UI interactions
- ESLint, PostCSS, and DefinitelyTyped type definitions
Thanks to all the amazing communities!
Feature | Traditional Apps | π§ CortEX |
---|---|---|
EEG/ECG Integration | β Uses timers/audio | β Real EEG/ECG via BLE |
Real-Time Feedback | β Post-session only | β Live state updates, synced animations |
HRV Metrics | β BPM at best | β Full: BPM, SDNN, RMSSD, pNN50 |
Open-source Extensibility | β Closed-source | β Developer-friendly, research-ready |
Custom Signal Processing | β Black-box/no processing | β Built-in FFT, filters, classifiers |
Hemisphere Tracking | β Not available | β Symmetry-based brain analysis |
- π― Precision: Quantify your progress, not just guess it.
- π§ Effectiveness: Optimize your meditation with evidence.
- π§ͺ Science-backed: Built on peer-reviewed methods.
- π Transparency: Know how everything works.
- π οΈ Flexibility: Ideal for tinkerers, researchers, and biohackers.
Coming soon!
π« Built with love, neurons, and a sprinkle of curiosity by Ritika Mishra β decoding mindfulness, brainwave and heartwave.
Thank you for your interest in contributing β your support helps shape the CortEX. π
Aman Maheswari |
Deepak Khatri |
Deepesh Kumar |
Krishnanshu Mittal |
Ritika Mishra |
At CortEX, we celebrate collaboration, curiosity, and creativity.
Whether you're a neuroscientist, developer, designer, or simply someone deeply fascinated by the mind and inner states β there's a place for you here. Let's build meaningful, mindful experiences together.
This project is licensed under the MIT License β see the LICENSE file for details.