A compact architecture for heartbeat monitoring