# R峰检测

R峰检测是一项信号处理任务，其目标是在心电图（ECG）记录中定位R峰，从而测量心率、心律以及逐搏间期。心电图是一种小幅度（0.01–5 mV）、低频（0.05–100 Hz）的非平稳信号，<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC5606151/)</sup>其中所含的[QRS波群](https://www.edgepedia.org/zh/qrs-complex)（心电图上标记每次心跳心室收缩的主尖峰）在健康受试者中通常持续不到120 ms，但在疾病状态下可能更长。<sup>[2](https://journals.plos.org/digitalhealth/article?id=10.1371%2Fjournal.pdig.0000538)</sup>参考基准是MIT-BIH心律失常数据库：包含48段各30分钟的记录，采样率360 Hz，10 mV范围内11位分辨率，共标注109,494个心搏。<sup>[3](https://www.cinc.org/archives/2021/pdf/CinC2021-267.pdf)</sup>

| 关键事实 | 数值 |
|---|---|
| 经典流程 | 带通滤波（5–15 Hz）、微分、平方、150 ms滑动窗积分、自适应双阈值<sup>[4](https://doi.org/10.1109/tbme.1985.325532)</sup> |
| Pan-Tompkins原始结果 | 在24小时MIT/BIH数据库上正确检测99.3%的QRS波群<sup>[4](https://doi.org/10.1109/tbme.1985.325532)</sup> |
| 评分容差 | ANSI/AAMI匹配窗150 ms；文献取值跨度60–160 ms<sup>[3](https://www.cinc.org/archives/2021/pdf/CinC2021-267.pdf)</sup> |
| 现代深度学习结果 | 残差U-Net：MIT-BIH上灵敏度99.76%、阳性预测值99.82%，误差2.3 ± 1.8 ms<sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC12499854/)</sup> |
| 对HRV的影响 | 23项HRV指标的一致性相关系数从0.99低至0甚至略为负值，取决于检测器<sup>[6](https://www.nature.com/articles/s41598-026-49215-6)</sup> |
| 病理影响 | 在多重合并症动态心电图记录上，各检测器的F度量从健康受试者的99%以上降至90.10%–30.10%<sup>[7](https://doi.org/10.1109/tbme.2016.2633277)</sup> |

## 工作原理

[QRS检测](https://www.edgepedia.org/zh/qrs-detection)依赖于根据QRS波群已知生理特性（如其特征性幅度和持续时间）推导出的手工规则。<sup>[8](https://www.nature.com/articles/s41598-026-53724-9)</sup>以QRS能量为中心的带通滤波器抑制P波、[T波](https://www.edgepedia.org/zh/t-wave)、基线漂移和高频噪声；最大化QRS能量的理想通带约为5–15 Hz。<sup>[4](https://doi.org/10.1109/tbme.1985.325532)</sup>

滤波之后，检测器对信号进行变换，使QRS能量占据主导。平方运算放大R峰的贡献，同时压制P波和T波等较小数值。<sup>[8](https://www.nature.com/articles/s41598-026-53724-9)</sup>微分算子增强QRS斜率并抑制P波和T波。<sup>[9](https://pure.tue.nl/ws/files/314931961/mbe-20-11-848.pdf)</sup>随后判决逻辑将真实心搏与残余干扰因素区分开来。一条经典规则是：当RR间期小于360 ms且波形最大斜率小于前一QRS最大斜率的一半时，判定为T波。<sup>[4](https://doi.org/10.1109/tbme.1985.325532)</sup>

## 实现方法

经典Pan-Tompkins算法包含五个步骤：带通滤波（5–15 Hz）、微分、平方、滑动窗积分和R峰检测。<sup>[9](https://pure.tue.nl/ws/files/314931961/mbe-20-11-848.pdf)</sup>在200样本/秒下，滑动窗积分器使用30样本窗（150 ms），约等于最宽QRS波群的宽度。<sup>[4](https://doi.org/10.1109/tbme.1985.325532)</sup>

判决阶段采用两个自适应阈值，每检测到一个心搏后更新，并在每次检测后强制执行200 ms不应期作为检测逻辑的一部分，这可能限制对紧密相邻波群的检测。<sup>[4](https://doi.org/10.1109/tbme.1985.325532)</sup>若在当前平均RR间期的166%以内未找到QRS，则回溯程序对该区间内的最大峰值施加较低阈值，以恢复低幅度心搏。<sup>[4](https://doi.org/10.1109/tbme.1985.325532)</sup>对于二联律或三联律等不规则心律，两个阈值均减半以提高灵敏度。<sup>[4](https://doi.org/10.1109/tbme.1985.325532)</sup>一种常见的自适应阈值形式为 \( \Theta_{x} = 0.3\text{–}0.4 \cdot \max[K_{x}] \)，其中最大值可在线计算或基于当前片段计算。<sup>[10](https://people.ece.cornell.edu/land/courses/ece5030/labs/s2014/QRS_detect_review.pdf)</sup>

## 起源

该算法由Jiapu Pan和Willis J. Tompkins在《一种实时QRS检测算法》（IEEE生物医学工程汇刊，1985年）中提出，通过斜率、幅度和宽度的数字分析来检测QRS波群。<sup>[4](https://doi.org/10.1109/tbme.1985.325532)</sup>一年后，Patrick S. Hamilton和Willis J. Tompkins发表了《利用MIT/BIH心律失常数据库对QRS检测规则的定量研究》（IEEE生物医学工程汇刊，1986年），在同一数据库上对检测规则进行了系统研究。<sup>[11](https://doi.org/10.1109/tbme.1986.325695)</sup>两者均建立在更早的工作之上：到2002年，软件QRS检测已作为研究课题存在了30多年，其共同结构为预处理或特征提取，随后是峰值检测和判决逻辑组成的判决阶段。<sup>[10](https://people.ece.cornell.edu/land/courses/ece5030/labs/s2014/QRS_detect_review.pdf)</sup>比较研究中采用的前驱方案归功于Moriet-Mahoudeaux、Fraden和Neuman、Holsinger、Menard、Balda、Okada以及Englese和Zeelenberg等人。<sup>[12](https://www.robots.ox.ac.uk/~gari/teaching/cdt/A3/readings/ECG/Friesen1990.pdf)</sup>MIT-BIH数据库本身由G.B. Moody和R.G. Mark于2001年描述，成为这些检测器的标准评估资源。<sup>[13](https://doi.org/10.1109/51.932724)</sup>

## 变体

2023年的一篇综述归纳了主要类别：基于微分的方法、滤波器组方法、数学形态学方法、Shannon/Hilbert/小波变换方法、模板匹配方法以及卷积神经网络方法。<sup>[14](https://link.springer.com/article/10.1007/s11831-023-09916-x)</sup>

- **微分与能量方法。** Natalia M. Arzeno、Zhi-De Deng和Chi-Sang Poon（2008年）系统分析了基于一阶微分的检测，涵盖平方和Hilbert变换变体。<sup>[15](https://doi.org/10.1109/tbme.2007.912658)</sup>Honghai Zhu和Jun Dong（2013年）提出了基于Shannon能量包络峰的检测方法。<sup>[16](https://doi.org/10.1016/j.bspc.2013.01.001)</sup>
- **小波方法。** Cuiwei Li、Chongxun Zheng和Changfeng Tai（1995年）引入了心电图特征点的小波变换检测。<sup>[17](https://doi.org/10.1109/10.362922)</sup>J.P. Martinez及其同事（2004年）发表了在标准数据库上评估的基于小波的心电波形标定器。<sup>[18](https://doi.org/10.1109/tbme.2003.821031)</sup>M. Merah、T.A. Abdelmalik和B.H. Larbi（2015年）使用[平稳小波变换](https://www.edgepedia.org/zh/stationary-wavelet-transform)进行R峰检测。<sup>[19](https://doi.org/10.1016/j.cmpb.2015.06.003)</sup>
- **滤波器组与自适应阈值。** V.X. Afonso、W.J. Tompkins、T.Q. Nguyen和Shen Luo（1999年）引入了滤波器组心搏检测。<sup>[20](https://doi.org/10.1109/10.740882)</sup>Ivaylo I Christov（2004年）发表了采用组合自适应阈值的实时检测器。<sup>[21](https://doi.org/10.1186/1475-925x-3-28)</sup>Mohamed Elgendi（2013年）引入了一种快速知识驱动方法，并在11个标准心电图数据库上进行了评估。<sup>[22](https://doi.org/10.1371/journal.pone.0073557)</sup>
- **深度学习。** Wenjie Cai和Danqin Hu（2020年）将深度神经网络应用于QRS检测。<sup>[23](https://doi.org/10.1109/access.2020.2997473)</sup>Laitala及其同事使用LSTM网络直接从原始心电图预测R峰位置，并利用噪声心电图生成器进行训练增强。<sup>[24](https://par.nsf.gov/servlets/purl/10165243)</sup>一种深度残差U-Net结合200 ms中值滤波基线校正、40 Hz低通Butterworth滤波和z分数归一化，性能优于Pan-Tompkins、Hamilton-Tompkins、1D CNN、LSTM-CNN和ResNet-18基线。<sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC12499854/)</sup>Naimul Khan和Md Niaz Imtiaz（2023年）提出了Pan-Tompkins++作为一种稳健的R峰方法。<sup>[25](https://doi.org/10.32920/22734308)</sup>

## 应用

R峰位置为心率计算、HRV分析、心律失常筛查以及进一步的心电图 delineation 和分类提供基础。检测器的选择对HRV至关重要：在八种广泛使用的检测器中，23项HRV指标的一致性相关系数从0.99低至0甚至略为负值，取决于检测器和条件，其中two_average总体一致性最高，engzee最低。<sup>[6](https://www.nature.com/articles/s41598-026-49215-6)</sup>ANSI建议将150 ms定义为QRS检测的时间容差，而HRV分析需要毫秒级的时间精度，这种不匹配是宽松评分窗口所无法揭示的。<sup>[3](https://www.cinc.org/archives/2021/pdf/CinC2021-267.pdf)</sup>

在可穿戴设备和远程医疗中，一种结合有限状态机的双微分检测器在私有可穿戴数据库上达到99.77%灵敏度和99.18%阳性预测值，但在100 ms接受窗下，Elgendi和Gamboa的方法在同一数据上仅达到73%和64%灵敏度。<sup>[26](https://www.scitepress.org/PublishedPapers/2020/101471/101471.pdf)</sup>一种2026年的动态单阈值可穿戴算法使用FIR滤波、非线性能量算子和滑动窗积分，在627条记录上达到99.57%的平均灵敏度，并在定制STM32微控制器上实时运行。<sup>[27](https://iopscience.iop.org/article/10.1088/1361-6501/ae8921)</sup>R峰还作为其他模型的标志点：KEED delineation模型使用Pan-Tompkins找到R峰并将信号分割为RR间期，然后估计波形的起点、终点和峰值。<sup>[28](https://arxiv.org/pdf/2407.20258)</sup>

## 局限与替代方案

主要基准数据虽高，但强烈依赖于时间容差。原始Pan-Tompkins论文报告在24小时MIT/BIH数据库上正确检测率为99.3%。<sup>[4](https://doi.org/10.1109/tbme.1985.325532)</sup>文献中的容差取值从60 ms到160 ms不等；在接近ANSI 150 ms建议的152.78 ms容差下，检测错误率为1%至约2%，但收紧至60 ms时，Pan-Tompkins的错误率最高升至90%，而其他三种测试方法保持在6%以下。<sup>[3](https://www.cinc.org/archives/2021/pdf/CinC2021-267.pdf)</sup>一项抖动加F度量的基准在原始协议下确认了Pan和Tompkins的99.3%，但在更严格的度量下产生75.3 ± 19.1。<sup>[29](https://eprints.gla.ac.uk/333001/1/333001.pdf)</sup>在远程医疗级信号上，Liu及其同事比较的十种检测器在高质量信号上F1超过99%，在低质量信号上最多80%，在起搏和心律失常期间至少94%。<sup>[2](https://journals.plos.org/digitalhealth/article?id=10.1371%2Fjournal.pdig.0000538)</sup>

病理和噪声进一步降低检测性能。依赖规律RR间期时序的算法（如Pan-Tompkins）在该假设被违反的心律失常记录中可能表现不佳。<sup>[8](https://www.nature.com/articles/s41598-026-53724-9)</sup>平方运算是Pan-Tompkins的核心步骤，当片段中混合大幅度和低幅度R峰时会产生不利影响，因为小于1的值会缩小而大于1的值会放大；自适应幅度和时间间隔阈值可避免此问题。<sup>[1](https://pmc.ncbi.nlm.nih.gov/articles/PMC5606151/)</sup>通过STAPLE比较的九种检测器在健康受试者上F度量超过99%，但在来自多重合并症受试者的3700万个R波上降至F = 90.10%至F = 30.10%之间。

经典方法与深度学习的权衡是鲁棒性与噪声容忍度之间的取舍。传统方法依赖基于稳定QRS生理特性的手工规则，对分布偏移相对鲁棒，而深度学习模型在陌生噪声模式或心电图形态上可能退化。<sup>[8](https://www.nature.com/articles/s41598-026-53724-9)</sup>相反，基于规则的检测器通常仅在相对干净的心电图上表现良好，对基线漂移和肌电伪迹不鲁棒；在一条低质量记录上，LSTM方法达到F1 = 0.996，而Hamilton和Christov降至0.92以下。<sup>[24](https://par.nsf.gov/servlets/purl/10165243)</sup>在−6 dB信噪比的严重噪声下，残差U-Net保持灵敏度高于98.2%。<sup>[5](https://pmc.ncbi.nlm.nih.gov/articles/PMC12499854/)</sup>综述还记录到，许多研究使用自定义验证而无WFDB比较器，无法区分心搏与非心搏标注，从而虚增真阳性、假阳性和假阴性。<sup>[30](https://www.mdpi.com/2076-3417/14/21/10078)</sup>

## References

1. [An Adaptive and Time-Efficient ECG R-Peak Detection Algorithm](https://pmc.ncbi.nlm.nih.gov/articles/PMC5606151/)
2. [QRS detection in single-lead, telehealth electrocardiogram signals: Benchmarking open-source algorithms (PLOS Digital Health)](https://journals.plos.org/digitalhealth/article?id=10.1371%2Fjournal.pdig.0000538)
3. [Sensitivity of QRS Detection Accuracy to Detector Temporal Resolution (Computing in Cardiology 2021)](https://www.cinc.org/archives/2021/pdf/CinC2021-267.pdf)
4. [Jiapu Pan, Willis J. Tompkins (1985). A Real-Time QRS Detection Algorithm. IEEE Transactions on Biomedical Engineering.](https://doi.org/10.1109/tbme.1985.325532)
5. [Robust R-peak detection in noisy ECG using deep residual U-Net (2025)](https://pmc.ncbi.nlm.nih.gov/articles/PMC12499854/)
6. [Effects of electrocardiogram QRS detection algorithms in heart rate variability metrics (Scientific Reports, 2026)](https://www.nature.com/articles/s41598-026-49215-6)
7. [Deterioration of R-Wave Detection in Pathology and Noise: A Comprehensive Analysis Using STAPLE (aggregated publication record)](https://doi.org/10.1109/tbme.2016.2633277)
8. [A reproducible benchmark of QRS detection algorithms across diverse ECG datasets and noise conditions (Scientific Reports, 2026)](https://www.nature.com/articles/s41598-026-53724-9)
9. [Precise detection and localization of R-peaks from ECG signals (modification of the Pan-Tompkins algorithm)](https://pure.tue.nl/ws/files/314931961/mbe-20-11-848.pdf)
10. [The principles of software QRS detection (Köhler, Hennig, Orglmeister, IEEE Eng. Med. Biol. Mag., 2002)](https://people.ece.cornell.edu/land/courses/ece5030/labs/s2014/QRS_detect_review.pdf)
11. [Patrick S. Hamilton, Willis J. Tompkins (1986). Quantitative Investigation of QRS Detection Rules Using the MIT/BIH Arrhythmia Database. IEEE Transactions on Biomedical Engineering.](https://doi.org/10.1109/tbme.1986.325695)
12. [A comparison of the noise sensitivity of nine QRS detection algorithms (Friesen et al., IEEE Trans. Biomed. Eng., 1990)](https://www.robots.ox.ac.uk/~gari/teaching/cdt/A3/readings/ECG/Friesen1990.pdf)
13. [G.B. Moody, R.G. Mark (2001). The impact of the MIT-BIH Arrhythmia Database. IEEE Engineering in Medicine and Biology Magazine.](https://doi.org/10.1109/51.932724)
14. [A Comprehensive Review of Computer-based Techniques for R-Peaks/QRS Complex Detection in ECG Signal (Archives of Computational Methods in Engineering, 2023)](https://link.springer.com/article/10.1007/s11831-023-09916-x)
15. [Natalia M. Arzeno, Zhi-De Deng, Chi-Sang Poon (2008). Analysis of First-Derivative Based QRS Detection Algorithms. IEEE Transactions on Biomedical Engineering.](https://doi.org/10.1109/tbme.2007.912658)
16. [Honghai Zhu, Jun Dong (2013). An R-peak detection method based on peaks of Shannon energy envelope. Biomedical Signal Processing and Control.](https://doi.org/10.1016/j.bspc.2013.01.001)
17. [Cuiwei Li, Chongxun Zheng, Changfeng Tai (1995). Detection of ECG characteristic points using wavelet transforms. IEEE Transactions on Biomedical Engineering.](https://doi.org/10.1109/10.362922)
18. [J.P. Martinez and colleagues (2004). A Wavelet-Based ECG Delineator: Evaluation on Standard Databases. IEEE Transactions on Biomedical Engineering.](https://doi.org/10.1109/tbme.2003.821031)
19. [M. Merah, T.A. Abdelmalik, B.H. Larbi (2015). R-peaks detection based on stationary wavelet transform. Computer Methods and Programs in Biomedicine.](https://doi.org/10.1016/j.cmpb.2015.06.003)
20. [V.X. Afonso and colleagues (1999). ECG beat detection using filter banks. IEEE Transactions on Biomedical Engineering.](https://doi.org/10.1109/10.740882)
21. [Ivaylo I Christov (2004). Real time electrocardiogram QRS detection using combined adaptive threshold. BioMedical Engineering OnLine.](https://doi.org/10.1186/1475-925x-3-28)
22. [Mohamed Elgendi (2013). Fast QRS Detection with an Optimized Knowledge-Based Method: Evaluation on 11 Standard ECG Databases. PLoS ONE.](https://doi.org/10.1371/journal.pone.0073557)
23. [Wenjie Cai, Danqin Hu (2020). QRS Complex Detection Using Novel Deep Learning Neural Networks. IEEE Access.](https://doi.org/10.1109/access.2020.2997473)
24. [Robust ECG R-peak Detection Using LSTM (Laitala et al.)](https://par.nsf.gov/servlets/purl/10165243)
25. [Naimul Khan, Md Niaz Imtiaz (2023). Pan-Tompkins++: A Robust Approach to Detect R-peaks in ECG Signals. .](https://doi.org/10.32920/22734308)
26. [R-peak Detector Benchmarking using FieldWiz and Physionet Databases (SCITEPRESS, 2020)](https://www.scitepress.org/PublishedPapers/2020/101471/101471.pdf)
27. [A dynamic single-threshold QRS detection algorithm for wearable electrocardiogram sensors (Measurement Science and Technology, 2026)](https://iopscience.iop.org/article/10.1088/1361-6501/ae8921)
28. [KEED: Keypoint Estimation for Electrocardiogram Delineation (arXiv preprint)](https://arxiv.org/pdf/2407.20258)
29. [A new QRS detector stress test combining temporal jitter and F-score (JF) reveals significant performance differences amongst popular detectors (University of Glasgow eprints)](https://eprints.gla.ac.uk/333001/1/333001.pdf)
30. [Towards Reliable ECG Analysis: Addressing Validation Gaps in the Electrocardiographic R-Peak Detection (Applied Sciences, 2024)](https://www.mdpi.com/2076-3417/14/21/10078)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026 · Last review: Sep 30, 2026*

Topic: 生命与健康 › 人类健康与医学 › 临床评估与诊疗操作 › Diagnosis and clinical assessment › Audiology and hearing assessment

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/r-peak-detection

English original: https://www.edgepedia.org/r-peak-detection
