A web-based experimental heart rate detector that uses your phone's microphone to detect pulse vibrations from your neck.
- Clean, modular code architecture
- Microphone permission handling
- 15-second audio recording
- Bandpass filtering (0.8-3 Hz for heart rate detection)
- Real-time waveform visualization
- Heart rate calculation (BPM)
-
Upload all files to your web server:
index.htmlstyles.cssaudio-processor.jsui-controller.jsapp.js
-
Add your positioning guide image as
position-guide.png(optional)- Shows proper phone placement against neck
- If not provided, a simple emoji placeholder will display
-
Ensure your server uses HTTPS (required for microphone access)
├── index.html # Main HTML structure
├── styles.css # Styling and layout
├── audio-processor.js # Audio capture and signal processing
├── ui-controller.js # Interface management and visualization
├── app.js # Main application coordinator
└── position-guide.png # User positioning guide (to be added)
- Microphone access and permissions
- Audio recording and buffering
- Bandpass filtering (heart rate frequency isolation)
- Peak detection algorithm
- BPM calculation
- Step navigation
- Progress bar animation
- Waveform canvas rendering
- Result display
- Audio beep notification
- Event handlers for user interactions
- Coordination between audio processor and UI
- Application lifecycle management
- Microphone Access: Requests permission to use device microphone
- Audio Capture: Records 15 seconds of audio data from neck vibrations
- Signal Processing:
- Normalizes audio data
- Applies moving average smoothing
- Filters to isolate 0.8-3 Hz (48-180 BPM)
- Peak Detection: Identifies rhythmic peaks in the filtered signal
- BPM Calculation: Analyzes peak intervals to determine heart rate
- Visualization: Displays waveform and calculated BPM
- Chrome/Edge: Full support
- Safari: Full support (iOS requires user interaction before microphone access)
- Firefox: Full support
Note: HTTPS is required for microphone access in all browsers.
- Sample rate: Uses device's native audio sample rate (typically 44.1 kHz)
- Recording duration: 15 seconds
- BPM range: 40-200 (validated)
- Signal processing: Time-domain analysis with peak detection
- Not a medical device
- Accuracy depends on proper positioning
- Background noise can affect results
- Works best in quiet environments
- Requires steady hand during recording
- All processing happens locally in the browser
- No audio data is transmitted or stored
- Microphone access is used only during active recording
- Multiple measurement averaging
- Confidence score display
- Export results feature
- Historical tracking (local storage)
- Improved filtering algorithms
Made with curiosity | Not for medical use