以下为本文档的中文说明该技能用于从经过清洗的一维生理时间序列信号中估算心率和呼吸率单位为每分钟次数bpm。支持的信号类型包括雷达相位信号、WiFi CSI幅度、PPG信号或胸部运动信号。使用场景包括当Claude需要从噪声信号中选择合适的HR/BR带通滤波器边界在噪声频带中识别峰值频率排除HR二次谐波对基频的干扰处理呼吸缓慢时呼吸谐波泄漏到HR频带的问题标记低置信度的估算结果。核心处理流程包括将信号分割为呼吸频带和心率频带两个独立的带通滤波器使用零填充Welch功率谱密度估计计算峰值频率从各频带中提取峰值对应的频率并转换为bpm值。该技能明确了其不适用的场景心律失常或逐搏分析、多人源信号分离、以及快速非平稳速率估算。它通常作为雷达信号处理技能的下游模块使用。Vital-Sign ExtractionGiven a cleaned 1-D periodic signal (radar phase, WiFi CSI, PPG, piezo), estimate heart rate and breathing rate in bpm.Upstream ingestion of radar captures is theradar-signal-processingskill. This skill picks up after a 1-D signal is extracted.Pipeline (do every step)Split into BR and HR bandswith two separate bandpasses:BR:butter(4, [0.08, 0.5], btypeband, fsfs)— 4.8–30 bpmHR:butter(4, [0.7, 3.0], btypeband, fsfs)— 42–180 bpmPeak frequency via zero-padded Welch PSD:npersegmin(len(x),int(fs*25))f,pwelch(x,fsfs,npersegnperseg,noverlapnperseg//2,nfft8*nperseg,detrendconstant)in_band(flo)(fhi)peak_hzf[in_band][np.argmax(p[in_band])]HR harmonic rejection — always run:f_subf_peak/2.0if0.7f_sub3.0:p_subnp.interp(f_sub,f,p)p_topnp.interp(f_peak,f,p)ifp_sub0.5*p_top:f_peakf_sub# the peak was the 2nd harmonichr_bpmf_peak*60Cross-check with autocorrelation:acnp.correlate(x-x.mean(),x-x.mean(),modefull)acac[len(ac)//2:]/ac[len(ac)//2]lagint(fs/f_hi)np.argmax(ac[int(fs/f_hi):int(fs/f_lo)])bpm_ac60*fs/lagIfabs(bpm_ac - bpm_psd) 5, flag as low confidence.Decision rulesIfThenf_peak/2in HR band andp_sub 0.5 × p_topPick sub-harmonic (fundamental)PSD and autocorrelation disagree by 5 bpmFlag low confidence; do not commit to one valueBR estimate 10 bpm (slow breather)Expect HR-band contamination — see references/harmonic-pitfalls.mdHR 150 bpm (tachycardia)Widen HR band upper to 3.3 Hz, re-estimateClip 15 s longPSD bin spacing tolerance — prefer autocorrelation or flag inconclusiveSanity checks before reportingBR HR. Always true for a live adult at rest — if violated you swapped bands.HR × duration_minutes ≈ peak count in find_peaks(bandpassed_hr). Off by 2× → harmonic error slipped through.Resting adult plausibility: HR 50–90 bpm, BR 10–20 bpm. Way outside → re-check band edges, decimation factor, and harmonic rejection.Why the band edges above, not textbook 0.1–0.5 / 0.8–2.5See references/band-rationale.md. Short version: textbook bands miss slow breathers (supine clinical subjects breathe 5–10 bpm) and bradycardia (athletes, post-tilt-down).Why HR-harmonic and BR-leakage are criticalSee references/harmonic-pitfalls.md. These are the two failure modes that cost naïve pipelines the most accuracy on real data.Not in scopeArrhythmia / irregular rhythms — use R-peak / foot detection RR-interval analysis, not PSD.Multiple subjects in one signal — run source separation first.Rapidly non-stationary rate (exercise ramp) — use a spectrogram, not single-window PSD.
生理信号估算_vital-sign-extraction
以下为本文档的中文说明该技能用于从经过清洗的一维生理时间序列信号中估算心率和呼吸率单位为每分钟次数bpm。支持的信号类型包括雷达相位信号、WiFi CSI幅度、PPG信号或胸部运动信号。使用场景包括当Claude需要从噪声信号中选择合适的HR/BR带通滤波器边界在噪声频带中识别峰值频率排除HR二次谐波对基频的干扰处理呼吸缓慢时呼吸谐波泄漏到HR频带的问题标记低置信度的估算结果。核心处理流程包括将信号分割为呼吸频带和心率频带两个独立的带通滤波器使用零填充Welch功率谱密度估计计算峰值频率从各频带中提取峰值对应的频率并转换为bpm值。该技能明确了其不适用的场景心律失常或逐搏分析、多人源信号分离、以及快速非平稳速率估算。它通常作为雷达信号处理技能的下游模块使用。Vital-Sign ExtractionGiven a cleaned 1-D periodic signal (radar phase, WiFi CSI, PPG, piezo), estimate heart rate and breathing rate in bpm.Upstream ingestion of radar captures is theradar-signal-processingskill. This skill picks up after a 1-D signal is extracted.Pipeline (do every step)Split into BR and HR bandswith two separate bandpasses:BR:butter(4, [0.08, 0.5], btypeband, fsfs)— 4.8–30 bpmHR:butter(4, [0.7, 3.0], btypeband, fsfs)— 42–180 bpmPeak frequency via zero-padded Welch PSD:npersegmin(len(x),int(fs*25))f,pwelch(x,fsfs,npersegnperseg,noverlapnperseg//2,nfft8*nperseg,detrendconstant)in_band(flo)(fhi)peak_hzf[in_band][np.argmax(p[in_band])]HR harmonic rejection — always run:f_subf_peak/2.0if0.7f_sub3.0:p_subnp.interp(f_sub,f,p)p_topnp.interp(f_peak,f,p)ifp_sub0.5*p_top:f_peakf_sub# the peak was the 2nd harmonichr_bpmf_peak*60Cross-check with autocorrelation:acnp.correlate(x-x.mean(),x-x.mean(),modefull)acac[len(ac)//2:]/ac[len(ac)//2]lagint(fs/f_hi)np.argmax(ac[int(fs/f_hi):int(fs/f_lo)])bpm_ac60*fs/lagIfabs(bpm_ac - bpm_psd) 5, flag as low confidence.Decision rulesIfThenf_peak/2in HR band andp_sub 0.5 × p_topPick sub-harmonic (fundamental)PSD and autocorrelation disagree by 5 bpmFlag low confidence; do not commit to one valueBR estimate 10 bpm (slow breather)Expect HR-band contamination — see references/harmonic-pitfalls.mdHR 150 bpm (tachycardia)Widen HR band upper to 3.3 Hz, re-estimateClip 15 s longPSD bin spacing tolerance — prefer autocorrelation or flag inconclusiveSanity checks before reportingBR HR. Always true for a live adult at rest — if violated you swapped bands.HR × duration_minutes ≈ peak count in find_peaks(bandpassed_hr). Off by 2× → harmonic error slipped through.Resting adult plausibility: HR 50–90 bpm, BR 10–20 bpm. Way outside → re-check band edges, decimation factor, and harmonic rejection.Why the band edges above, not textbook 0.1–0.5 / 0.8–2.5See references/band-rationale.md. Short version: textbook bands miss slow breathers (supine clinical subjects breathe 5–10 bpm) and bradycardia (athletes, post-tilt-down).Why HR-harmonic and BR-leakage are criticalSee references/harmonic-pitfalls.md. These are the two failure modes that cost naïve pipelines the most accuracy on real data.Not in scopeArrhythmia / irregular rhythms — use R-peak / foot detection RR-interval analysis, not PSD.Multiple subjects in one signal — run source separation first.Rapidly non-stationary rate (exercise ramp) — use a spectrogram, not single-window PSD.