[Geoespacial]

PSAP CPR Cadence Engine

The CPR Cadence Engine provides real-time audio-guided chest compression timing for emergency callers performing CPR.

Metadados do modulo

The CPR Cadence Engine provides real-time audio-guided chest compression timing for emergency callers performing CPR.

Voltar a Todos os Módulos

Referencia de origem

content/modules/psap-cpr-cadence-engine.md

Última Atualização

2 de abr. de 2026

Categoria

Geoespacial

Checksum do conteudo

62a506dc16ff1f9a

Etiquetas

geospatialaireal-time

Documentacao renderizada

Esta pagina renderiza o Markdown e Mermaid do modulo diretamente da fonte publica de documentacao.

Overview#

The CPR Cadence Engine provides real-time audio-guided chest compression timing for emergency callers performing CPR. When the AI voice assistant identifies a cardiac arrest scenario and activates a CPR protocol, the cadence engine generates a precise 110 BPM metronome tone and injects it directly into the active phone call as mulaw-encoded audio frames. The engine maintains drift-corrected timing, pauses intelligently when the caller speaks, and performs automatic check-ins every 60 beats to confirm the caller's status.

This capability enables PSAP AI systems to deliver life-saving CPR coaching over the phone without requiring a human dispatcher, while maintaining medically accurate compression timing that matches American Heart Association guidelines.

Key Features#

  • 110 BPM Drift-Corrected Timing - The cadence loop uses wall-clock drift correction on each beat to maintain precise 110 BPM timing (approximately 545ms per beat) over extended CPR sessions. Timing accuracy is maintained regardless of system load or audio processing latency.

  • Precomputed Audio Tables - A 64K-entry PCM16-to-mulaw lookup table is precomputed at module load time, enabling O(1) per-sample encoding. Resampling index arrays for common Twilio chunk sizes are cached (limited to 64 entries) to avoid repeated numpy allocations every 20ms.

  • Caller-Aware Pausing - The cadence engine pauses automatically when the caller is speaking, preventing the metronome from interfering with voice communication. The engine resumes when speech ends without requiring manual intervention.

  • Automatic Check-Ins - Every 60 beats (approximately 33 seconds), the cadence engine pauses to allow the AI to check in with the caller, asking about the patient's status and the caller's ability to continue. At the two-minute mark (220 beats), a longer check-in assesses whether the patient has regained consciousness or breathing.

  • Session-Level State Management - Each active cadence session tracks beat count, BPM, paused/stopped state, and check-in interval. Multiple concurrent cadence sessions across different calls are supported without interference.

  • Non-Blocking Error Handling - The cadence engine never blocks on errors. If audio generation or WebSocket transmission fails, the engine logs the error and continues the timing loop, ensuring the caller is not left in silence during a critical medical emergency.

Use Cases#

  • AI-Guided CPR - When a caller reports a person who is unresponsive and not breathing, the AI voice assistant activates the CPR protocol and starts the cadence engine, providing the caller with an audible timing guide for chest compressions.
  • Bystander Assistance - Untrained bystanders performing CPR for the first time receive consistent, accurate compression timing without requiring a human dispatcher to count aloud, freeing dispatchers for other emergency coordination.
  • Extended CPR Sessions - The cadence engine maintains accurate timing over sessions lasting 10 minutes or more, with regular check-ins that monitor both the patient's condition and the caller's physical endurance.

Integration#

The CPR Cadence Engine is activated by the medical protocol state machine when a CPR step is reached in the active protocol. It connects to the voice AI session for speech detection and pause control, and the call summary service for recording cadence activation in the incident timeline.

Last Reviewed: 2026-04-02