Respiratory frequency calculation method and device, and smart wearable device
By optimizing the signal decomposition algorithm, only the low-frequency eigenmode function signal is decomposed and the respiration frequency is calculated, which solves the problem of long-term EMD algorithm in the prior art and improves the calculation efficiency.
Patent Information
- Application Number
- CN202211324318.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-10-27
AI Technical Summary
In the prior art, when calculating the respiration frequency, the EMD algorithm is used to decompose the PPG signal slowly, which makes the algorithm take longer.
By optimizing the process of the signal decomposition algorithm, only the eigenmode function signal with the first frequency smaller than the minimum preset frequency value is decomposed, and a mixed signal containing the breathing signal and the residual signal is calculated, thereby calculating the breathing frequency.
The algorithm efficiency of calculating respiration frequency is improved and the calculation time is shortened.
Smart Images

Figure CN115568846B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart wearable technology, and in particular to a method and apparatus for calculating respiratory rate, and a smart wearable device. Background Technology
[0002] PPG (Photoplethysmograph) technology is a non-invasive technique that extracts information about changes in blood flow from human skin tissue. It is a simple and easy-to-implement pulse wave detection technique. When the blood volume in the blood vessels is high, the tissue and blood absorb a large amount of light, resulting in low intensity of transmitted or reflected light. Conversely, when the blood volume is low, the tissue and blood absorb less light, resulting in high intensity of transmitted or reflected light. This pulsating change in light intensity with variations in blood volume within the arteries forms the photoplethysmograph.
[0003] When calculating respiratory rate from PPG signals, the EMD (Empirical Mode Decomposition) algorithm is typically used. In the process of decomposing the PPG signal using EMD, the PPG signal is decomposed into multiple IMF (Intrinsic Mode Function) signals and a residual signal. All IMFs are then subjected to a Fast Fourier Transform (FFT) to the frequency domain. Based on the frequency domain, IMFs with a frequency range below 1 Hz are selected to reconstruct the respiratory signal, and then the respiratory rate is calculated. Because current techniques require using the EMD algorithm to decompose all IMFs from the PPG signal, and each decomposed IMF signal is transformed to the frequency domain using an FFT (Fast Fourier Transform) to obtain the frequency corresponding to the maximum amplitude, and then the respiratory signal is reconstructed using IMFs with frequencies below 1 Hz, the decomposition and reconstruction speed of the respiratory signal using the EMD algorithm is relatively slow, resulting in a long overall algorithm time consumption. Summary of the Invention
[0004] This invention provides a method and apparatus for calculating respiratory rate, as well as a smart wearable device, which optimizes the process of signal decomposition algorithm and improves the efficiency of the algorithm for calculating respiratory rate.
[0005] In a first aspect, the present invention provides a method for calculating respiratory rate, the method comprising: acquiring a first PPG signal of a user's pulse collected by a PPG sensor; performing low-pass filtering and baseline drift processing on the first PPG signal to obtain a second PPG signal; processing the second PPG signal using a signal decomposition algorithm to decompose the first intrinsic mode function signal with a frequency less than a minimum preset frequency value, and calculating a mixed signal containing respiratory signal and residual signal based on the intrinsic mode function signal; and calculating the respiratory rate based on the mixed signal.
[0006] In the above scheme, when processing the second PPG signal using the signal decomposition algorithm, it is not necessary to decompose all the intrinsic mode function (EMF) signals. Only the first EMF signal with a frequency lower than a minimum preset frequency value needs to be decomposed. This allows the calculation of the mixed signal containing the respiratory signal and residual signal required for respiratory rate calculation. The respiratory rate can then be calculated using this mixed signal. Existing EMD algorithms decompose complex PPG signals into a finite number of EMF signals until no further decomposition is possible, leaving only a residual signal. Compared to existing EMD algorithms, this application does not decompose the entire second PPG signal. It only removes high-frequency signals from the second PPG signal and calculates a mixed signal based on the retained low-frequency signal and residual signal. The respiratory rate can then be calculated using this mixed signal, thus optimizing the signal decomposition algorithm process and improving the efficiency of respiratory rate calculation using the signal decomposition algorithm.
[0007] In one specific implementation, a signal decomposition algorithm is used to process the second PPG signal, decomposing it into an intrinsic mode function signal with a frequency less than a minimum preset frequency value. Based on the intrinsic mode function signal, a mixed signal containing respiratory and residual signals is calculated, including:
[0008] Step 1: Assign the second PPG signal x(t) to r(t);
[0009] Step 2: Initialize u(t) = 0;
[0010] Step 3: Calculate the sum of the number of maxima and minima of r(t) to obtain the number of extreme points of r(t);
[0011] Step 4: Calculate the energy ratio of r(t);
[0012] Step 5: Determine whether the energy ratio of r(t) is greater than the preset maximum energy ratio, or whether the number of extreme points of r(t) is less than the preset minimum number of extreme points, or whether the number of intrinsic modulo functions is greater than the preset maximum number of intrinsic modulo functions;
[0013] If the energy ratio of r(t) is less than or equal to the preset maximum energy ratio, the number of extreme points of r(t) is greater than or equal to the preset minimum number of extreme points, and the number of intrinsic moduli is less than or equal to the preset maximum number of intrinsic moduli, then proceed to step six.
[0014] If the energy ratio of r(t) is greater than the preset maximum energy ratio, or the number of extreme points of r(t) is less than the preset minimum number of extreme points, or the number of intrinsic mode functions is greater than the preset maximum number of intrinsic mode functions, then r(t) is confirmed to be a residual signal, and then proceed to step fifteen.
[0015] Step 6: Assign r(t) to pre(t);
[0016] Step 7: Assign pre(t) to last_pre(t);
[0017] Step 8: Calculate the maximum and minimum points of pre(t);
[0018] Step 9: Calculate the upper and lower envelopes of pre(t) based on the maximum and minimum points of pre(t);
[0019] Step 10: Calculate the average envelope m(t) of pre(t) based on the upper and lower envelopes of pre(t);
[0020] Step 11: Calculate the difference between pre(t) and m(t) and assign it to pre(t);
[0021] Step 12: Calculate the relative tolerance of the assigned pre(t);
[0022] Step 13: Determine whether the relative tolerance of the assigned pre(t) is less than the preset maximum relative tolerance, or whether the number of iterations is greater than the preset maximum number of iterations;
[0023] If the relative tolerance of the assigned pre(t) is not less than the preset maximum relative tolerance and the number of iterations is not greater than the preset maximum number of iterations, then continue the iteration from step seven to step thirteen.
[0024] If the relative tolerance of the assigned pre(t) is less than the preset maximum relative tolerance, or the number of iterations is greater than the preset maximum number of iterations, then perform a fast Fourier transform on the assigned pre(t) and obtain the frequency xval corresponding to the maximum peak value of the assigned pre(t) after the fast Fourier transform.
[0025] Step Fourteen: Determine whether the x-coordinate corresponding to the maximum peak value of pre(t) after the Fast Fourier Transform is less than the minimum preset frequency value;
[0026] If the x-coordinate corresponding to the maximum peak value of pre(t) after the Fast Fourier Transform is not less than the minimum preset frequency value, then the difference between r(t) and pre(t) after the Fast Fourier Transform is reassigned to r(t), and the reassigned r(t) is re-executed in steps three to fourteen, and the pre(t) obtained after each iteration is accumulated to u(t).
[0027] If the x-coordinate of the maximum peak value of pre(t) after the Fast Fourier Transform is less than the minimum preset frequency value, proceed to step 15.
[0028] Step 15: Calculate the difference between the second PPG signal x(t) and the latest accumulated u(t), and use the difference as a mixed signal containing the respiratory signal and the residual signal.
[0029] In one specific implementation, before processing the second PPG signal using a signal decomposition algorithm to extract the first eigenmode function signal with a frequency less than a minimum preset frequency value, the calculation method further includes determining whether the second PPG signal contains a respiratory signal. By determining whether the second PPG signal contains a respiratory signal before processing it with the signal decomposition algorithm, if no respiratory signal is found in the second PPG signal, subsequent processing with the signal decomposition algorithm is unnecessary, reducing wasted computational resources and improving efficiency.
[0030] In one specific implementation, determining whether the second PPG signal contains a respiratory signal includes: calculating the number of extreme points, energy ratio, and number of intrinsic mode functions (IMFs) of the second PPG signal. The system determines whether the energy ratio of the second PPG signal is greater than a preset maximum energy ratio, or whether the number of extreme points is less than a preset minimum number of extreme points, or whether the number of IMFs is greater than a preset maximum number of IMFs. If the energy ratio of the second PPG signal is greater than the preset maximum energy ratio, or the number of extreme points is less than the preset minimum number of extreme points, or the number of IMFs is greater than the preset maximum number of IMFs, then it is confirmed that the second PPG signal does not contain a respiratory signal. If the energy ratio of the second PPG signal is less than or equal to the preset maximum energy ratio, the number of extreme points is greater than or equal to the preset minimum number of extreme points, and the number of IMFs is less than or equal to the preset maximum number of IMFs, then it is confirmed that the second PPG signal contains a respiratory signal. This improves the accuracy of determining whether the second PPG signal contains a respiratory signal.
[0031] In one specific implementation, the signal decomposition algorithm is an empirical mode decomposition algorithm, in order to optimize the processing flow of the empirical mode decomposition algorithm and improve efficiency.
[0032] In one specific implementation, before processing the second PPG signal using the signal decomposition algorithm, the calculation method further includes: optimizing the hyperparameters of the signal decomposition algorithm using a bio-inspired algorithm to obtain the optimal hyperparameters of the signal decomposition algorithm; wherein the hyperparameters of the signal decomposition algorithm include at least a minimum preset frequency value. Optimizing the hyperparameters of the signal decomposition algorithm using a bio-inspired algorithm, compared to the existing method of setting parameters based on experience, can obtain the optimal hyperparameters and improve the accuracy of the signal decomposition algorithm.
[0033] In one specific implementation, the bio-inspired algorithm is the firefly algorithm, which facilitates the acquisition of the optimal hyperparameters in the signal decomposition algorithm and improves accuracy.
[0034] In one specific implementation, a bio-inspired algorithm is used to optimize the hyperparameters in the signal decomposition algorithm to obtain the optimal hyperparameters, including:
[0035] Step 1: Design the hyperparameter space of the firefly algorithm. The hyperparameters in the hyperparameter space include the maximum energy ratio, the maximum relative tolerance, the maximum number of iterations, the maximum number of intrinsic mode functions, and the minimum preset frequency value. Each hyperparameter has its own range of values.
[0036] Step 2: Design the objective function F(X) of the firefly algorithm as follows, where X is the solution space vector, and F(X) outputs the accuracy of the breathing frequency:
[0037] X = [Maximum energy ratio, maximum relative tolerance, maximum number of iterations, maximum number of intrinsic mode functions, minimum preset frequency value];
[0038]
[0039] Step 3: Initialize the number of iterations, termination condition, population size, and individual firefly positions for the firefly algorithm;
[0040] Step 4: Calculate the distance r between firefly i and firefly j using the following formula. ij Each solution vector space represents a firefly:
[0041]
[0042] Where d represents the number of hyperparameters in the solution space vector X, k represents the k-th hyperparameter in the solution space vector X, and r ij X represents the distance between firefly i and firefly j; i X represents the position of the i-th firefly. j Indicates the position of the j-th firefly;
[0043] Step 5: Update the firefly positions according to the following formula:
[0044] X i =X i +0.9*exp(-0.5*r ij 2 )*(X j -X i )+0.5(rand-0.5)
[0045] Where rand represents a random value in the range [0,1];
[0046] Step 6: Determine whether F(X) > 0.95 or whether the number of iterations has reached the number of iterations allowed by the Firefly Algorithm;
[0047] If the condition is not met, repeat the iterative process from step four to step six.
[0048] If the conditions are met, the search terminates, and the hyperparameters in the latest updated solution space vector X are taken as the optimal hyperparameters for the signal decomposition algorithm. This facilitates the use of the firefly algorithm to obtain the optimal hyperparameters for the signal decomposition algorithm, thereby improving accuracy.
[0049] Secondly, the present invention also provides a respiratory rate calculation device, which includes: an acquisition module, a preprocessing module, a decomposition module, a mixed signal calculation module, and a respiratory rate calculation module. The acquisition module acquires a first PPG signal from a user's pulse collected by a PPG sensor. The preprocessing module performs low-pass filtering and baseline drift processing on the first PPG signal to obtain a second PPG signal. The decomposition module processes the second PPG signal using a signal decomposition algorithm to decompose it into an intrinsic mode function signal with a frequency less than a minimum preset frequency value, and calculates a mixed signal containing respiratory signals and residual signals based on the intrinsic mode function signal. The respiratory rate calculation module calculates the respiratory rate based on the mixed signal.
[0050] In the above scheme, when processing the second PPG signal using the signal decomposition algorithm, it is not necessary to decompose all the intrinsic mode function (EMF) signals. Only the first EMF signal with a frequency lower than a minimum preset frequency value needs to be decomposed. This allows the calculation of the mixed signal containing the respiratory signal and residual signal required for respiratory rate calculation. The respiratory rate can then be calculated using this mixed signal. Existing EMD algorithms decompose complex PPG signals into a finite number of EMF signals until no further decomposition is possible, leaving only a residual signal. Compared to existing EMD algorithms, this application does not decompose the entire second PPG signal. It only removes high-frequency signals from the second PPG signal and calculates a mixed signal based on the retained low-frequency signal and residual signal. The respiratory rate can then be calculated using this mixed signal, thus optimizing the signal decomposition algorithm process and improving the efficiency of respiratory rate calculation using the signal decomposition algorithm.
[0051] Thirdly, the present invention also provides a smart wearable device comprising: a PPG sensor and a processor connected to the PPG sensor; the PPG sensor is used to acquire PPG signals of the user's pulse within a preset time period, wherein the PPG signals within the preset time period are first PPG signals, and the first PPG signals are sent to the processor; the processor is used to execute the above-described emotional stress monitoring method.
[0052] When processing the second PPG signal using a signal decomposition algorithm, it is not necessary to decompose all the intrinsic mode function (EMF) signals. Only the first EMF signal with a frequency lower than a minimum preset frequency value needs to be decomposed. This allows the calculation of the mixed signal containing the respiratory signal and residual signal required for respiratory rate calculation. The respiratory rate can then be calculated using this mixed signal. Existing EMD algorithms decompose complex PPG signals into a finite number of EMF signals until no further decomposition is possible, leaving only a residual signal. Compared to existing EMD algorithms, this application does not decompose the entire second PPG signal. Instead, it calculates a mixed signal based on the retained low-frequency signal and residual signal. The respiratory rate can then be calculated using this mixed signal, thus optimizing the signal decomposition algorithm's process and improving its efficiency in calculating respiratory rate. Attached Figure Description
[0053] Figure 1 A flowchart illustrating a respiratory rate calculation method provided in this application embodiment;
[0054] Figure 2 A flowchart illustrating another method for calculating respiratory rate provided in this application embodiment;
[0055] Figure 3 This is a schematic diagram of the respiratory rate calculation device provided in an embodiment of this application. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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 some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] To facilitate understanding of the respiratory rate calculation method provided in this embodiment of the invention, the application scenario of this respiratory rate calculation method is first described below. This respiratory rate calculation method is applied to smart wearable devices. Specifically, smart wearable devices can be smartwatches, diving computers, etc. The respiratory rate calculation method will now be described in detail with reference to the accompanying drawings.
[0058] refer to Figure 1 The respiratory rate calculation method provided in this embodiment of the invention includes:
[0059] Step 10: Obtain the first PPG signal from the user's pulse collected by the PPG sensor;
[0060] Step 20: Perform low-pass filtering and baseline drift processing on the first PPG signal to obtain the second PPG signal;
[0061] Step 30: The second PPG signal is processed using a signal decomposition algorithm to decompose the first intrinsic mode function signal with a frequency lower than the minimum preset frequency value, and a mixed signal containing respiratory signal and residual signal is calculated based on the intrinsic mode function signal.
[0062] Step 40: Calculate the respiratory rate based on the mixed signal.
[0063] In the above scheme, when processing the second PPG signal using the signal decomposition algorithm, it is not necessary to decompose all the intrinsic mode function (EMF) signals. Only the first EMF signal with a frequency lower than a minimum preset frequency value needs to be decomposed. This allows the calculation of the mixed signal containing the respiratory signal and residual signal required for respiratory rate calculation. The respiratory rate can then be calculated using this mixed signal. Existing EMD algorithms decompose complex PPG signals into a finite number of EMF signals until no further decomposition is possible, leaving only a residual signal. Compared to existing EMD algorithms, this application does not decompose the entire second PPG signal. It only removes high-frequency signals from the second PPG signal, calculates the mixed signal based on the retained low-frequency signal and residual signal, and then calculates the respiratory rate using this mixed signal. This optimizes the signal decomposition algorithm process and improves the efficiency of calculating respiratory rate using the signal decomposition algorithm. The following detailed description of each step is provided with reference to the accompanying drawings.
[0064] First, refer to Figure 1 The process involves acquiring the first PPG signal from the user's pulse using a PPG sensor. Specifically, PPG technology can be used to detect the wearer's pulse in a smart wearable device, obtaining the raw PPG signal as the first PPG signal.
[0065] Next, as Figure 1 As shown, the first PPG signal is subjected to low-pass filtering and baseline drift processing to obtain the second PPG signal.
[0066] When performing low-pass filtering on the first PPG signal, an IIR (infinite impulse response) filter can be used. Alternatively, an FIR (infinite impulse response) low-pass filter can be designed by converting an elliptic analog filter to a digital filter. Elliptic low-pass filters exhibit equal ripple in both the passband and stopband, resulting in good passband and stopband approximation characteristics. Furthermore, FIR filters offer superior embedded efficiency compared to IIR filters. The design of a low-pass filter can be achieved through the following three steps: (1) Determine the parameters of the analog filter based on the actual first PPG signal; (2) Design an elliptic analog filter using the parameters from step (1); (3) Convert the analog filter to an FIR digital filter to obtain the digital filter parameters.
[0067] When performing baseline drift processing on the first PPG signal, morphological methods can be used to remove the baseline drift. It's important to explain that morphological methods are divided into morphological opening and morphological closing operations. Morphological opening involves performing an erosion operation followed by a dilation operation on the signal; morphological closing involves performing a dilation operation followed by an erosion operation. A morphological opening operation followed by a morphological closing operation can be performed on the input first PPG signal to obtain the baseline signal. Then, subtracting the baseline signal from the original first PPG signal yields the baseline-drift-removed signal, which serves as the second PPG signal.
[0068] Next, refer to Figure 1 and Figure 2 The second PPG signal is processed using a signal decomposition algorithm. This algorithm decomposes the signal into its first intrinsic mode function (IMF) signal, with a frequency lower than a minimum preset frequency. Based on the IMF signal, a mixed signal containing respiratory and residual signals is calculated. The signal decomposition algorithm can be an empirical mode decomposition (EMD) algorithm to optimize its processing flow and improve efficiency. Alternatively, other algorithms can be used, such as EEMD (Ensemble Empirical Mode Decomposition) or VMD (Variational Mode Decomposition) to process the second PPG signal.
[0069] The following section uses Empirical Mode Decomposition (EMD) as an example to illustrate the decomposition process. When processing the second PPG signal using EMD, and decomposing it to obtain the first intrinsic mode function (IMF) signal with a frequency less than a minimum preset frequency value, a mixed signal containing respiratory and residual signals is calculated based on the IMF signal. (Reference) Figure 2 The following steps can be taken. It needs to be explained that... Figure 2 In this context, x(t) represents the second PPG signal obtained after low-pass filtering and baseline shifting of the first PPG signal; TN represents the number of extrema; energy ratio (ER) represents the energy ratio; MaxEnergyRatio represents the preset maximum energy ratio; MinNumExtrema represents the preset minimum number of extrema; IMF number refers to the number of intrinsic mode functions; MaxNumIMF refers to the preset maximum number of intrinsic mode functions; relative tolerance (RT) represents the relative tolerance; SiftRelativeTolerance represents the preset maximum relative tolerance; IN represents the number of iterations; SiftMaxTterations represents the preset maximum number of iterations.
[0070] Step 1: Assign the second PPG signal x(t) to r(t);
[0071] Step 2: Initialize u(t) = 0;
[0072] Step 3: Calculate the sum of the number of maxima and minima of r(t) to obtain the number of extreme points of r(t);
[0073] Step 4: Calculate the energy ratio of r(t);
[0074]
[0075] Step 5: Determine whether the energy ratio of r(t) is greater than the preset maximum energy ratio, or whether the number of extreme points of r(t) is less than the preset minimum number of extreme points, or whether the number of intrinsic modulo functions is greater than the preset maximum number of intrinsic modulo functions;
[0076] If the energy ratio of r(t) is less than or equal to the preset maximum energy ratio, the number of extreme points of r(t) is greater than or equal to the preset minimum number of extreme points, and the number of intrinsic moduli is less than or equal to the preset maximum number of intrinsic moduli, then proceed to step six.
[0077] If the energy ratio of r(t) is greater than the preset maximum energy ratio, or the number of extreme points of r(t) is less than the preset minimum number of extreme points, or the number of intrinsic mode functions is greater than the preset maximum number of intrinsic mode functions, then r(t) is confirmed to be a residual signal, and then proceed to step fifteen.
[0078] Step 6: Assign r(t) to pre(t);
[0079] Step 7: Assign pre(t) to last_pre(t);
[0080] Step 8: Calculate the maximum and minimum points of pre(t);
[0081] Step 9: Calculate the upper and lower envelopes of pre(t) based on the maximum and minimum points of pre(t);
[0082] Step 10: Calculate the average envelope m(t) of pre(t) based on the upper and lower envelopes of pre(t);
[0083] Step 11: Calculate the difference between pre(t) and m(t) and assign it to pre(t);
[0084] Step 12: Calculate the relative tolerance of the assigned pre(t);
[0085]
[0086] Step 13: Determine whether the relative tolerance of the assigned pre(t) is less than the preset maximum relative tolerance, or whether the number of iterations is greater than the preset maximum number of iterations;
[0087] If the relative tolerance of the assigned pre(t) is not less than the preset maximum relative tolerance and the number of iterations is not greater than the preset maximum number of iterations, then continue the iteration from step seven to step thirteen.
[0088] If the relative tolerance of the assigned pre(t) is less than the preset maximum relative tolerance, or the number of iterations is greater than the preset maximum number of iterations, then perform a fast Fourier transform on the assigned pre(t) and obtain the frequency xval corresponding to the maximum peak value of the assigned pre(t) after the fast Fourier transform.
[0089] Step Fourteen: Determine whether the x-coordinate corresponding to the maximum peak value of pre(t) after the Fast Fourier Transform is less than the minimum preset frequency value;
[0090] If the x-coordinate corresponding to the maximum peak value of pre(t) after the Fast Fourier Transform is not less than the minimum preset frequency value, then the difference between r(t) and pre(t) after the Fast Fourier Transform is reassigned to r(t), and the reassigned r(t) is re-executed in steps three to fourteen, and the pre(t) obtained after each iteration is accumulated to u(t).
[0091] If the x-coordinate of the maximum peak value of pre(t) after the Fast Fourier Transform is less than the minimum preset frequency value, proceed to step 15.
[0092] Step 15: Calculate the difference between the second PPG signal x(t) and the latest accumulated u(t), and use the difference as a mixed signal containing the respiratory signal and the residual signal.
[0093] Additionally, refer to Figure 2 Before processing the second PPG signal using a signal decomposition algorithm to extract the first eigenmode function signal with a frequency lower than the minimum preset frequency value, it is possible to first determine whether the second PPG signal contains a respiratory signal. By determining whether the second PPG signal contains a respiratory signal before processing it with the signal decomposition algorithm, if there is no respiratory signal in the second PPG signal, there is no need to perform subsequent processing using the signal decomposition algorithm, reducing the waste of computational power and improving efficiency.
[0094] When specifically determining whether the second PPG signal contains a respiratory signal, such as Figure 2 As shown, the number of extreme points, energy ratio, and number of intrinsic mode functions of the second PPG signal can be calculated first. The energy ratio can be calculated using the following formula:
[0095]
[0096] Next, it is determined whether the energy ratio of the second PPG signal is greater than a preset maximum energy ratio, or whether the number of extreme points is less than a preset minimum number of extreme points, or whether the number of intrinsic mode functions is greater than a preset maximum number of intrinsic mode functions. If the energy ratio of the second PPG signal is greater than the preset maximum energy ratio, or the number of extreme points is less than the preset minimum number of extreme points, or the number of intrinsic mode functions is greater than the preset maximum number of intrinsic mode functions, then it is confirmed that the second PPG signal does not contain a respiratory signal. If the energy ratio of the second PPG signal is less than or equal to the preset maximum energy ratio, the number of extreme points is greater than or equal to the preset minimum number of extreme points, and the number of intrinsic mode functions is less than or equal to the preset maximum number of intrinsic mode functions, then it is confirmed that the second PPG signal contains a respiratory signal. This improves the accuracy of determining whether the second PPG signal contains a respiratory signal. Furthermore, before processing the second PPG signal using the signal decomposition algorithm, a bio-inspired algorithm can be further used to optimize the hyperparameters in the signal decomposition algorithm to obtain the optimal hyperparameters. The hyperparameters in the signal decomposition algorithm must include at least a minimum preset frequency value. Optimizing the hyperparameters of signal decomposition algorithms using bio-inspired algorithms can yield optimal hyperparameters compared to existing techniques that rely on empirical settings, thus improving the accuracy of the signal decomposition algorithm. The bio-inspired algorithm mentioned above, such as the firefly algorithm, facilitates the acquisition of optimal hyperparameters in the signal decomposition algorithm, thereby improving accuracy. It should be noted that bio-inspired algorithms are not limited to the firefly algorithm; other methods can also be used. For example, other bio-inspired algorithms can be employed, such as particle swarm optimization, bird flocking optimization, genetic algorithms, bacterial foraging algorithms, or simulated annealing algorithms.
[0097] The following section uses the firefly algorithm as a bio-inspired algorithm to introduce a specific implementation method for optimizing the hyperparameters in the signal decomposition algorithm to obtain the optimal hyperparameters. The steps are as follows:
[0098] Step 1: Design the hyperparameter space of the Firefly Algorithm. The hyperparameters in the hyperparameter space include the maximum energy ratio, maximum relative tolerance, maximum number of iterations, maximum number of intrinsic moduli, and minimum preset frequency. Each hyperparameter has its own range of values. Specifically, the maximum energy ratio can be an integer in the range [10, 50]; the maximum relative tolerance can be a floating-point number in the range [0.2, 0.5] with a step size of 0.01; the maximum number of iterations can be an integer in the range [10, 20]; the maximum number of intrinsic moduli can be an integer in the range [5, 10]; and the minimum preset frequency can be a floating-point number in the range [0.01, 0.2] with a step size of 0.01.
[0099] Step 2: Design the objective function F(X) of the firefly algorithm as follows, where X is the solution space vector, and F(X) outputs the accuracy of the breathing frequency:
[0100] X = [Maximum energy ratio, maximum relative tolerance, maximum number of iterations, maximum number of intrinsic mode functions, minimum preset frequency value];
[0101]
[0102] A sample set of 3000 labeled PPG signal samples can be used as an accuracy metric. The goal of the Firefly algorithm optimization is to reduce the error rate and improve the accuracy of respiratory rate calculation.
[0103] Step 3: Initialize the number of iterations, termination condition, population size, and individual firefly positions for the firefly algorithm; In the optimization of the Empirical Mode Decomposition algorithm, the firefly position refers to the value of the solution space vector X, and the initial value of X is a random value within the range of the respective hyperparameters in Step 1 above.
[0104] Step 4: Calculate the distance r between firefly i and firefly j using the following formula. ij Each solution vector space represents a firefly:
[0105]
[0106] Where d represents the number of hyperparameters in the solution space vector X, and k represents the k-th hyperparameter in the solution space vector X; r ij X represents the distance between firefly i and firefly j; i X represents the position of the i-th firefly. j Indicates the position of the j-th firefly;
[0107] Step 5: Update the firefly positions according to the following formula:
[0108] X i =Xi +0.9*exp(-0.5*r ij 2 )*(X j -X i )+0.5(rand-0.5)
[0109] Where rand represents a random value in the range [0,1];
[0110] Step 6: Determine whether F(X) > 0.95 or whether the number of iterations has reached the number of iterations allowed by the Firefly Algorithm;
[0111] If the condition is not met, repeat the iterative process from step four to step six.
[0112] If the conditions are met, the search terminates, and the hyperparameters in the latest updated solution space vector X are taken as the optimal hyperparameters for the signal decomposition algorithm. This facilitates the use of the firefly algorithm to obtain the optimal hyperparameters for the signal decomposition algorithm, thereby improving accuracy.
[0113] Next, refer to Figure 1 Based on the intrinsic modulus function signal, a mixed signal containing respiratory and residual signals is calculated. The specific method for calculating this mixed signal from the decomposed intrinsic modulus function signal is a conventional method in existing technology and will not be elaborated upon here.
[0114] Next, as Figure 1 As shown, the respiratory rate is calculated based on the mixed signal. Specifically, the method for calculating the respiratory rate from the mixed signal containing both respiratory and residual signals is a prior art method and will not be elaborated upon here.
[0115] In the various embodiments described above, when processing the second PPG signal using a signal decomposition algorithm, it is not necessary to decompose all the intrinsic mode function (EMF) signals. Only the first EMF signal with a frequency lower than a minimum preset frequency value needs to be decomposed. This allows the calculation of the mixed signal containing the respiratory signal and residual signal required for calculating the respiratory rate. The respiratory rate can then be calculated using this mixed signal. Existing EMD algorithms decompose complex PPG signals into a finite number of EMF signals until no further decomposition is possible, leaving only a residual signal. Compared to existing EMD algorithms, this application does not decompose the entire second PPG signal. It only removes high-frequency signals from the second PPG signal and calculates a mixed signal based on the retained low-frequency signal and residual signal. The respiratory rate can then be calculated using this mixed signal, thus optimizing the signal decomposition algorithm's process and improving the efficiency of calculating respiratory rate using this algorithm.
[0116] In addition, this embodiment of the invention also provides a respiratory rate calculation device 100, which includes: an acquisition module 101, a preprocessing module 102, a decomposition calculation module 103, and a respiratory rate calculation module 104. The acquisition module 101 acquires a first PPG signal from a PPG sensor that detects the user's pulse. The preprocessing module 102 performs low-pass filtering and baseline drift processing on the first PPG signal to obtain a second PPG signal. The decomposition calculation module 103 processes the second PPG signal using a signal decomposition algorithm to decompose the first intrinsic mode function signal with a frequency less than a minimum preset frequency value, and calculates a mixed signal containing respiratory signals and residual signals based on the intrinsic mode function signal. The respiratory rate calculation module 104 calculates the respiratory rate based on the mixed signal.
[0117] In the above scheme, when processing the second PPG signal using the signal decomposition algorithm, it is not necessary to decompose all the intrinsic mode function (EMF) signals. Only the first EMF signal with a frequency lower than a minimum preset frequency value needs to be decomposed. This allows the calculation of the mixed signal containing the respiratory signal and residual signal required for respiratory rate calculation. The respiratory rate can then be calculated using this mixed signal. Existing EMD algorithms decompose complex PPG signals into a finite number of EMF signals until no further decomposition is possible, leaving only a residual signal. Compared to existing EMD algorithms, this application does not decompose the entire second PPG signal. It only removes high-frequency signals from the second PPG signal and calculates a mixed signal based on the retained low-frequency signal and residual signal. The respiratory rate can then be calculated using this mixed signal, thus optimizing the signal decomposition algorithm process and improving the efficiency of respiratory rate calculation using the signal decomposition algorithm.
[0118] It should be noted that each of the above-mentioned acquisition module 101, preprocessing module 102, decomposition calculation module 103 and respiratory rate calculation module 104 is a collection of software and hardware components. That is, each module is a functional module that implements the corresponding function. This functional module not only includes the corresponding hardware, but also includes software code stored and running on the hardware.
[0119] The signal decomposition algorithm used in the decomposition calculation module 103 can be an empirical mode decomposition algorithm (EMD) to optimize the processing flow and improve efficiency. The decomposition calculation module can include the following modules:
[0120] The extreme value calculation module is used to calculate the maximum and minimum points of the second PPG signal as pre(t) initially.
[0121] The envelope calculation module is used to calculate the upper and lower envelopes of pre(t) based on the maximum and minimum points of pre(t); it is also used to calculate the average envelope m(t) of pre(t) based on the upper and lower envelopes of pre(t).
[0122] The difference calculation module is used to calculate the difference between pre(t) and m(t) and assign the difference to pre(t);
[0123] The tolerance calculation module is used to calculate the relative tolerance of pre(t);
[0124] The first judgment module is used to determine whether the relative tolerance of the assigned pre(t) is less than the preset maximum relative tolerance, or whether the number of iterations is greater than the preset maximum number of iterations.
[0125] In the first iteration module, if the relative tolerance of the assigned pre(t) is not less than the preset maximum relative tolerance and the number of iterations is not greater than the preset maximum number of iterations, the iterations of steps one to six described in the corresponding part of the above method continue.
[0126] The transformation module is used to perform a fast Fourier transform on the assigned pre(t) when the relative tolerance of the pre(t) is less than the preset maximum relative tolerance or the number of iterations is greater than the preset maximum number of iterations, and to obtain the x-coordinate corresponding to the maximum peak value after the fast Fourier transform.
[0127] The second judgment module is used to determine whether the horizontal coordinate corresponding to the maximum peak value of pre(t) after the fast Fourier transform is less than the minimum preset frequency value.
[0128] In the second iteration module, if the horizontal coordinate corresponding to the maximum peak value of pre(t) after the fast Fourier transform is not less than the minimum preset frequency value, the difference between r(t) and pre(t) after the fast Fourier transform is reassigned to r(t). This is used to re-execute the iterations of steps three to fourteen on the reassigned r(t) and accumulate the pre(t) obtained after each iteration to u(t).
[0129] The decomposition and determination module is used to determine the difference between the second PPG signal and the latest accumulated u(t) when the x-coordinate corresponding to the maximum peak value of the pre(t) after the Fast Fourier Transform is less than the minimum preset frequency value. This difference is used as the mixed signal containing the respiratory signal and the residual signal. This facilitates the rapid and accurate calculation of the mixed signal containing the respiratory signal and the residual signal.
[0130] In addition, it should be noted that the respiratory rate calculation device 100 may include other functional modules besides those mentioned above.
[0131] For example, the respiratory rate calculation device 100 may further include a respiratory signal determination module. Before processing the second PPG signal using a signal decomposition algorithm to decompose it into the first intrinsic mode function signal with a frequency less than a minimum preset frequency value, the respiratory signal determination module first determines whether the second PPG signal contains a respiratory signal. By determining whether the second PPG signal contains a respiratory signal before processing it using the signal decomposition algorithm, if there is no respiratory signal in the second PPG signal, there is no need to perform subsequent processing of the second PPG signal using the signal decomposition algorithm, reducing the waste of computational power and improving efficiency.
[0132] When determining whether a second PPG signal contains a respiratory signal, the respiratory signal determination module first calculates the number of extreme points, energy ratio, and number of intrinsic modal functions of the second PPG signal. Then, it determines whether the energy ratio of the second PPG signal is greater than a preset maximum energy ratio, whether the number of extreme points is less than a preset minimum number of extreme points, or whether the number of intrinsic modal functions is greater than a preset maximum number of intrinsic modal functions. If the energy ratio of the second PPG signal is greater than the preset maximum energy ratio, the number of extreme points is less than the preset minimum number of extreme points, or the number of intrinsic modal functions is greater than the preset maximum number of intrinsic modal functions, then it is confirmed that the second PPG signal does not contain a respiratory signal. If the energy ratio of the second PPG signal is less than or equal to the preset maximum energy ratio, the number of extreme points is greater than or equal to the preset minimum number of extreme points, and the number of intrinsic modal functions is less than or equal to the preset maximum number of intrinsic modal functions, then it is confirmed that the second PPG signal contains a respiratory signal. This improves the accuracy of determining whether a second PPG signal contains a respiratory signal.
[0133] The respiratory rate calculation device 100 may further include a hyperparameter optimization module. Before processing the second PPG signal using the signal decomposition algorithm, the hyperparameter optimization module uses a bio-inspired algorithm to optimize the hyperparameters in the signal decomposition algorithm to obtain the optimal hyperparameters. The hyperparameters in the signal decomposition algorithm include at least a minimum preset frequency value. Optimizing the hyperparameters of the signal decomposition algorithm using a bio-inspired algorithm, compared to the existing method of setting parameters based on experience, can obtain the optimal hyperparameters and improve the accuracy of the signal decomposition algorithm. The bio-inspired algorithm used by the hyperparameter optimization module can be the firefly algorithm, which facilitates obtaining the optimal hyperparameters in the signal decomposition algorithm and improves accuracy.
[0134] The hyperparameter optimization module, which optimizes the hyperparameters in the signal decomposition algorithm to obtain the optimal hyperparameters, may include the following modules:
[0135] The hyperparameter space design module is used to design the hyperparameter space of the firefly algorithm. The hyperparameters in the hyperparameter space include the maximum energy ratio, the maximum relative tolerance, the maximum number of iterations, the maximum number of intrinsic mode functions, and the minimum preset frequency value. Each hyperparameter has its own value range.
[0136] The objective function design module is used to design the following objective function F(X) for the firefly algorithm, where X is the solution space vector, and F(X) outputs the accuracy of the breathing frequency:
[0137] X = [Maximum energy ratio, maximum relative tolerance, maximum number of iterations, maximum number of intrinsic mode functions, minimum preset frequency value];
[0138]
[0139] The initialization module is used to initialize the number of iterations, termination condition, population size, and position of individual fireflies in the firefly algorithm.
[0140] The distance calculation module is used to calculate the distance r between firefly i and firefly j according to the following formula. ij Each solution vector space represents a firefly:
[0141]
[0142] Where d represents the number of hyperparameters in the solution space vector X, and k represents the k-th hyperparameter in the solution space vector X; r ij X represents the distance between firefly i and firefly j; i X represents the position of the i-th firefly. j Indicates the position of the j-th firefly;
[0143] The location update module is used to update the firefly's location according to the following formula:
[0144] X i =X i +0.9*exp(-0.5*r ij 2 )*(X j -X i )+0.5(rand-0.5)
[0145] Where rand represents a random value in the range [0,1];
[0146] The third judgment module is used to determine whether F(X) > 0.95 or whether the number of iterations has reached the number of iterations of the firefly algorithm.
[0147] The third iteration module is used to repeat the iterative process of steps four to six described in the above method section if the above conditions are not met.
[0148] The hyperparameter determination module terminates the search when the above conditions are met, and uses the hyperparameters in the latest updated solution space vector X as the optimal hyperparameters for the signal decomposition algorithm. This facilitates the use of the firefly algorithm to obtain the optimal hyperparameters for the signal decomposition algorithm, improving accuracy.
[0149] Furthermore, this invention also provides a smart wearable device, which includes a PPG sensor and a processor connected to the PPG sensor. The PPG sensor is used to collect a first PPG signal of the user's pulse and send the first PPG signal to the processor. The processor is used to execute the respiratory rate calculation method in the above-described method embodiments. When processing the second PPG signal using a signal decomposition algorithm, it is not necessary to decompose all the intrinsic mode function signals. It is only necessary to decompose the first intrinsic mode function signal with a frequency less than a minimum preset frequency value. This allows the calculation of the mixed signal containing the respiratory signal and the residual signal required for calculating the respiratory rate. The respiratory rate can then be calculated using the mixed signal composed of the respiratory signal and the residual signal. Existing EMD algorithms decompose complex PPG signals into a finite number of intrinsic mode function signals until they cannot be decomposed further, leaving only a residual signal. Compared with the processing method of existing EMD algorithms, this application does not decompose the entire second PPG signal. It only needs to remove the high-frequency signal from the second PPG signal and calculate the mixed signal based on the retained low-frequency signal and the residual signal. The respiratory rate can then be calculated based on the mixed signal, thus optimizing the signal decomposition algorithm process and improving the efficiency of calculating the respiratory rate using the signal decomposition algorithm.
[0150] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0151] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0152] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0153] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for calculating respiratory rate, characterized in that: include: Acquire a first PPG signal of a user's pulse collected by a PPG sensor; Performing low-pass filtering and baseline drift processing on the first PPG signal to obtain a second PPG signal; Processing the second PPG signal using a signal decomposition algorithm to decompose a first intrinsic mode function signal having a frequency less than a minimum preset frequency value, and calculating a mixed signal including a respiratory signal and a residual signal based on the intrinsic mode function signal; Based on the mixed signal, the respiratory frequency is calculated.
2. The calculation method according to claim 1, characterized in that: The signal decomposition algorithm is an empirical mode decomposition algorithm.
3. The calculation method according to claim 2, characterized in that: The method of using a signal decomposition algorithm to process the second PPG signal, decomposing an eigenmode function signal having a first frequency less than a minimum preset frequency value, and calculating a mixed signal including a respiratory signal and a residual signal based on the eigenmode function signal, includes: Step 1: assigning the second PPG signal x(t) to r(t); Step 2: Initialize u(t)=0; Step 3: Calculate the sum of the number of maximum values and the number of minimum values of r(t) to obtain the number of extreme value points of r(t); Step 4: Calculate the energy ratio of r(t); Step 5: Determine whether the energy ratio of r(t) is greater than a preset maximum energy ratio, or whether the number of extreme points of r(t) is less than a preset minimum number of extreme points, or whether the number of eigenmode functions is greater than a preset maximum number of eigenmode functions; If the r(t) energy ratio is less than or equal to the preset maximum energy ratio, the number of extreme points of r(t) is greater than or equal to the preset minimum number of extreme points, and the number of eigenmode functions is less than or equal to the preset maximum number of eigenmode functions, proceed to step 6; If the energy ratio of r(t) is greater than the preset maximum energy ratio, or the number of extreme points of r(t) is less than the preset minimum number of extreme points, or the number of eigenmode functions is greater than the preset maximum number of eigenmode functions, it is confirmed that r(t) is the residual signal, and the process proceeds to step 15; Step 6: Assign the r(t) to pre(t); Step 7: Assign the pre(t) to last_pre(t); Step 8: Calculate the maximum and minimum points of pre(t); Step nine: Calculate the upper and lower envelopes of pre(t) according to the maximum and minimum points of pre(t); Step 10: Calculate the average envelope m(t) of pre(t) according to the upper and lower envelopes of pre(t); Step 11: Calculate the difference between the pre(t) and the m(t) and assign it to the pre(t); Step 12: Calculate the relative tolerance of the assigned pre(t); Step 13: Determine whether the relative tolerance of the assigned pre(t) is less than a preset maximum relative tolerance, or whether the number of iterations is greater than a preset maximum number of iterations; If the relative tolerance of the assigned pre(t) is not less than the preset maximum relative tolerance, and the number of iterations is not greater than the preset maximum number of iterations, continue to iterate from step 7 to step 13; If the relative tolerance of the assigned pre(t) is less than the preset maximum relative tolerance, or the number of iterations is greater than the preset maximum number of iterations, a fast Fourier transform is performed on the assigned pre(t) to obtain the frequency abscissa Xval corresponding to the maximum peak value of the assigned pre(t) after the fast Fourier transform; Step 14: Determine whether the horizontal coordinate corresponding to the maximum peak value of the assigned pre(t) after the fast Fourier transform is less than the minimum preset frequency value; If the horizontal coordinate corresponding to the maximum peak value of the assigned pre(t) after the fast Fourier transform is not less than the minimum preset frequency value, the difference between r(t) and the assigned pre(t) after the fast Fourier transform is reassigned to r(t), the assigned r(t) is iterated again from step 3 to step 14, and the pre(t) obtained after each iterative calculation is accumulated to u(t); If the horizontal coordinate corresponding to the maximum peak value of the assigned pre(t) after the fast Fourier transform is less than the minimum preset frequency value, proceed to step 15; Step 15: Calculate the difference between the second PPG signal x(t) and the latest accumulated u(t), and use the difference as the mixed signal containing the breathing signal and the residual signal.
4. The calculation method according to any one of claims 1 to 3, characterized in that: Before using the signal decomposition algorithm to process the second PPG signal and decompose the first eigenmode function signal whose frequency is less than the minimum preset frequency value, the method further includes: Determine whether the second PPG signal contains the breathing signal.
5. The calculation method according to claim 4, characterized in that: The determining whether the second PPG signal contains the breathing signal comprises: Calculating the number of extreme points, the energy ratio, and the number of eigenmode functions of the second PPG signal; Determining whether the energy ratio of the second PPG signal is greater than a preset maximum energy ratio, or whether the number of extreme points is less than a preset minimum number of extreme points, or whether the number of eigenmode functions is greater than a preset maximum number of eigenmode functions; If the energy ratio of the second PPG signal is greater than the preset maximum energy ratio, or the number of extreme points is less than the preset minimum number of extreme points, or the number of eigenmode functions is greater than the preset maximum number of eigenmode functions, confirming that the second PPG signal does not contain the breathing signal; If the energy ratio of the second PPG signal is less than or equal to the preset maximum energy ratio, the number of extreme points is greater than or equal to the preset minimum number of extreme points, and the number of eigenmode functions is less than or equal to the preset maximum number of eigenmode functions, it is confirmed that the second PPG signal contains the breathing signal.
6. The calculation method according to claim 1, characterized in that: Before using the signal decomposition algorithm to process the second PPG signal, the method further includes: A biologically inspired algorithm is used to optimize the hyperparameters in the signal decomposition algorithm to obtain the optimal hyperparameters of the signal decomposition algorithm; wherein the hyperparameters in the signal decomposition algorithm at least include the minimum preset frequency value.
7. The calculation method according to claim 6, characterized in that: The biological heuristic algorithm is the firefly algorithm.
8. The calculation method according to claim 7, characterized in that: The method of using a biological heuristic algorithm to optimize the hyperparameters in the signal decomposition algorithm to obtain the optimal hyperparameters of the signal decomposition algorithm includes: Step 1: Design a hyperparameter space of the firefly algorithm, wherein the hyperparameters in the hyperparameter space include a maximum energy ratio, a maximum relative tolerance, a maximum number of iterations, a maximum number of eigenmode functions, and a minimum preset frequency value; each of the hyperparameters is set with its own value range; Step 2: Design the following objective function F(X) of the firefly algorithm, where X is the solution space vector and F(X) outputs the accuracy of the respiratory rate: X = [maximum energy ratio, maximum relative tolerance, maximum number of iterations, maximum number of eigenmode functions, minimum preset frequency value]; Step 3: Initialize the number of iterations, end conditions, population size and positions of individual fireflies of the firefly algorithm; Step 4: Calculate the distance r between fireflies i and j according to the following formula ij , each solution vector space represents a firefly: Wherein, d represents the number of hyperparameters in the solution space vector X, k represents the kth hyperparameter in the solution space vector X, r ij represents the distance between firefly i and firefly j; X i represents the position of the i-th firefly, X j represents the position of the jth firefly; Step 5: Update the position of the firefly according to the following formula: X i =X i +0.9*exp(-0.5*r ij 2 )*(X j -X i )+0.5(rand-0.5) Among them, rand represents a random value of [0,1]; Step 6: Determine whether F(X)>0.95 is satisfied, or whether the number of iterations reaches the number of iterations of the firefly algorithm; If not satisfied, repeat the iterative process from step 4 to step 6; If satisfied, the search is terminated, and the hyperparameters in the updated solution space vector X are used as the optimal hyperparameters of the signal decomposition algorithm.
9. A respiratory rate calculation device, characterized in that: include: An acquisition module, used for acquiring a first PPG signal of a user's pulse acquired by a PPG sensor; a preprocessing module, configured to perform low-pass filtering and baseline drift processing on the first PPG signal to obtain a second PPG signal; a decomposition and calculation module, configured to process the second PPG signal using a signal decomposition algorithm, decompose a first intrinsic mode function signal having a frequency less than a minimum preset frequency value, and calculate a mixed signal including a respiratory signal and a residual signal based on the intrinsic mode function signal; The respiratory frequency calculation module is used to calculate the respiratory frequency according to the mixed signal.
10. A smart wearable device, characterized in that: A PPG sensor and a processor connected to the PPG sensor; The PPG sensor is used to collect a first PPG signal of the user's pulse and send the first PPG signal to the processor; The processor is used to execute the respiratory rate calculation method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method for real time automatically detecting epileptic character wave
CN101259016A
Electrocardiosignal baseline drift correcting method based on variation mode decomposition
CN107361762A