A method and system for extracting respiration rate based on a wearable optoelectronic sensor

By extracting pulsation features guided by prior heart rate and fusion processing using a multi-channel state machine, the anti-interference and robustness issues of respiratory rate extraction in existing technologies are solved, achieving high-precision and low-power respiratory rate monitoring.

CN123126772APending Publication Date: 2026-11-20XIANGYA HOSPITAL CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611440842.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-16
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing respiratory rate extraction methods have weak anti-interference capabilities, poor robustness of single channels, are prone to misjudgment due to fixed windows, and rigid filtering may mistakenly kill valid signals. Traditional fusion strategies lack error correction capabilities, resulting in inaccurate respiratory rate extraction.

Method used

The method employs prior heart rate-guided pulsation feature extraction, combined with low-speed unified time base resampling and respiratory frequency band isolation processing, intelligent peak search and Mayer wave suppression, and multi-channel state machine fusion processing. It extracts respiratory frequency by combining time and frequency domain methods, uses external prior heart rate to dynamically adjust the refractory period, and suppresses Mayer wave interference, thereby achieving efficient fusion of multi-channel feature signals.

Benefits of technology

It improves the accuracy of respiratory rate extraction, enhances anti-interference ability, reduces resource consumption, ensures accurate output of respiratory rate even during exercise and sleep, and achieves low-power real-time monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123126772A_ABST
    Figure CN123126772A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of vital sign monitoring, and particularly relates to a respiration frequency extraction method and system based on a wearable photoelectric sensor, which comprises prior heart rate guided pulsation feature extraction, low-speed unified time base resampling and respiration band isolation processing, intelligent peak searching and Mayer wave suppression processing, multi-channel state machine fusion processing, and outputs the final respiration frequency. The method comprises: setting a dynamic refractory period based on an external prior heart rate to extract heart beat features, eliminating double peak interference in the time domain; performing low-speed unified resampling and frequency band isolation on the feature signal; constructing an intelligent peak searching mechanism to suppress low-frequency interference such as Mayer wave; performing multi-channel state machine fusion and confidence evaluation on the multi-path features, and outputting the final respiration frequency. The present application constructs a closed loop link of "time domain guided anti-interference-frequency domain peak searching low frequency suppression-cross channel state machine error prevention", which significantly improves the accuracy of respiration frequency extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vital sign monitoring technology, and in particular to a method and system for extracting respiratory rate based on a wearable photoelectric sensor. Background Technology

[0002] Existing technologies have already developed wearable devices for continuous monitoring of vital signs, such as smartwatches, wristbands, heart rate measuring instruments, and sleep monitors.

[0003] Human respiratory activity modulates the PPG signal through three main mechanisms: baseline modulation (BM, which changes venous return with variations in intrathoracic pressure), amplitude modulation (AM, which changes stroke volume), and frequency modulation (RSA, i.e., respiratory sinus arrhythmia, where the heart rate increases during inspiration and decreases during expiration). Existing embedded technologies typically extract only the single feature of baseline modulation (BM). This is usually achieved by applying a deep low-pass filter (e.g., <0.5Hz) to the original PPG waveform and then outputting the respiratory rate through time-domain zero-crossing detection or simple frequency-domain peak finding.

[0004] The existing technology has the following drawbacks: ① It has weak anti-interference ability and is easily deceived by Mayer waves. Specifically, the Mayer waves of the human cardiovascular system (usually around 0.1Hz) have extremely strong energy in the baseline (BM) signal. Existing algorithms are very likely to mistake them for real breathing (leading to an incorrect output of an extremely low breathing rate).

[0005] ② The single-channel robustness is poor. Specifically, the baseline drift is often disrupted under certain sleeping positions or slight movements, causing the algorithm that relies solely on BM to fail completely.

[0006] ③ The contradiction between resource consumption and real-time performance is as follows: If multiple channel features (BM, AM, RSA) are to be extracted simultaneously and high-precision frequency domain analysis is to be performed, the traditional direct processing method will consume a huge amount of MCU computing power and RAM, making it difficult to run in real time on a low-power platform.

[0007] ④ Fixed windows are prone to misjudgment. Specifically, the fixed peak-finding time window cannot adapt to the dynamic changes in human heart rate, and is very likely to misjudge the diphtheria wave (double peak) of the PPG signal as a real heartbeat, resulting in complete confusion in the extraction of RSA and AM features.

[0008] ⑤ Rigid filtering mistakenly kills valid signals. Specifically, traditional hard-cut high-pass filtering, while filtering Mayer waves, also severely weakens the real signals of deep and slow breathing (below 0.15Hz), causing the algorithm to fail in low-frequency scenarios such as sleep monitoring.

[0009] ⑥ Traditional fusion strategies lack error correction capabilities. Specifically, when a channel is severely distorted (such as BM being completely contaminated by Mayer waves), erroneous data will still participate in the calculation, lowering the overall accuracy. There is a lack of underlying engineering error prevention assertion mechanisms.

[0010] Therefore, it is necessary to provide a new method for extracting respiratory rate to solve the above-mentioned technical problems. Summary of the Invention

[0011] The main objective of this invention is to provide a method and system for extracting respiratory rate based on a wearable photoelectric sensor, aiming to solve problems such as weak anti-interference capability, poor robustness of a single channel, high susceptibility to misjudgment due to fixed windows, and rigid filtering that mistakenly rejects valid signals in existing methods. The specific solution is as follows: A method for extracting respiratory rate includes the following steps: Step S1, prior heart rate-guided pulsation feature extraction, specifically involves: receiving the raw photoelectric signal; separating the baseline signal BM and the AC signal AC based on a baseline low-pass filter and an AC band-pass filter; obtaining an adaptive peak threshold based on the AC signal AC; and receiving the prior heart rate. Based on prior heart rate Obtain the prior value of the cardiac interval Based on the prior value of the cardiac interval The refractory period of heartbeat detection is obtained; combining the prior value of the heartbeat interval, the adaptive peak threshold, and the refractory period of heartbeat detection, the AC signal is subjected to time-domain peak finding and valley tracking. The peak-valley amplitude AM is extracted by the peak-valley difference, and the heartbeat interval RSA is extracted by the interval between adjacent peaks; the three characteristic signals of the heartbeat, namely the baseline signal BM, the peak-valley amplitude AM, and the heartbeat interval RSA, are obtained. Step S2, low-speed unified time base resampling and respiratory frequency band isolation processing, specifically: the three characteristic signals of the heartbeat obtained in step S1, namely the baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA, are uniformly mapped onto a low-speed equal-interval time base; a two-stage cascaded Biquad bandpass filter is applied to obtain the processed three characteristic signals of the heartbeat, namely the baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA. Step S3, intelligent peak search and Mayer wave suppression processing, specifically involves applying a Hann window and performing an FFT transform on the processed baseline signal BM, peak-valley amplitude AM, and heart interval RSA characteristic signals of the heartbeat, respectively. The squared magnitude is calculated to obtain the power spectrum, which is then normalized within the corresponding frequency band to obtain the normalized power spectrum of the baseline signal BM, peak-valley amplitude AM, and heart interval RSA characteristic signals. , and After Mayer suppression, candidate frequencies are obtained. , and ; Step S4: Multi-channel state machine fusion processing to output the final breathing frequency.

[0012] Preferably, step S1 specifically includes: The original photoelectric signal is received, the DC component is removed by a DC tracker, and the baseline signal BM and the AC signal AC are separated by a baseline low-pass filter with a sampling rate of 100Hz and a cutoff frequency of 0.2Hz-0.5Hz and an AC band-pass filter with a sampling rate of 100Hz and a passband of 0.5Hz-5.0Hz. It receives the prior heart rate provided by an external algorithm, obtains the dynamic maximum heart rate limit, and converts it into a prior value of the heartbeat interval based on the current sampling rate; By combining the prior value of the heartbeat interval, the adaptive peak threshold, and the refractory period of heartbeat detection, the AC signal is subjected to time-domain peak finding and valley tracking. The peak-valley amplitude AM is extracted by the peak-valley difference, and the heartbeat interval RSA is extracted by the interval between adjacent peaks.

[0013] Preferably, in step S1, the prior value of the heartbeat interval is calculated using the following formula: ; in: Prior heart rate; This represents the prior value for the cardiac interval.

[0014] Preferably, the refractory period of cardiac activity is calculated in step S1 using the following formula: ; in: To detect the refractory period of the heartbeat; This is the proportionality coefficient; This refers to the `clamp` function; and These are the preset minimum and maximum values, respectively.

[0015] Preferably, step S2 specifically includes the following steps: Step S2.1: The peak-valley amplitude (AM) and heartbeat interval (RSA) characteristic signals of the heartbeat are resampled to 4Hz using a piecewise linear interpolation method; the baseline signal BM characteristic signal of the heartbeat is synchronously extracted to obtain the corresponding sequence according to the same low-speed time base; thus, three sequences of the baseline signal BM, peak-valley amplitude (AM), and heartbeat interval (RSA) with a uniform 4Hz sampling rate are obtained. Step S2.2: Apply two-stage cascaded Biquad bandpass filters to the three sequences of baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA obtained in step S2.1 with a uniform 4Hz sampling rate to obtain the processed three characteristic signals of heartbeat: baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA.

[0016] Preferably, step S3 specifically includes: Step S3.1: Determine if the buffer is full at a fixed period. Apply a Hann window to the three characteristic signals of the processed heartbeat: baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA, and perform a 256-point FFT transform. Calculate the square of the modulus to obtain the power spectrum, and normalize it within the corresponding frequency band to obtain the normalized power spectrum of the three characteristic signals: baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA. , and ; Step S3.2, the intelligent peak search mechanism based on the low-frequency interference characteristics of Mayer waves, specifically includes: Step S3.2.1: Search for the global maximum spectral peak within the preset frequency band to obtain the frequency. and energy ; Step S3.2.2: Make a judgment, specifically: if the frequency If the peak is considered to belong to the Mayer wave interference region and is not directly used as the respiratory rate output, proceed to the next step; if the frequency If the peak does not belong to the Mayer wave interference region, then the candidate peak is directly output. Step S3.2.3, the high-frequency candidate peak back-check stage, specifically involves: in The maximum peak is re-searched in the high-frequency region to obtain the frequency of the high-frequency candidate peak. and its energy ; If the energy requirement is met If the low-frequency main peak is determined to be a Mayer wave pseudo-peak, the low-frequency peak is forcibly discarded; otherwise, the original global maximum peak is retained as a candidate peak for output. Step S3.2.4: Extract the power values ​​of the frequency points adjacent to the candidate peak, and use three-point parabolic interpolation to perform fine frequency reconstruction to obtain continuous frequency estimates at the sub-frequency level, i.e., candidate frequencies. , and .

[0017] Preferably, step S4 includes the following steps: Step S4.1: Calculate the candidate frequencies obtained in step S3 using the following formula. , and Frequency difference between pairs : ; in: and Representative candidate frequency , and Any two candidate frequencies in the range; Step S4.2: Calculate the frequency difference obtained in step 4.1. With tolerance threshold Comparison is used to obtain a fusion strategy; Step S4.3: Based on the fusion strategy obtained in step S4.2, assign weights to the three characteristic signals of the processed heartbeat: baseline signal BM, peak-to-valley amplitude AM, and heartbeat interval RSA, and construct a fused power spectrum; calculate the ratio of peak power to noise floor mean based on the obtained fused power spectrum to obtain the linear signal-to-noise ratio; calculate the confidence level based on the linear signal-to-noise ratio. Convert the SNR to dB form; use a first-order exponential smoother to continuously correct the respiratory rate to obtain the final respiratory frequency.

[0018] Preferred tolerance threshold The value is 0.05Hz.

[0019] Preferably, step S4.2 specifically includes: When all three or any two are consistent and satisfy the frequency difference <Tolerance threshold At that time, the average number of consensuses reached was [number missing]. Wherein: when all three satisfy the consistency condition, the average of the three is used as the final candidate frequency; if the three are not completely consistent, but the peak-to-trough amplitude (AM) and the heartbeat interval (RSA) satisfy the consistency condition, the average of AM and RSA is used as the final candidate frequency; if the three are not completely consistent, but the peak-to-trough amplitude (AM) and the baseline signal (BM) satisfy the consistency condition, the average of AM and BM is used as the final candidate frequency; if the three are not completely consistent, but the heartbeat interval (RSA) and the baseline signal (BM) satisfy the consistency condition, the average of RSA and BM is used as the final candidate frequency. When no pairwise consistency condition is met among the three, the current state is determined to be split, and the peak-valley amplitude AM characteristic signal is used as the final candidate frequency.

[0020] Preferably, in step S4.3, the power spectrum is fused. It can be expressed as follows: ; in: , and Normalized power spectrum , and The weight value; The linear signal-to-noise ratio is calculated using the following formula. : ; in: Peak power; Low average noise level; The confidence level is calculated using the following formula. : ; in: Baseline confidence level; The SNR is converted to dB using the following formula. : ; If the frequency is within the effective range and The following formula is used to... Converted to respiratory rate : ; A first-order exponential smoother is used to continuously correct the respiratory rate, and its update formula is as follows: ; in: For the first respiratory rate per breath; For the first respiratory rate per breath; This is for adjusting the coefficient.

[0021] The effect of applying the technical solution of this invention is: The technical solution of this invention has a close interdependence among its various steps, and is not a simple splicing of existing conventional digital signal processing techniques. Specifically, steps S2 (low-speed unified time base resampling and respiratory frequency band isolation processing) and S3 (intelligent peak search and Mayer wave suppression processing) heavily rely on step S1 (extraction of pulsatility features guided by prior heart rate) to preemptively eliminate the interference of the biphasic heartbeat in the time domain. Without the highly reliable extraction in step S1, the subsequent AM and RSA sequences characterizing the beat-by-beat features would be full of spikes, directly leading to bandpass filter distortion and complete failure of multi-channel fusion. The state machine fallback degradation strategy in step S4 (multi-channel state machine fusion processing) is based on the confidence level established by the results of the first three steps and has solid physiological mechanism support. When the BM channel is found to be deeply contaminated by 0.1Hz low-frequency blood pressure fluctuations (Mayer waves) during the frequency domain scan in step S3, step S4 can actively discard this channel. Since the Mayer wave mainly affects the overall baseline of vascular volume (BM) and has little interference with the modulation of cardiac relative amplitude (AM), the system relies entirely on the high-purity AM channel extracted in step S1, effectively avoiding the drawback of erroneous channels lowering the overall accuracy in conventional weighted average algorithms.

[0022] In summary, compared with the isolated or static filtering processing in the prior art, the technical solution of this embodiment forms a closed-loop link of "time-domain guided immune bimodal peak - frequency-domain aligned isolation of low frequency - cross-channel dynamic state machine error prevention". Under limited embedded computing power, it produces an anti-interference synergy effect greater than the sum of its parts, solves the technical problem in the field that respiratory rate is easily locked under multi-source dynamic interference, and improves the accuracy of respiratory rate extraction.

[0023] The present invention also discloses a respiratory rate extraction system, comprising: The prior heart rate-guided pulsation feature extraction module extracts three characteristic signals of the heartbeat: baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA, based on the original photoelectric signal and prior heart rate. The low-speed unified time base resampling and respiratory band isolation processing module is used to uniformly map the three characteristic signals of the heartbeat—the baseline signal BM, the peak-valley amplitude AM, and the heartbeat interval RSA—to a low-speed equal-interval time base and obtain the processed three characteristic signals of the heartbeat—the baseline signal BM, the peak-valley amplitude AM, and the heartbeat interval RSA. The intelligent peak search and Mayer suppression processing module applies a Hann window and performs FFT transform on the processed baseline signal (BM), peak-valley amplitude (AM), and heart interval RSA characteristic signals of the heartbeat, normalizes them within the corresponding frequency band, and performs Mayer suppression processing to obtain candidate frequencies. , and ; The multi-channel state machine fusion processing module is used to introduce the multi-channel state machine fusion decision output to the final breathing frequency. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.

[0025] Figure 1 This is a flowchart illustrating the respiratory rate extraction method based on a wearable photoelectric sensor in Embodiment 1 of the present invention. Figure 2 This is a waveform diagram of the original PPG signal (after decentralization of the infrared channel). Figure 3 This is a magnified schematic diagram of extracting the heartbeat peak features from the AC filtered PPG signal. Figure 4 Waveforms of the three respiratory feature signals (baseline signal BM, amplitude modulation AM, and frequency modulation FM / RSA) after extraction and normalization; Figure 5 This is a graph showing the final respiratory rate (BPM) over time after multi-channel state machine fusion decision-making and smoothing processing.

[0026] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0028] Example 1: A method for extracting respiratory rate, see details. Figure 1 This includes the following steps: Step S1, prior heart rate-guided pulsation feature extraction, specifically involves: receiving the raw photoelectric signal; separating the baseline signal BM and the AC signal AC based on a baseline low-pass filter and an AC band-pass filter; obtaining an adaptive peak threshold based on the AC signal AC; and receiving the prior heart rate. Based on prior heart rate Obtain the prior value of the cardiac interval Based on the prior value of the cardiac interval The refractory period of heartbeat detection is obtained; combining the prior value of the heartbeat interval, the adaptive peak threshold, and the refractory period of heartbeat detection, the AC signal is subjected to time-domain peak finding and valley tracking, the peak-valley amplitude AM is extracted by the peak-valley difference, and the heartbeat interval RSA is extracted by the interval between adjacent peaks; the three characteristic signals of the heartbeat are obtained: the baseline signal BM, the peak-valley amplitude AM, and the heartbeat interval RSA.

[0029] In this embodiment, the prior heart rate is obtained using a photoelectric signal processing algorithm based on time-domain difference and smoothing peak finding in the prior art. The calculation process specifically includes the following steps: ① Signal preprocessing and DC removal: The original infrared photoelectric signal is received, the average signal value within a specified window length is calculated, and the original infrared signal is subtracted from the average value to remove the DC component. Subsequently, the DC-removed signal is subjected to 4-point moving average (MA4) filtering to smooth high-frequency noise; ② Difference operation and window function smoothing: The signal after moving average filtering is subjected to first-order difference operation to obtain the rate of change of the signal. To further highlight the characteristic changes of the pulse wave and filter out spikes, a 5-point Hamming window is used to perform weighted smoothing on the differenced signal; ③ Adaptive threshold peak finding extraction: The average absolute value of the smoothed difference signal is calculated and used as the adaptive peak finding threshold. Based on this adaptive threshold, local maxima are searched on the differential signal to obtain the peak position of the effective heartbeat; ④ Prior heart rate conversion and verification: The average sampling point interval between adjacent peak positions is calculated, and combined with the current system sampling frequency (e.g., 100Hz), the initial heart rate value is converted. If the initial heart rate value is within the effective physiological preset range of 50 beats / min to 120 beats / min, it is determined to be valid and output as the final prior heart rate.

[0030] In this embodiment, the dynamic maximum heart rate limit is obtained in the following way: a priori heart rate is received, and it is determined whether the priori heart rate is within a preset effective heart rate range (30 beats / min to 220 beats / min); if the priori heart rate is within the effective heart rate range, the priori heart rate is multiplied by a preset fluctuation relaxation coefficient (e.g., 1.4) to obtain a preliminary dynamic heart rate upper limit; the preliminary dynamic heart rate upper limit is compared with the system's preset absolute maximum heart rate (e.g., 200 beats / min), and the smaller of the two is taken as the final dynamic maximum heart rate limit; if the priori heart rate is not within the effective heart rate range, the system's preset absolute maximum heart rate is directly taken as the final dynamic maximum heart rate limit; subsequently, based on the system's current sampling rate (e.g., 100Hz), the dynamic maximum heart rate limit is converted into the corresponding cardiac refractory period, and this refractory period is used to tighten the search window in the time domain tracking, thereby serving as a priori value constraint condition for cardiac interval when extracting features.

[0031] In this embodiment, the prior value of the cardiac interval is preferably calculated using the following formula: ; in: Prior heart rate; This represents the prior value for the cardiac interval.

[0032] The refractory period of cardiac activity is calculated using the following formula: ; in: To detect the refractory period of the heartbeat; This is the proportionality coefficient; This refers to the `clamp` function; and These are the preset minimum and maximum values, respectively.

[0033] The refractory period of heartbeat detection is considered a constraint. The physical refractory period of the peak search can be adaptively tightened or loosened based on the current prior heart rate, effectively shielding against biphasic interference and accurately extracting the baseline modulation (BM), peak-to-trough amplitude (AM), and heartbeat interval (RSA) characteristics of each heartbeat. When the true heart rate is approximately 75 bpm, the shortest reasonable interval between adjacent true heartbeats is approximately 0.57 s. If a secondary peak appears within 0.15 s to 0.25 s after a primary peak, this secondary peak is more likely to be a diabetic wave or biphasic structure rather than a new independent heartbeat, and therefore should be shielded by the refractory period mechanism, thus accurately extracting the peak-to-trough amplitude (AM) and heartbeat interval (RSA) of each heartbeat.

[0034] In this embodiment, the system starts timing the sampling points after the last confirmed valid heartbeat peak. Before the current sampling point timing exceeds the heartbeat detection refractory period, the system is in a shielded state, forcibly ignoring any local peaks, thereby directly filtering out diabetic waves or biphasic interference immediately following the main peak in the physical time domain. When the sampling point timing exceeds the heartbeat detection refractory period, the system de-shields itself and continuously tracks changes in the AC signal. When the amplitude of the current AC signal is detected to be lower than the amplitude of the previous sampling point, i.e., a local maximum occurs, this local maximum is compared with the currently updated adaptive peak threshold. The system confirms this point as the valid main peak of the current heartbeat only if and only if the local maximum is greater than the adaptive peak threshold. Within the interval between two adjacent valid main peaks, the system continuously records the local minimum values ​​of the AC signal to complete valley tracking. After confirming the current valid peak, the system subtracts the minimum value (valley amplitude) tracked during this period from the amplitude of the current valid peak to calculate the peak-valley amplitude (AM) of the current heartbeat. Simultaneously, the system calculates the time interval between the current valid peak and the previous valid peak, which is used as the heartbeat interval (RSA) of the current heartbeat. After feature extraction is complete, the system resets the sampling point timing and valley tracking status, and dynamically updates the adaptive peak threshold for the next cycle based on the current peak amplitude.

[0035] Step S2, low-speed unified time base resampling and respiratory frequency band isolation processing, specifically: the three characteristic signals of the heartbeat obtained in step S1, namely the baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA, are uniformly mapped onto a low-speed equal-interval time base; the processed three characteristic signals of the heartbeat, namely the baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA, are obtained.

[0036] The preferred step S2 in this embodiment specifically includes the following steps: Step S2.1: For the AM and RSA features generated by each beat, since their original time points are triggered by the heartbeat event and belong to non-uniform sampling sequences, a piecewise linear interpolation method is used to resample them to 4Hz; the BM signal is synchronously extracted to obtain the corresponding sequence according to the same low-speed time base, that is: for the two feature signals of the heartbeat peak-valley amplitude AM and heartbeat interval RSA, a piecewise linear interpolation method is used to resample them to 4Hz; for the feature signal of the heartbeat baseline BM, the corresponding sequence is synchronously extracted to obtain the corresponding sequence according to the same low-speed time base; thus, three sequences of the baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA with a uniform 4Hz sampling rate are obtained. Step S2.2: Apply two-stage cascaded Biquad bandpass filters to the three sequences of baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA obtained in step S2.1 with a uniform 4Hz sampling rate to obtain the processed three characteristic signals of heartbeat: baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA.

[0037] In this embodiment, the passband of the filter is preferably set to 0.12Hz-0.60Hz to preserve the breathing-related frequency band and suppress low-frequency drift and Mayer wave interference below 0.12Hz. The bandpass filter can be represented as two second-order cascaded IIR structures, with the following transfer function: ; in: The system transfer function representing the filter. The series index representing the biquad section. , , Representing the Feedforward (molecular) coefficients of the second-order section; The unit delay operator represents a single step (one sampling period). The delay operator represents two steps (two sampling periods).

[0038] The filter coefficients described in this embodiment are designed offline in advance and implemented in the device as fixed coefficients.

[0039] This embodiment significantly reduces buffer size and subsequent spectral analysis computation by uniformly resampling the three signals to 4Hz, while meeting the target respiratory frequency band sampling requirements. Furthermore, by synchronously isolating the three signals in the 0.12Hz-0.60Hz band at a low-speed time base, Mayer waves and low-frequency drift can be pre-reduced before subsequent fusion analysis, improving the robustness of respiratory frequency extraction. Downsampling and Biquad cascaded filtering are conventional digital signal processing methods, but the main improvement in this embodiment lies in the synergistic combination of beat-by-beat characteristics (BM, AM, RSA), resulting in a low-power, high-compression-ratio preprocessing link that facilitates subsequent spectral fusion.

[0040] Step S3, intelligent peak search and Mayer wave suppression processing, specifically involves applying a Hann window and performing an FFT transform on the processed baseline signal BM, peak-valley amplitude AM, and heart interval RSA characteristic signals of the heartbeat, respectively. The squared magnitude is calculated to obtain the power spectrum, which is then normalized within the corresponding frequency band to obtain the normalized power spectrum of the baseline signal BM, peak-valley amplitude AM, and heart interval RSA characteristic signals. , and After Mayer suppression, candidate frequencies are obtained. , and .

[0041] This embodiment preferably includes the following steps: Step S3.1: Determine if the buffer is full at a fixed period (RESP_UPDATE_INTERVAL) (e.g., LEN=256). Apply a Hann window to the processed baseline signal BM, peak-valley amplitude AM, and heart interval RSA characteristic signals respectively, and perform a 256-point FFT transform. Calculate the square of the modulus to obtain the power spectrum, and normalize it within the corresponding frequency band to obtain the normalized power spectrum of the baseline signal BM, peak-valley amplitude AM, and heart interval RSA characteristic signals. , and ; Step S3.2, the intelligent peak search mechanism based on the low-frequency interference characteristics of Mayer waves, specifically includes: Step S3.2.1: Search for the global maximum spectral peak within the preset frequency band to obtain the frequency. and energy ; Step S3.2.2: Make a judgment, specifically: if the frequency If the peak is considered to belong to the Mayer wave interference region and is not directly used as the respiratory rate output, proceed to the next step; if the frequency If the peak does not belong to the Mayer wave interference region, then the candidate peak is directly output. Step S3.2.3, the high-frequency candidate peak back-check stage, specifically involves: in The maximum peak is re-searched in the high-frequency region to obtain the frequency of the high-frequency candidate peak. and its energy ; If the energy requirement is met If the low-frequency peak is determined to be a Mayer wave pseudo-peak, the low-frequency peak is forcibly discarded and a high-frequency candidate peak is used instead as the candidate for the true respiratory rate; otherwise, the original global maximum peak is retained as the candidate peak for output. Step S3.2.4: After locking in the final candidate peak, extract the power values ​​of the frequency points adjacent to the left and right of the candidate peak, and use three-point parabolic interpolation to perform fine frequency reconstruction to obtain continuous frequency estimates at the sub-frequency level, i.e., candidate frequencies. , and .

[0042] In this embodiment, FFT and parabolic interpolation are conventional methods for basic spectrum analysis. The core of this method lies in the intelligent peak search mechanism built based on the low-frequency interference characteristics of Mayer waves. Through a three-level logic of "low-frequency main peak identification + high-frequency secondary peak forced back-check + energy ratio determination", it effectively suppresses Mayer wave misjudgment and improves the stability and accuracy of the extraction of the true respiratory frequency.

[0043] Step S4: Multi-channel state machine fusion processing to output the final breathing frequency.

[0044] In this preferred embodiment, step S4 includes the following steps: Step S4.1: Calculate the candidate frequencies obtained in step S3 using the following formula. , and Frequency difference between pairs : ; in: and Representative candidate frequency , and Any two candidate frequencies in the range; Step S4.2: Compare the frequency difference obtained in step S4.1 with a preset tolerance threshold to determine the corresponding fusion strategy; in this embodiment, the tolerance threshold is preferably 0.05Hz; the specific comparison and strategy determination rules are as follows: (1) When the candidate frequencies of the three or any two of the characteristic signals are consistent and the corresponding frequency difference is less than the tolerance threshold, the system is determined to enter consensus mode; wherein: When all three conditions are met, the average of the three is used as the final candidate frequency. If the three are not completely consistent, but the peak-to-trough amplitude (AM) and the heartbeat interval (RSA) meet the consistency condition, then the average value of AM and RSA is used as the final candidate frequency. If the three are not completely consistent, but the peak-valley amplitude AM and the baseline signal BM meet the consistency condition, then the average value of AM and BM is used as the final candidate frequency. If the three are not completely consistent, but the RSA and baseline signal BM meet the consistency condition, then the average value of RSA and BM is used as the final candidate frequency. (2) When none of the three conditions are met, it is determined that the system is in a split state and enters the degradation mode (i.e., Fallback mode). At this time, the candidate frequency of the peak-valley amplitude AM characteristic signal with the strongest anti-Mayer wave interference capability is forcibly adopted as the final candidate frequency.

[0045] Step S4.3: Based on the fusion strategy obtained in step S4.2, assign weights to the three characteristic signals of the processed heartbeat: baseline signal BM, peak-to-valley amplitude AM, and heartbeat interval RSA, and construct a fused power spectrum; calculate the ratio of peak power to noise floor mean based on the obtained fused power spectrum to obtain the linear signal-to-noise ratio; calculate the confidence level based on the linear signal-to-noise ratio. Convert the SNR to dB form; use a first-order exponential smoother to continuously correct the respiratory rate to obtain the final respiratory frequency.

[0046] In this embodiment, a further preferred embodiment is that the power spectrum is fused in step S4.3. It can be expressed as follows: ; in: , and Normalized power spectrum , and The weight value; The linear signal-to-noise ratio is calculated using the following formula. : ; in: Peak power; Low average noise level; If the signal is valid, the confidence level is calculated using the following formula. : ; in: Based on the basic confidence level, in this embodiment: under consensus mode The value is 90, in Fallback mode. The value is 60, limited to the range of 0-100%.

[0047] The SNR is converted to dB using the following formula. : ; If the frequency is within the effective range and (In this embodiment, status=0 when the status is compliant), the following formula is used to... Converted to respiratory rate : .

[0048] In this embodiment, to suppress short-term noise disturbances and output jitter caused by multi-channel branching, while maintaining the system's responsiveness to real respiratory changes, a first-order exponential smoother is used to continuously correct the respiratory rate. The update formula is as follows: ; in: For the first respiratory rate per breath; For the first respiratory rate per breath; To adjust the coefficients. In this embodiment: the consensus mode uses a larger coefficient (e.g., Fallback mode uses a smaller coefficient (e.g.) If the quality is unsatisfactory (status=2), a weak signal state is output, maintaining the previous valid value. When in a high-confidence consensus state (such as three-channel consistency or strong consensus between AM and RSA), a larger smoothing coefficient is used (e.g., To improve response speed; when in a low-confidence state (such as partial consistency or entering fallback degradation mode), a smaller smoothing coefficient (such as...) is used. This is to enhance output stability.

[0049] The technical solution of this embodiment has the following characteristics: 1. Dynamic refractory period based on external prior heart rate guidance. Abandoning the traditional fixed time window, this algorithm uses the prior heart rate (Guide HR) provided by the external SpO2 / HR algorithm to dynamically tighten the physical refractory period for finding the peak, thus shielding the interference of biphasic heartbeats from the algorithm's underlying layer.

[0050] 2. Smart Peak Proportion Decision Logic for Mayer Wave Suppression (Core Barrier). This logic breaks through the limitations of traditional rigid high-pass filtering, preserving low-frequency signals. After FFT transformation, it performs an energy ratio determination (e.g., setting a 30% threshold) between the global maximum peak and the maximum peak in the high-frequency region in the frequency domain. This intelligent anti-interference logic based on frequency domain energy ratio is highly innovative among existing patents.

[0051] 3. Multi-channel degradation fusion state machine and fallback strategy. Breaking away from the traditional weighted average algorithm, a rigorous state machine based on frequency deviation (diff_tol) is explicitly defined. In particular, a decision tree logic is established to "forcefully determine that BM is contaminated by the Mayer wave when there is a serious divergence among the three channels, thus unilaterally downgrading (fallback) to trust the AM channel," providing a new and robust embedded engineering error prevention strategy.

[0052] The technical solution of this invention has the following effects: ① It effectively reduces the pain point of low-frequency "lock-up". Specifically, the innovative software bandpass limiting and frequency domain intelligent peak search dual protection effectively remove the interference of Mayer waves. In the human body at rest and during sleep, the accuracy of respiratory rate is improved by several times compared with the traditional single algorithm; ② It has extremely strong resistance to movement and physiological posture changes. Specifically, the fusion strategy ensures that even when the baseline is severely damaged (such as sensor wearing pressure or changes in sleeping posture), it can still output data robustly by relying on the AM or RSA channel; ③ It achieves extreme embedded performance optimization. Specifically, after acquiring the 100Hz raw features, the data is innovatively down-frequencyd to 4Hz before entering the bandpass filter and the history ring buffer, which reduces the FFT operation by nearly 96% and occupies very little RAM and CPU time slices when running on the Cortex-M core.

[0053] The technical solution in this embodiment has been fully implemented in C language code and successfully deployed in a low-power MCU of the RT-Thread real-time operating system (accelerated by the CMSIS-DSP library).

[0054] Actual test results: The algorithm occupies only a few KB of stack space and refreshes results stably at a frequency of RESP_UPDATE_INTERVAL (e.g., every 4 seconds). When faced with tests such as deep and slow breathing and rapid panting, it can respond in seconds and smoothly output the true respiratory rate (BPM). Even in simulated waveforms with artificial respiration baseline interference, the fusion strategy can accurately isolate and lock the correct respiratory frequency band.

[0055] like Figure 2 As shown, the system first stably acquires the decentralized raw infrared input signal (Raw IR), which retains the basic physiological waveform characteristics; like Figure 3 As shown in the enlarged view, after AC filtering of the original signal, the algorithm can accurately locate and extract the effective peaks of each heartbeat (marked with a red cross in the figure). like Figure 4 As shown, based on the extracted heartbeat features, the system successfully separated three independent respiratory feature signals: baseline modulation (BM), amplitude modulation (AM), and frequency modulation (FM / RSA), and completed the signal normalization process. like Figure 5 As shown, after inputting the above three characteristic signals into the multi-channel state machine for fusion decision-making, the system finally outputs the final respiratory rate (Fused RR, i.e., BPM value) continuously and smoothly.

[0056] Through the above processing, when facing test subjects to perform deep and slow breathing and rapid panting tests, it can respond in seconds and smoothly output the real respiratory rate (BPM). Even in the simulated waveform with artificial respiration baseline interference, the fusion strategy can accurately isolate and lock the correct respiratory frequency band.

[0057] The technical solution of this invention has the following effects: ① It reduces the pain point of low-frequency "lock-up". Specifically, the innovative software bandpass limiting and frequency domain intelligent peak search dual protection effectively remove the interference of Mayer waves. In the human body at rest and during sleep, the accuracy of respiratory rate is improved by several times compared with the traditional single algorithm; ② It has extremely strong resistance to movement and physiological posture changes. Specifically, the fusion strategy ensures that even when the baseline is severely damaged (such as sensor wearing pressure or changes in sleeping posture), it can still output data robustly by relying on the AM or RSA channel; ③ It achieves extreme embedded performance optimization. Specifically, after acquiring the 100Hz raw features, the data is innovatively down-frequencyd to 4Hz before entering the bandpass filter and the history ring buffer, which reduces the FFT operation by nearly 96% and occupies very little RAM and CPU time slices when running on the Cortex-M core.

[0058] Example 2: A respiratory rate extraction system, comprising: The prior heart rate-guided pulsation feature extraction module extracts three feature signals of the heartbeat: the baseline signal BM, the peak-valley amplitude AM, and the heartbeat interval RSA, based on the original photoelectric signal and the prior heart rate provided by the prior heart rate algorithm. The low-speed unified time base resampling and respiratory band isolation processing module is used to uniformly map the three characteristic signals of the heartbeat—the baseline signal BM, the peak-valley amplitude AM, and the heartbeat interval RSA—to a low-speed equal-interval time base and obtain the processed three characteristic signals of the heartbeat—the baseline signal BM, the peak-valley amplitude AM, and the heartbeat interval RSA. The intelligent peak search and Mayer suppression processing module applies a Hann window and performs FFT transform on the processed baseline signal (BM), peak-valley amplitude (AM), and heart interval RSA characteristic signals of the heartbeat, normalizes them within the corresponding frequency band, and performs Mayer suppression processing to obtain candidate frequencies. , and ; The multi-channel state machine fusion processing module is used to introduce the multi-channel state machine fusion decision output to the final breathing frequency.

[0059] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.

Claims

1. A method for extracting respiratory rate, characterized in that, Includes the following steps: Step S1, prior heart rate-guided pulsation feature extraction, specifically involves: receiving the raw photoelectric signal; separating the baseline signal BM and the AC signal AC based on a baseline low-pass filter and an AC band-pass filter; obtaining an adaptive peak threshold based on the AC signal AC; and receiving the prior heart rate. Based on prior heart rate Obtain the prior value of the cardiac interval ; Based on the prior value of the heartbeat interval The refractory period of heartbeat detection is obtained; combining the prior value of the heartbeat interval, the adaptive peak threshold, and the refractory period of heartbeat detection, the AC signal is subjected to time-domain peak finding and valley tracking. The peak-valley amplitude AM is extracted by the peak-valley difference, and the heartbeat interval RSA is extracted by the interval between adjacent peaks; the three characteristic signals of the heartbeat, namely the baseline signal BM, the peak-valley amplitude AM, and the heartbeat interval RSA, are obtained. Step S2, low-speed unified time base resampling and respiratory frequency band isolation processing, specifically: the three characteristic signals of the heartbeat obtained in step S1, namely the baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA, are uniformly mapped onto a low-speed equal-interval time base; a two-stage cascaded Biquad bandpass filter is applied to obtain the processed three characteristic signals of the heartbeat, namely the baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA. Step S3, intelligent peak search and Mayer wave suppression processing, specifically involves applying a Hann window and performing an FFT transform on the processed baseline signal BM, peak-valley amplitude AM, and heart interval RSA characteristic signals of the heartbeat, respectively. The squared magnitude is calculated to obtain the power spectrum, which is then normalized within the corresponding frequency band to obtain the normalized power spectrum of the baseline signal BM, peak-valley amplitude AM, and heart interval RSA characteristic signals. , and ; After Mayer suppression, candidate frequencies are obtained. , and ; Step S4: Multi-channel state machine fusion processing to output the final breathing frequency.

2. The respiratory rate extraction method according to claim 1, characterized in that, Step S1 specifically includes: The original photoelectric signal is received, the DC component is removed by a DC tracker, and the baseline signal BM and the AC signal AC are separated by a baseline low-pass filter with a sampling rate of 100Hz and a cutoff frequency of 0.2Hz-0.5Hz and an AC band-pass filter with a sampling rate of 100Hz and a passband of 0.5Hz-5.0Hz. It receives the prior heart rate provided by an external algorithm, obtains the dynamic maximum heart rate limit, and converts it into a prior value of the heartbeat interval based on the current sampling rate; By combining the prior value of the heartbeat interval and the adaptive peak threshold, the AC signal is subjected to time-domain peak finding and valley tracking. The peak-valley amplitude AM is extracted by the peak-valley difference, and the heartbeat interval RSA is extracted by the interval between adjacent peaks.

3. The respiratory rate extraction method according to claim 2, characterized in that, In step S1, the prior value of the heartbeat interval is calculated using the following formula: ; in: Prior heart rate; This represents the prior value for the cardiac interval.

4. The respiratory rate extraction method according to claim 2, characterized in that, In step S1, the refractory period of cardiac activity is calculated using the following formula: ; in: To detect the refractory period of the heartbeat; This is the proportionality coefficient; This refers to the `clamp` function; and These are the preset minimum and maximum values, respectively.

5. The respiratory rate extraction method according to claim 1, characterized in that, Step S2 specifically includes the following steps: Step S2.1: The peak-valley amplitude (AM) and heartbeat interval (RSA) characteristic signals of the heartbeat are resampled to 4Hz using a piecewise linear interpolation method; the baseline signal BM characteristic signal of the heartbeat is synchronously extracted to obtain the corresponding sequence according to the same low-speed time base; thus, three sequences of the baseline signal BM, peak-valley amplitude (AM), and heartbeat interval (RSA) with a uniform 4Hz sampling rate are obtained. Step S2.2: Apply two-stage cascaded Biquad bandpass filters to the three sequences of baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA obtained in step S2.1 with a uniform 4Hz sampling rate to obtain the processed three characteristic signals of heartbeat: baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA.

6. The respiratory rate extraction method according to claim 1, characterized in that, Step S3 specifically includes: Step S3.1: Determine if the buffer is full at a fixed period. Apply a Hann window to the three characteristic signals of the processed heartbeat: baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA, and perform a 256-point FFT transform. Calculate the square of the modulus to obtain the power spectrum, and normalize it within the corresponding frequency band to obtain the normalized power spectrum of the three characteristic signals: baseline signal BM, peak-valley amplitude AM, and heartbeat interval RSA. , and ; Step S3.2, the intelligent peak search mechanism based on the low-frequency interference characteristics of Mayer waves, specifically includes: Step S3.2.1: Search for the global maximum spectral peak within the preset frequency band to obtain the frequency. and energy ; Step S3.2.2: Make a judgment, specifically: if the frequency If the peak is considered to belong to the Mayer wave interference region and is not directly used as the respiratory rate output, proceed to the next step; if the frequency If the peak does not belong to the Mayer wave interference region, then the candidate peak is directly output. Step S3.2.3, the high-frequency candidate peak back-check stage, specifically involves: in The maximum peak is re-searched in the high-frequency region to obtain the frequency of high-frequency candidate peaks. and its energy ; If the energy requirement is met If the low-frequency main peak is determined to be a Mayer wave pseudo-peak, the low-frequency peak is forcibly discarded; otherwise, the original global maximum peak is retained as a candidate peak for output. Step S3.2.4: Extract the power values ​​of the frequency points adjacent to the candidate peak, and use three-point parabolic interpolation to perform fine frequency reconstruction to obtain continuous frequency estimates at the sub-frequency level, i.e., candidate frequencies. , and .

7. The respiratory rate extraction method according to claim 1, characterized in that, Step S4 includes the following steps: Step S4.1: Calculate the candidate frequencies obtained in step S3 using the following formula. , and Frequency difference between pairs : ; in: and Representative candidate frequency , and Any two candidate frequencies in the range; Step S4.2: Calculate the frequency difference obtained in step 4.

1. With tolerance threshold Comparison is used to obtain a fusion strategy; Step S4.3: Based on the fusion strategy obtained in step S4.2, assign weights to the three characteristic signals of the processed heartbeat: baseline signal BM, peak-to-valley amplitude AM, and heartbeat interval RSA, and construct a fused power spectrum; calculate the ratio of peak power to noise floor mean based on the obtained fused power spectrum to obtain the linear signal-to-noise ratio; calculate the confidence level based on the linear signal-to-noise ratio. Convert the SNR to dB form; use a first-order exponential smoother to continuously correct the respiratory rate to obtain the final respiratory frequency.

8. The respiratory rate extraction method according to claim 7, characterized in that, Step S4.2 specifically includes: When all three or any two are consistent and satisfy the frequency difference <Tolerance threshold At that time, the average number of consensuses reached was [number missing]. Wherein: when all three satisfy the consistency condition, the average of the three is used as the final candidate frequency; if the three are not completely consistent, but the peak-to-trough amplitude (AM) and the heartbeat interval (RSA) satisfy the consistency condition, the average of AM and RSA is used as the final candidate frequency; if the three are not completely consistent, but the peak-to-trough amplitude (AM) and the baseline signal (BM) satisfy the consistency condition, the average of AM and BM is used as the final candidate frequency; if the three are not completely consistent, but the heartbeat interval (RSA) and the baseline signal (BM) satisfy the consistency condition, the average of RSA and BM is used as the final candidate frequency. When no pairwise consistency condition is met among the three, the current state is determined to be split, and the peak-valley amplitude AM characteristic signal is used as the final candidate frequency.

9. The respiratory rate extraction method according to claim 7, characterized in that, In step S4.3, the power spectrum is fused. It can be expressed as follows: ; in: , and Normalized power spectrum , and The weight value; The linear signal-to-noise ratio is calculated using the following formula. : ; in: Peak power; Low average noise level; The confidence level is calculated using the following formula. : ; in: Baseline confidence level; The SNR is converted to dB using the following formula. : ; If the frequency is within the valid range and The following formula is used to... Converted to respiratory rate : ; A first-order exponential smoother is used to continuously correct the respiratory rate, and its update formula is as follows: ; in: For the first respiratory rate per breath; For the first respiratory rate per breath; This is for adjusting the coefficient.

10. A respiratory rate extraction system, characterized in that, include: The prior heart rate-guided pulsation feature extraction module extracts three feature signals of the heartbeat: the baseline signal BM, the peak-valley amplitude AM, and the heartbeat interval RSA, based on the original photoelectric signal and the prior heart rate provided by the prior heart rate algorithm. The low-speed unified time base resampling and respiratory band isolation processing module is used to uniformly map the three characteristic signals of the heartbeat—the baseline signal BM, the peak-valley amplitude AM, and the heartbeat interval RSA—to a low-speed equal-interval time base and obtain the processed three characteristic signals of the heartbeat—the baseline signal BM, the peak-valley amplitude AM, and the heartbeat interval RSA. The intelligent peak search and Mayer suppression processing module applies a Hann window and performs FFT transform on the processed baseline signal (BM), peak-valley amplitude (AM), and heart interval RSA characteristic signals of the heartbeat, normalizes them within the corresponding frequency band, and performs Mayer suppression processing to obtain candidate frequencies. , and ; The multi-channel state machine fusion processing module is used to introduce the multi-channel state machine fusion decision output to the final breathing frequency.