Noise reduction method, electronic device, storage medium and chip
By defining multiple target thresholds in electronic devices and processing electrical signals using windows of different lengths, the false detection problem caused by fixed voltage thresholds is solved, achieving more accurate peak and non-peak region segmentation, thus improving noise reduction performance and user experience.
Patent Information
- Application Number
- CN202410606757.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2044-05-16
AI Technical Summary
In the prior art, when electronic devices detect ECG and PPG signals, they are prone to false detections because they use fixed voltage thresholds to determine peak and non-peak regions, resulting in poor noise reduction and affecting user experience.
Multiple target thresholds are determined based on the detected electrical signals, the electrical signals are segmented into peak and non-peak regions, and noise reduction is performed using windows of different lengths to ensure accuracy.
It improves accuracy in peak and non-peak regions, reduces the probability of false detection, and enhances noise reduction effect and user experience.
Smart Images

Figure CN118370520B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and in particular to a noise reduction method, electronic equipment, storage medium and chip. Background Art
[0002] With the continuous development of electronic devices, electronic devices can provide users with a variety of services for detecting user health. For example, users can detect electrical signals such as ECG signals and PPG signals through electronic devices.
[0003] Usually, when electronic devices detect the above electrical signals, they are easily interfered by various factors, thereby introducing noise into the detected electrical signals. The interference of various factors may include: electromagnetic interference in electronic devices, user movement interference, impedance interference caused by contact between skin and electronic devices, interference caused by user muscle tremors, etc.
[0004] In the related schemes, although ECG signals, PPG signals and other electrical signals can be denoised, the peak area and non-peak area in the electrical signal are determined by a fixed voltage threshold. This method of determining the peak area and non-peak area in the electrical signal by a fixed voltage threshold may mistakenly determine the peak area in the electrical signal as a non-peak area, resulting in false detection. As a result, in the subsequent noise reduction process, the noise reduction effect is poor, affecting the user experience. Summary of the invention
[0005] The present application provides a noise reduction method, an electronic device, a storage medium and a chip, which can accurately determine the peak area and the non-peak area in the electrical signal, thereby improving the noise reduction effect and improving the user experience.
[0006] In a first aspect, a noise reduction method is provided, which is applied to an electronic device, and the method includes: determining multiple target thresholds based on a detected first electrical signal; based on the multiple target thresholds, determining M1 first data sets and M2 second data sets in the first electrical signal, the multiple target thresholds include M1 first target threshold groups and M2 second target threshold groups, the first target threshold group includes at least one target threshold, the second target threshold group includes at least one target threshold, one first target threshold group corresponds to one first data set, one second target threshold group corresponds to one second data set, the first data set includes peak data of the first electrical signal, the M2 second data sets are data sets in the first electrical signal other than the M1 first data sets, and M1 and M2 are integers greater than or equal to 1; performing noise reduction processing on the M1 first data sets and the M2 second data sets to obtain a second electrical signal.
[0007] In an embodiment of the present application, the electronic device can determine multiple target thresholds based on the detected first electrical signal, and based on the multiple target thresholds, determine M1 first data sets and M2 second data sets in the first electrical signal, and then perform noise reduction processing on the M1 first data sets and the M2 second data sets to obtain the second electrical signal. Since the first data set includes the peak data of the first electrical signal, the first data set can be considered as a data set in the peak area, and the second data set can be considered as a data set in the non-peak area. That is, the electronic device can determine the data set in the peak area and the data set in the non-peak area based on the multiple target thresholds. In the related scheme, the data set in the peak area and the data set in the non-peak area are determined by a fixed voltage threshold. When determining the data set in the peak area and the data set in the non-peak area, the related scheme may mistakenly determine the peak area as the non-peak area, resulting in misdetection, because the peak values of the electrical signals generated by the same user in different periods are different, or the peak values of the electrical signals generated by different users due to their own physical conditions, or the peak values of the electrical signals generated by the same user under different detection conditions are different. The embodiment of the present application can determine multiple voltage thresholds for electrical signals of various waveforms, and determine the data set in the peak area and the data set in the non-peak area based on the multiple voltage thresholds. This can reduce the probability of misdetection and improve the accuracy of determining the peak area and the non-peak area. In the subsequent process of realizing noise reduction based on the determined more accurate peak area and non-peak area, the noise reduction effect can be improved, and the user experience can be improved.
[0008] In combination with the first aspect, in some implementations of the first aspect, the electronic device determines multiple target thresholds based on the detected first electrical signal, including:
[0009] The electronic device performs a first filtering process on the first electrical signal to obtain a third electrical signal, where the third electrical signal includes a plurality of first candidate data; performs a second filtering process on the first electrical signal to obtain a reference electrical signal, where the reference electrical signal includes a plurality of second candidate data; and determines a plurality of target thresholds based on the third electrical signal and the reference electrical signal; wherein the process of determining one of the plurality of target thresholds based on the third electrical signal and the reference electrical signal includes:
[0010] The electronic device determines a target threshold corresponding to the i-th group of data based on the i-th group of data, where the i-th group of data includes a first candidate data and a second candidate data, where the first candidate data and the second candidate data in the i-th group of data are obtained based on the same data of the first electrical signal, and i is an integer greater than or equal to 1.
[0011] In the embodiment of the present application, the reason why the electronic device can determine the target threshold corresponding to the i-th group of data based on a first candidate data and a second candidate data included in the i-th group of data is that multiple groups of data are obtained by calculating a large amount of test data, each group of data includes the first candidate data and the second candidate data, and after data analysis of the first candidate data and the second candidate data in the multiple groups of data, it is found that the first candidate data and the second candidate data have the following characteristics in terms of values: in the peak area of the first electrical signal, the value of the first candidate data is greater than or equal to the value of the second candidate data, and in the non-peak area of the first electrical signal, the value of the first candidate data is less than the value of the second candidate data. Therefore, the target threshold corresponding to the i-th group of data determined by the electronic device based on the first candidate data and the second candidate data included in the i-th group of data according to the above characteristics can be used as a basis for determining the data in the peak area (first data set) and the non-peak area (second data set), so that the electronic device can accurately determine the first data set and the second data set based on the target threshold;
[0012] Furthermore, the electronic device determines the target threshold corresponding to a group of data (the i-th group of data) and can process the data in real time, thereby reducing the computational complexity when determining the target threshold and increasing the data processing speed.
[0013] In combination with the first aspect, in some implementations of the first aspect, the electronic device determines, based on the i-th group of data, a target threshold corresponding to the i-th group of data, including:
[0014] When the electronic device determines that the first candidate data in the i-th group of data is greater than the second candidate data, it determines whether the target threshold corresponding to the i-1th group of data is less than the second candidate data in the i-th group of data, and the target threshold corresponding to the i-1th group of data is obtained based on the initialization processing, or based on the i-1th group of data; when it is determined that the target threshold corresponding to the i-1th group of data is less than the second candidate data in the i-th group of data, the target threshold corresponding to the i-th group of data is determined to be the second candidate data in the i-th group of data.
[0015] In an embodiment of the present application, when the electronic device determines that the first candidate data in the i-th group of data is greater than the second candidate data, and when it determines that the target threshold corresponding to the i-1-th group of data is less than the second candidate data in the i-th group of data, the target threshold corresponding to the i-th group of data is determined to be the second candidate data in the i-th group of data, and the target threshold corresponding to the i-th group of data can be accurately determined.
[0016] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0017] When the electronic device determines that the target threshold corresponding to the i-1th group of data is greater than or equal to the second candidate data in the i-th group of data, it determines whether the threshold parameter corresponding to the i-th group of data satisfies a first condition, and the first condition is used to indicate that when the first candidate data in the i-1th group of data is equal to the second candidate data, the target threshold corresponding to the i-th group of data is lowered; when it is determined that the threshold parameter corresponding to the i-th group of data satisfies the first condition, it determines that the target threshold corresponding to the i-th group of data is the second candidate data in the i-th group of data; wherein the threshold parameter corresponding to the i-th group of data is a parameter representing an update range of the target threshold corresponding to the i-th group of data, and a parameter representing whether the second candidate data in the i-th group of data increases relative to the second candidate data in the i-1th group of data.
[0018] In an embodiment of the present application, when the electronic device determines that the target threshold corresponding to the i-1th group of data is greater than or equal to the second candidate data in the i-th group of data, and when the electronic device determines that the threshold parameter corresponding to the i-th group of data satisfies the first condition, the electronic device can judge that the value of the current threshold of the i-th group of data may be large. In order to avoid false detection due to the large value of the current threshold of the i-th group of data, the electronic device can determine the target threshold corresponding to the i-th group of data as the second candidate data in the i-th group of data. In this way, the electronic device can lower the value of the threshold when it is determined that the value of the current threshold of the i-th group of data may be large.
[0019] In combination with the first aspect, in some implementations of the first aspect, the threshold parameter corresponding to the i-th group of data of the electronic device includes a baseline value corresponding to the i-th group of data and a rising branch count value corresponding to the i-th group of data; and the first condition is that the baseline value corresponding to the i-th group of data is greater than a first value, and the rising branch count value corresponding to the i-th group of data is greater than a second value, and a difference between the second candidate data in the i-th group of data and the baseline value corresponding to the i-th group of data is greater than a third value;
[0020] Among them, the baseline value corresponding to the i-th group of data is the minimum value in the update range of the target threshold corresponding to the i-th group of data, the rising branch count value corresponding to the i-th group of data refers to the number of second candidate data in the K groups of data in the i-th group of data, the last group of data in the K groups of data is the i-th group of data, the second candidate data in the j-th group of data in the K groups of data is greater than the second candidate data in the j-1th group, K is an integer greater than or equal to 1, and J is an integer greater than 1 and less than or equal to K.
[0021] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0022] When the electronic device determines that the threshold parameter corresponding to the i-th group of data does not satisfy the first condition, it determines whether the threshold parameter corresponding to the i-th group of data satisfies the second condition, and the second condition is used to indicate that when the i-th group of data is the first group of data, the target threshold corresponding to the i-th group of data should be lowered; when it is determined that the threshold parameter corresponding to the i-th group of data satisfies the second condition, it determines that the target threshold corresponding to the i-th group of data is the second candidate data in the i-th group of data.
[0023] In an embodiment of the present application, when the electronic device determines that the threshold parameter corresponding to the i-th group of data does not satisfy the first condition, and when the electronic device determines that the threshold parameter corresponding to the i-th group of data satisfies the second condition, the electronic device can judge that the i-th group of data is data that has just been received, and the value of the current threshold of the i-th group of data may be large. In order to avoid false detection when determining the peak area or non-peak area with the current threshold of the i-th group of data when the data is just received, the electronic device can determine the target threshold corresponding to the i-th group of data as the second candidate data in the i-th group of data to lower the current threshold of the i-th group of data that the electronic device has just received.
[0024] In combination with the first aspect, in some implementations of the first aspect, the threshold parameter corresponding to the i-th group of data includes a reference value corresponding to the i-th group of data and an ascending branch count value corresponding to the i-th group of data; and the second condition is that the reference value corresponding to the i-th group of data is greater than a fourth value, and the ascending branch count value corresponding to the i-th group of data is greater than a fifth value, and a difference between the second candidate data in the i-th group of data and the reference value corresponding to the i-th group of data is greater than a sixth value;
[0025] Among them, the reference value corresponding to the i-th group of data is the maximum value in the update range of the target threshold corresponding to the i-th group of data, the rising branch count value corresponding to the i-th group of data refers to the number of second candidate data in the K groups of data in the i-th group of data, the last group of data in the K groups of data is the i-th group of data, the second candidate data in the j-th group of data in the K groups of data is greater than the second candidate data in the j-1th group, K is an integer greater than or equal to 1, and J is an integer greater than 1 and less than or equal to K.
[0026] In combination with the first aspect, in some implementations of the first aspect, the electronic device determines, based on the i-th group of data, a target threshold corresponding to the i-th group of data, including:
[0027] The electronic device determines whether the threshold parameter corresponding to the i-1th group of data satisfies a third condition when it is determined that the first candidate data in the i-th group of data is less than or equal to the second candidate data; determines that the target threshold corresponding to the i-th group of data is the second candidate data in the i-th group of data, and determines that the threshold update state in the threshold parameter corresponding to the i-th group of data is zero when it is determined that the threshold parameter corresponding to the i-1th group of data satisfies the third condition;
[0028] Among them, the third condition is used to indicate that when the i-th group of data is the first group of data and the target threshold corresponding to the i-1-th group of data is obtained based on the initialization processing, the target threshold corresponding to the i-th group of data is lowered, the threshold parameter corresponding to the i-1-th group of data is obtained based on the initialization processing, and the threshold parameter corresponding to the i-1-th group of data is a parameter that characterizes the update range of the target threshold corresponding to the i-1-th group of data.
[0029] In an embodiment of the present application, when the electronic device determines that the first candidate data in the i-th group of data is less than or equal to the second candidate data, and when the electronic device determines that the threshold parameter corresponding to the i-1-th group of data satisfies the third condition, the electronic device can judge that the i-th group of data is data that has just been received, and the value of the current threshold of the i-th group of data may be large. In order to avoid false detection when determining the peak area or non-peak area with the current threshold of the i-th group of data when the data is just received, the electronic device can determine the target threshold corresponding to the i-th group of data as the second candidate data in the i-th group of data to reduce the current threshold of the i-th group of data just received by the electronic device, and the electronic device determines the threshold update state in the threshold parameter corresponding to the i-th group of data to be zero.
[0030] In combination with the first aspect, in certain implementations of the first aspect, the threshold parameters corresponding to the i-1th group of data include a reference value corresponding to the i-1th group of data; and, the third condition is that the reference value corresponding to the i-1th group of data is greater than a first multiple of the second candidate data in the i-1th group of data, and the reference value corresponding to the i-1th group of data is obtained based on initialization processing; wherein the reference value corresponding to the i-1th group of data is the maximum value in the update range of the target threshold corresponding to the i-1th group of data.
[0031] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0032] The electronic device determines, when determining that the threshold parameter corresponding to the i-1th group of data does not satisfy the third condition, whether the first candidate data in the i-th group of data is equal to the second candidate data in the i-th group of data, and whether the plurality of second candidate data in the n-th group of data gradually increases over time; when determining that the first candidate data in the i-th group of data is equal to the second candidate data in the i-th group of data, and the plurality of second candidate data in the n-th group of data gradually increases over time, determines that the reference value in the threshold parameter corresponding to the i-th group of data is the second candidate data in the i-th group of data, and determines that the target threshold corresponding to the i-th group of data is the reference value in the threshold parameter corresponding to the i-th group of data;
[0033] Among them, the n groups of data include the i-th group of data and the n-1 groups of data before the i-th group of data, n is an integer greater than 1, the threshold parameter corresponding to the i-th group of data is a parameter characterizing the update range of the target threshold corresponding to the i-th group of data, and the reference value in the threshold parameter corresponding to the i-th group of data is the maximum value in the update range of the target threshold corresponding to the i-th group of data.
[0034] In an embodiment of the present application, when the electronic device determines that the threshold parameter corresponding to the i-1th group of data does not satisfy the third condition, and when it is determined that the first candidate data in the i-th group of data is equal to the second candidate data in the i-th group of data, and the multiple second candidate data in the n-th group of data gradually increase over time, the electronic device can judge that the voltage value of the i-th group of data is the first candidate data greater than the voltage value of the second candidate data, and the voltage value of the first candidate data is less than the voltage value of the second candidate data by a critical value. The electronic device can determine the reference value in the threshold parameter corresponding to the i-th group of data as the second candidate data in the i-th group of data, and determine the target threshold value corresponding to the i-th group of data as the reference value in the threshold parameter corresponding to the i-th group of data. In this way, the target threshold value corresponding to the i-th group of data can be accurately determined, so as to accurately determine the peak area and the non-peak area based on the target threshold value corresponding to the i-th group of data when the voltage value of the i-th group of data is the first candidate data greater than the voltage value of the second candidate data, and the voltage value of the first candidate data is less than the voltage value of the second candidate data by a critical value.
[0035] In combination with the first aspect, in some implementations of the first aspect, after the electronic device determines that the reference value in the threshold parameter corresponding to the i-th group of data is the second candidate data in the i-th group of data, and determines that the target threshold corresponding to the i-th group of data is the reference value in the threshold parameter corresponding to the i-th group of data, the method further includes:
[0036] Determine whether the threshold parameter corresponding to the i-1th group of data satisfies a fourth condition, the fourth condition being used to indicate that when the target threshold corresponding to the i-th group of data is determined to be the reference value in the threshold parameter corresponding to the i-th group of data, the target threshold corresponding to the i-th group of data is lowered; when it is determined that the threshold parameter corresponding to the i-1th group of data satisfies the fourth condition, the reference value in the threshold parameter corresponding to the i-th group of data is changed from the second candidate data in the i-th group of data to the seventh value, and the target threshold corresponding to the i-th group of data is changed to the seventh value, and the threshold update state in the threshold parameter corresponding to the i-th group of data is determined to be zero, and the seventh value is less than the second candidate data in the i-th group of data.
[0037] The embodiment of the present application can determine whether the current threshold of the i-th group of data is larger through the fourth condition. When it is determined that the current threshold is larger, the reference value in the threshold parameter corresponding to the i-th group of data can be changed from the second candidate data in the i-th group of data to the seventh value, and the target threshold corresponding to the i-th group of data can be changed to the seventh value, which can reduce the value of the current threshold to ensure that the current threshold can accurately determine the peak area or non-peak area. And the threshold update state in the threshold parameter corresponding to the i-th group of data is determined to be zero, and the electronic device can determine whether to update the target threshold corresponding to the i-th group of data received subsequently based on the threshold update state.
[0038] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0039] When determining that the threshold parameter corresponding to the i-1th group of data does not satisfy the fourth condition, the electronic device determines that the threshold update state in the threshold parameter corresponding to the i-th group of data is zero.
[0040] In combination with the first aspect, in some implementations of the first aspect, the threshold parameter corresponding to the i-1th group of data includes an ascending branch count value corresponding to the i-1th group of data, a baseline value corresponding to the i-1th group of data, and a reference value corresponding to the i-1th group of data; and the fourth condition is that the ascending branch count value corresponding to the i-1th group of data is greater than an eighth value, and a difference between the first candidate data in the i-1th group of data and the baseline value corresponding to the i-1th group of data is greater than the reference value corresponding to the i-1th group of data, and the reference value corresponding to the i-1th group of data is greater than a second multiple of the second candidate data in the i-1th group of data;
[0041] Among them, the rising branch count value corresponding to the i-1th group of data refers to the number of second candidate data in the K-1 group of data in the i-1 group of data, the last group of data in the K-1 group of data is the i-1th group of data, the second candidate data in the jth group of data in the K-1 group of data is greater than the second candidate data in the j-1th group, K is an integer greater than or equal to 1, J is an integer greater than 1 and less than or equal to K, the baseline value corresponding to the i-1th group of data is the minimum value in the update range of the target threshold corresponding to the i-1th group of data, and the reference value corresponding to the i-1th group of data is the maximum value in the update range of the target threshold corresponding to the i-1th group of data.
[0042] In combination with the first aspect, in some implementations of the first aspect, the method further includes:
[0043] When the electronic device determines that the first candidate data in the i-th group of data is not equal to the second candidate data in the i-th group of data, and / or the multiple second candidate data in the n groups of data do not gradually increase over time, it determines whether the threshold update state in the threshold parameter corresponding to the i-1th group of data is zero; when it is determined that the threshold update state in the threshold parameter corresponding to the i-1th group of data is zero, it determines that the target threshold corresponding to the i-th group of data is the target threshold corresponding to the i-1th group of data.
[0044] In combination with the first aspect, in some implementations of the first aspect, the electronic device performs a first filtering process on the first electrical signal to obtain a third electrical signal, including:
[0045] The electronic device performs a third filtering process on the first electrical signal to obtain a fourth electrical signal, wherein the frequency range of the fourth electrical signal is the first frequency range, and the first frequency range is smaller than the frequency range of the first electrical signal; performs a differential process on the fourth electrical signal to obtain a fifth electrical signal; performs a square process on the fifth electrical signal to obtain a sixth electrical signal; and performs a sliding average process on the sixth electrical signal to obtain a third electrical signal;
[0046] Accordingly, performing a second filtering process on the first electrical signal to obtain a reference electrical signal includes:
[0047] The third electrical signal is subjected to exponential sliding processing to obtain a reference electrical signal.
[0048] In the embodiment of the present application, the electronic device can reprocess the first electrical signal, and the reprocessing includes third filtering processing, differential processing, squaring processing, sliding average processing and exponential sliding processing. Since the third electrical signal and the reference signal can be obtained, the third electrical signal and the reference signal after reprocessing are convenient for subsequent data operations.
[0049] In combination with the first aspect, in some implementations of the first aspect, before the electronic device determines the multiple target thresholds based on the detected first electrical signal, the method further includes:
[0050] The electronic device performs a fourth filtering process on the first electrical signal to obtain a seventh electrical signal, wherein the frequency range of the seventh electrical signal is the second frequency range, and the second frequency range is smaller than the frequency range of the first electrical signal; determining whether a plurality of first characteristic data in the seventh electrical signal satisfies a fifth condition, wherein the fifth condition is used to indicate that noise data exists in a first data set in the first electrical signal, and the plurality of first characteristic data include a plurality of peak data of the first electrical signal and a plurality of interval durations corresponding to the plurality of peak data;
[0051] Accordingly, based on the detected first electrical signal, a plurality of target thresholds are determined, including:
[0052] In the case where it is determined that the plurality of first feature data in the seventh electrical signal satisfies the fifth condition, a plurality of target thresholds are determined based on the detected first electrical signal.
[0053] In the embodiment of the present application, since the electronic device performs the fourth filtering processing on the first electric signal, the obtained seventh electric signal includes the main feature points of the first electric signal, and the fifth condition is used to indicate that there is noise data in the first data set in the first electric signal. Therefore, the electronic device can accurately determine whether the data in the area where the main feature points of the first electric signal are located are subject to strong noise interference by determining whether multiple first feature data in the seventh electric signal meet the fifth condition. When it is determined that the data in the area where the main feature points of the first electric signal are located are subject to strong noise interference, multiple target thresholds are determined to achieve noise reduction. When it is determined that the data in the area where the main feature points of the first electric signal are located are not subject to strong noise interference, noise reduction processing is not performed, thereby reducing the power consumption of the electronic device.
[0054] In combination with the first aspect, in certain implementations of the first aspect, the fifth condition is that the mean of the multiple peak data is greater than the ninth value, the standard deviation of the multiple interval time lengths is less than the tenth value, and the standard deviation of the multiple peak data is less than the third multiple of the mean of the multiple peak data.
[0055] In combination with the first aspect, in some implementations of the first aspect, the electronic device performs noise reduction processing on M1 first data sets and M2 second data sets to obtain a second electrical signal, including:
[0056] The electronic device performs noise reduction processing on M1 first data sets through multiple windows of non-fixed length that gradually decrease over time to obtain an eighth electrical signal; and performs noise reduction processing on M2 second data sets through multiple windows of non-fixed length that gradually increase over time to obtain a ninth electrical signal, and the second electrical signals include the eighth electrical signal and the ninth electrical signal.
[0057] It should be understood that when the data is smoothed through a longer window, the influence of random errors caused by noise can be reduced, making the data in the window smoother and more consistent, and the noise reduction effect is better. When the noise suppression module smoothes the data through a shorter window, it can reduce random errors while retaining the original features of the data as much as possible to avoid the loss of the original features of the data, but the noise reduction effect is poorer than that of a longer window.
[0058] In the embodiment of the present application, the electronic device performs smoothing processing on the M1 first data sets through multiple windows of different lengths that gradually decrease over time, so that the main feature points of the first electrical signal can be retained and a better noise reduction effect can be achieved. The electronic device performs smoothing processing on the data in the M2 second data sets through multiple windows of different lengths that gradually increase over time, which can achieve a better noise reduction effect.
[0059] In combination with the first aspect, in some implementations of the first aspect, before the electronic device determines the multiple target thresholds based on the detected first electrical signal, the method further includes:
[0060] The electronic device detects a first electrical signal in response to a trigger event;
[0061] Correspondingly, after performing noise reduction processing on the M1 first data sets and the M2 second data sets to obtain the second electrical signal, the method further includes:
[0062] The electronic device displays a first interface including a second electrical signal.
[0063] In a second aspect, an electronic device is provided, and the electronic device is used to execute the method provided in the first aspect. Specifically, the electronic device may include a processing unit for executing any possible implementation manner of the first aspect.
[0064] In a third aspect, an electronic device is provided, comprising: one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs comprising instructions, which, when executed by the one or more processors, enable the electronic device to execute a method in any possible implementation of the first aspect.
[0065] In a fourth aspect, a computer-readable storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect.
[0066] In a fifth aspect, a chip is provided, comprising a memory for storing instructions; and a processor for calling and executing instructions from the memory, so that an electronic device equipped with the chip executes the method described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 An example graph of an ECG signal generated during one heartbeat cycle is provided.
[0068] Figure 2 It provides a PPG signal when the pulse beats once.
[0069] Figure 3 The figure is an example of a noise reduction method of a related solution.
[0070] Figure 4 This is an example diagram of the waveform of the enhanced signal of the electrical signal in different heartbeat cycles of the same user provided in an embodiment of the present application.
[0071] Figure 5 This is an example diagram of the waveform of the enhanced signal of the electrical signal provided by the implementation of the present application for different users or under different test conditions.
[0072] Figure 6 This is an example diagram provided by an embodiment of the present application of determining a peak area and a non-peak area by using different thresholds.
[0073] Figure 7 It is a structural diagram of an electronic device 100 provided in an embodiment of the present application.
[0074] Figure 8 It is a schematic diagram of the software structure of the electronic device 100 according to an embodiment of the present application.
[0075] Fig. 9 This is an example diagram of an ECG signal measured by a user through a watch, provided in an embodiment of the present application.
[0076] Fig.10 This is an example diagram provided by an embodiment of the present application of a user performing pulse wave arrhythmia analysis using a watch.
[0077] Fig.11 It is a schematic flow chart of a noise reduction method provided in an embodiment of the present application.
[0078] Fig.12 It is a timing diagram of a noise reduction method provided in an embodiment of the present application.
[0079] Fig.13 This is an example diagram of determining multiple voltage thresholds provided in an embodiment of the present application.
[0080] Fig.14 This is an example diagram provided by an embodiment of the present application of performing smoothing using a window whose length gradually decreases over time.
[0081] Fig.15 This is an example diagram provided by an embodiment of the present application of performing smoothing using a window whose length gradually increases over time.
[0082] Fig.16 This is an example diagram of an electrical signal 5 and an electrical signal 1 provided in an embodiment of the present application.
[0083] Fig.17It is a timing diagram of the implementation process of step 309 provided in an embodiment of the present application.
[0084] Fig.18 This is an example diagram of segmented processing of an electrical signal provided in an embodiment of the present application.
[0085] Fig.19 It is a timing diagram of the implementation process of step 312 provided in an embodiment of the present application.
[0086] Fig. 20 This is an example diagram of a data processing process within a signal enhancement module provided in an embodiment of the present application.
[0087] Fig.21 This is an example diagram of a waveform of an electrical signal provided in an embodiment of the present application.
[0088] Fig. 22 It is a schematic flowchart of determining multiple voltage thresholds provided in an embodiment of the present application.
[0089] Fig.23 It is an example diagram of the waveform of an electrical signal 24 and an electrical signal 25 provided in an embodiment of the present application.
[0090] Fig.24 It is a schematic flow chart of step E provided in an embodiment of the present application.
[0091] Fig.25 It is another waveform diagram of the electrical signal 24 and the electrical signal 25 provided in the embodiment of the present application.
[0092] Fig.26 This is an example diagram for determining voltage range 1 and voltage range 2 in an electrical signal 3 provided in an embodiment of the present application.
[0093] Fig. 27 It is a schematic flow chart of a noise reduction method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0094] Before introducing the technical solutions provided by the embodiments of the present application, the terms mentioned in the embodiments of the present application are explained.
[0095] Electrocardiogram (ECG) signal is an electrical signal generated by the user's heartbeat activity. ECG signal records the depolarization and repolarization process of myocardial cells from a macroscopic perspective. The principle that electronic devices can detect PPG signals is that when myocardial cells in the human body are in a resting state, a certain number of cations are arranged outside the cell membrane, and an equal number of anions are attached to the cell membrane. A certain potential difference is maintained between the inside and outside of the membrane, and the cations at each point outside the membrane are evenly distributed, no potential difference is generated, and no current is generated. This state is called a polarized state, and the ECG signal is only a horizontal line at this time. When myocardial cells are stimulated, the permeability of the cell membrane to ions changes, and the depolarization process begins. There is a potential difference between the point at which depolarization begins and the adjacent part that has not yet been depolarized, so current is generated to form a couple. The couple is composed of a power source and a hole. The depolarization process is like a group of couples moving forward along the myocardial cell membrane, with the power source in front and the hole behind. At this time, the ECG signal can be a wave in the direction (positive wave). When depolarization is completed, a layer of negative charge is arranged outside the cell membrane, and an equal number of positive charges are arranged inside the membrane, and the myocardial cell is in a depolarized state. At this time, no current is generated at the left and right ends of the cell membrane, and the ECG signal returns to the isoelectric line. The repolarization process of myocardial cells is exactly the opposite of the depolarization process. The repolarization process is in front of the hole and the power supply is behind. Since the power supply is away from the detection electrode, the ECG signal is a downward wave (negative wave). After repolarization is completed, the cell membrane returns to the polarized state, showing a layer of positive charge outside the cell membrane, and the membrane is attached with an equal number of negative charges. There is no potential difference outside the cell membrane, and the ECG signal returns to the isoelectric line.
[0096] For example, please refer to Figure 1 , Figure 1 is an example of an ECG signal generated during a heartbeat cycle. Figure 1 It can be seen that the characteristics of the ECG signal generated by a heartbeat cycle include P wave, QRS complex, PR interval, ST segment, T wave and QT interval. Among them, the P wave refers to the initially generated deviated wave, which reflects the potential change of the atrial depolarization process and represents the depolarization process of the two atria. The QRS complex refers to the largest wave generated by the activation of the ventricles, which reflects the potential change of the ventricular muscle depolarization process. The PR interval refers to the time period from the beginning of the P wave to the beginning of the QRS complex, which represents the time limit from the beginning of atrial muscle depolarization to the beginning of ventricular muscle depolarization. The PR segment refers to a horizontal line after the P wave and before the QRS complex. The ST segment refers to a horizontal line after the QRS complex and before the T wave, which represents the period from the completion of the depolarization of the left and right ventricles to the beginning of repolarization. The T wave represents the potential change caused by the repolarization process of the ventricular muscle. The QT interval represents the total time from the beginning of depolarization to the completion of repolarization of the entire ventricular muscle. It should be understood that the ECG signals generated by each heartbeat in multiple heartbeat cycles of the user can refer to Figure 1 The ECG signal is shown.
[0097] Photoplethysmography (PPG) signals are signals detected by photoelectric technology that reflect changes in blood volume in peripheral blood vessels caused by cardiac activity. Usually, electronic devices can infer the user's pulse data, blood oxygen data, and blood pressure data through PPG signals. The principle that electronic devices can detect PPG signals is that the heart is a continuous vibration source. When the ventricles contract, blood quickly enters the aorta, causing the pressure at its base to increase sharply and expand; when the ventricles relax, the pressure at the base of the aorta decreases, and the wall elastically retracts. In this way, the aortic wall is forced to vibrate rhythmically due to the contraction and relaxation of the ventricles. This vibration can propagate along the elastic blood vessels to the extremities to form a pulse wave.
[0098] For example, please refer to Figure 2 , Figure 2 It provides a PPG signal when the pulse beats once. Figure 2 It can be seen that the PCG signal formed when the pulse beats once includes important features such as A, B, C and D. A can be called the main peak, B can be called the tidal wave peak, C can be called the dicrotic peak, and D is called the tidal wave trough. Among them, the OA segment refers to the rising branch of the pulse waveform. It is due to the rapid increase of arterial blood pressure when the left ventricle ejects blood when the arterial wall expands, forming a tube wall expansion. Point O is the starting point of the cardiac ejection period, reflecting the pressure and volume in the blood vessels at the end of the contraction period. Point A is the highest point of the aortic pressure, reflecting the maximum value of the pressure and volume in the artery. The AD segment refers to the front segment of the descending branch. It is due to the fact that in the later stage of ventricular ejection, the ejection speed begins to decrease, causing the amount of blood flowing from the aorta to the periphery to be greater than the amount of blood flowing into the aorta, the large artery changes from expansion to retraction, and the arterial blood pressure gradually decreases. Point B is the point where the left ventricular ejection stops. It is the peak point of the reflected wave, also called the tidal wave peak, which reflects the tension, compliance and peripheral resistance of the arterial blood vessels. Point D is the trough of the tidal wave, i.e. the dividing point between cardiac contraction and diastole, which mainly reflects the size of peripheral resistance. Segment DE refers to the posterior segment of the descending branch, also called the dicrotic wave, which is formed by the reflux of blood in the aorta toward the ventricle due to ventricular dilation and continuous decrease in arterial blood pressure.
[0099] Baseband drift is one of the main noises of ECG signals, PPG signals, etc. It is mainly caused by the user's breathing, electrode patch sliding, etc. Its frequency is generally lower than 1 Hz, and its waveform is a slowly changing sine-like curve.
[0100] Myoelectric interference is one of the main noises of ECG signals, PPG signals, etc. It is mainly caused by irregular high-frequency electrical interference generated by the user's muscle tremors. Its frequency range is very wide, and it manifests as an irregular and rapidly changing waveform.
[0101] Power frequency noise is also one of the main noises of ECG signals, PPG signals, etc. It mainly comes from the power frequency power supply and the electromagnetic field radiated from the surrounding environment of the device. The frequency is 50Hz or 60Hz, and its waveform appears as periodic small ripples.
[0102] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0103] With the continuous development of electronic devices, electronic devices can provide users with a variety of services for detecting user health. For example, users can detect electrical signals such as ECG signals and PPG signals through electronic devices.
[0104] Usually, when electronic devices detect the above electrical signals, they are easily interfered by various factors, thus introducing noise into the detected electrical signals. The interference of various factors may include: electromagnetic interference in electronic devices, user movement interference, impedance interference caused by skin contact with electronic devices, interference caused by user muscle tremors, etc. Noise mainly includes: baseband drift, muscle interference, power frequency noise and other noises.
[0105] In a related solution, the method for reducing noise of the above-mentioned electrical signal is: the electronic device determines the peak area and the non-peak area in the electrical signal through a fixed voltage threshold (for example, assuming that the electrical signal is Figure 1 In the ECG signal shown in FIG. , the peak region may be the region where the R peak is located, and the non-peak region refers to the region other than the peak region. For another example, assuming that the electrical signal is Figure 2 In the PPG signal shown, the peak area refers to the area where the main wave peak point A is located, and the non-peak area refers to the area other than the peak area). Noise reduction processing is performed on the signal in the non-peak area, and no noise reduction processing is performed on the signal in the peak area, so as to achieve noise reduction of the electrical signal.
[0106] For example, please refer to Figure 3 , Figure 3 The figure is an example of a noise reduction method of a related solution. Figure 3 The electrical signal is an ECG signal. Figure 3 The waveform shown is an enhanced signal of ECG within 0 to 70 milliseconds (mS). Assuming that the fixed threshold is 3 millivolts (mV), the electronic device can determine the voltage range greater than the fixed threshold as the voltage range corresponding to the peak area. For example, the voltage range corresponding to the peak area can be Figure 3 The electronic device may also determine a voltage range less than or equal to a fixed threshold as a voltage range corresponding to the non-peak region. For example, the voltage range corresponding to the non-peak region may be Figure 3The voltage ranges corresponding to 0mS to 15mS, 18mS to 35mS, 40mS to 55mS, and 62mS to 70mS are shown. The electronic device performs noise reduction processing on the signal in the non-peak region and does not perform noise reduction processing on the signal in the peak region, thereby reducing the noise in the electrical signal.
[0107] In the related scheme, although ECG signals, PPG signals and other electrical signals can be subjected to noise reduction processing, the peak area and non-peak area in the electrical signal are determined by a fixed voltage threshold. However, when the electronic device detects the electrical signal, the peak values of the electrical signal generated by the same user in different cycles (such as different heartbeat cycles, different pulse cycles) are different, or the peak values of the electrical signals generated by different users due to differences in their own physical conditions, or the peak values of the electrical signals generated by the same user under different detection conditions are different. As a result, when the peak area and non-peak area in the electrical signal are determined by a fixed voltage threshold, the peak area in the electrical signal may be mistakenly determined as the non-peak area, resulting in a false detection. In this way, in the subsequent noise reduction process, the signal in the peak area will also be subjected to noise reduction, causing the electrical signal to be excessively noise-reduced, resulting in poor noise reduction effect, and affecting the user experience.
[0108] It should be noted that the peak values mentioned in the examples throughout the text refer to, for example Figure 1 The voltage value of the vertical coordinate of the R peak point in the ECG signal is shown. Figure 2 The voltage value of the ordinate of the main peak point A in the PPG signal is shown.
[0109] For example, please refer to Figure 4 , Figure 4 This is an example diagram of the waveform of the enhanced signal of the electrical signal in different heartbeat cycles of the same user provided in an embodiment of the present application. Figure 4 In the example, the peak value of the enhanced signal of the ECG signal of the first heartbeat cycle may be 5mV, the peak value of the enhanced signal of the ECG signal of the second heartbeat cycle may be 2mV, the peak value of the enhanced signal of the ECG signal of the third heartbeat cycle may be 4mV, and so on. Figure 4 It can be seen that the peak values of the enhanced signals of the electrical signals in different heartbeat cycles of the same user are different. If the peak area and non-peak area in the electrical signal are determined by a fixed voltage threshold, there may be false detection. For example, if the fixed voltage threshold is 3mV, but Figure 4 The peak value of the second heartbeat cycle is shown to be 2mV, so the electronic device will determine the voltage range corresponding to the second heartbeat cycle as the voltage range of the non-peak area, which will cause false detection.
[0110] For example, Figure 5This is an example diagram of the waveform of the enhanced signal of the electrical signal provided by the implementation of the present application for different users or under different test conditions. Figure 5 (a) and Figure 5 (b) in FIG. 1 is used to illustrate the peak values of the enhanced signals of the ECG signals of different users. Assume that Figure 5 (a) shows the waveform of the enhanced signal of the ECG signal of user A. The peak value of the enhanced signal of the ECG signal of the first heartbeat cycle of user A may be 5mV, the peak value of the enhanced signal of the ECG signal of the second heartbeat cycle may be 2mV, the peak value of the enhanced signal of the ECG signal of the third heartbeat cycle may be 4mV, and so on. Figure 5 In (b) of FIG. 1 , the waveform of the enhanced signal of the ECG signal of user B is shown. Then, the peak value of the enhanced signal of the ECG signal of user B in the first heartbeat cycle may be 4mV, the peak value of the enhanced signal of the ECG signal of the second heartbeat cycle may be 5mV, the peak value of the enhanced signal of the ECG signal of the third heartbeat cycle may be 4mV, and so on. Figure 5 (a) and Figure 5 As shown in (b), the peak values of the enhanced signals of the electrical signals of different users are different in the same heartbeat cycle. If the peak area and non-peak area in the electrical signal are determined by a fixed voltage threshold, there may be false detection. For example, if the fixed voltage threshold is 3mV, Figure 5 In (b), the peak values of the three heartbeat cycles of user B are all greater than 3mV. Therefore, there will be no false detection when the peak area is detected by a fixed voltage threshold. Figure 5 As shown in (a) in FIG. 1 , the peak value of the second heartbeat cycle of user A is 2 mV. Then, the electronic device will determine the voltage range corresponding to the second heartbeat cycle of user A as the voltage range of the non-peak area, which will cause a false detection.
[0111] For example, Figure 5 (a) and Figure 5 (c) is used to illustrate the peak value of the enhanced signal of the ECG signal under different detection conditions of the same user. Different detection conditions can be, but are not limited to: the user wears the wearable device in different ways when detecting ECG signals, PPG and other electrical signals through the wearable device, for example, the wearable device is worn on the left hand and the wearable device is worn on the right hand; the user uses the detection device to detect ECG signals in different lead methods, etc. It should be understood that the lead is to place electrodes at any two points on the user's body surface, and then connect them to the positive and negative poles of the detection device with a wire to form a circuit. This connection method and device is called a lead, and the lead can include a unipolar lead, a bipolar lead, etc.
[0112] Assumptions Figure 5 (a) shows a waveform of the enhanced signal of the ECG signal of user A under a test condition. The peak value of the enhanced signal of the ECG signal of user A's first heartbeat cycle may be 5mV, the peak value of the enhanced signal of the ECG signal of the second heartbeat cycle may be 2mV, the peak value of the enhanced signal of the ECG signal of the third heartbeat cycle may be 4mV, etc. Assume Figure 5 (c) shows the waveform of the enhanced signal of the ECG signal of user A under another test condition. Then the peak value of the enhanced signal of the ECG signal of user A in the first heartbeat cycle may be 2mV, the peak value of the enhanced signal of the ECG signal of the second heartbeat cycle may be 4mV, the peak value of the enhanced signal of the ECG signal of the third heartbeat cycle may be 2mV, etc. Figure 5 (a) and Figure 5 As shown in (c), the peak values of the enhanced signals of the electrical signals under different test conditions may be different in the same heartbeat cycle. If the peak area and non-peak area in the electrical signal are determined by a fixed voltage threshold, there may be false detection. For example, if the fixed voltage threshold is 3mV, Figure 5 As shown in (a) in FIG. 1 , the peak value of the second heartbeat cycle of user A is 2 mV. Then, the electronic device will determine the voltage range corresponding to the second heartbeat cycle of user A as the voltage range of the non-peak area, which will cause a false detection. Figure 5 As shown in (c), the peak values of the 1st and 3rd heartbeat cycles of user A are 2mV. Then, the electronic device will determine the voltage range corresponding to the 1st and 2nd heartbeat cycles of user A as the voltage range of the non-peak area, which will cause false detection.
[0113] As can be seen from the above, the scheme of noise reduction through a fixed voltage threshold in the related scheme may result in false detection, resulting in poor noise reduction effect. The embodiment of the present application provides a noise reduction method, and the electronic device can determine the peak area and the non-peak area through different voltage thresholds, so as to perform noise reduction processing according to the determined peak area and the non-peak area. In this way, the peak area and the non-peak area can be accurately determined, the probability of false detection is reduced, the noise reduction effect is improved, and the user experience is improved.
[0114] For example, please refer to Figure 6 , Figure 6 This is an example diagram provided by an embodiment of the present application of determining a peak area and a non-peak area by using different thresholds. Figure 6The peak value in the first heartbeat cycle is shown to be 5mV, so the electronic device can determine the peak area and the non-peak area through threshold 1, for example, threshold 1 is 4mV. The peak value in the second heartbeat cycle is 2mV, so the electronic device can determine the peak area and the non-peak area through threshold 2, for example, threshold 2 is 1mV. The peak value in the third heartbeat cycle is 4mV, so the electronic device can determine the peak area and the non-peak area through threshold 3, for example, threshold 3 is 3mV. In this way, the accuracy of determining the peak area and the non-peak area can be improved by using different thresholds, the probability of false detection can be reduced, and the noise reduction effect can be improved.
[0115] The noise reduction method provided in the embodiment of the present application is applied to electronic devices. The electronic device may also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The electronic device may be a wearable device, an electrocardiograph, a heart rate belt, an electronic oximeter, a mobile phone, a smart TV, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiment of the present application does not limit the specific technology and specific device form adopted by the electronic device.
[0116] In order to better understand the embodiments of the present application, the structure of the electronic device according to the embodiments of the present application is introduced below.
[0117] Figure 7 1 is a schematic diagram of the structure of an electronic device 100 (taking a wearable device as a watch as an example) provided in an embodiment of the present application. The electronic device 100 may include a processor 110, a filter 120, a button 130, an internal memory interface 140, a wireless communication module 150, a sensor module 160, an ECG sensor 160A, a PPG sensor 160B, a touch sensor 160C, etc.
[0118] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0119] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (Application processor, App), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.
[0120] The processor 110 may also be provided with a memory for storing instructions and data.
[0121] The processor 110 in the embodiment of the present application is mainly used to determine different thresholds, determine peak areas and non-peak areas based on the different thresholds, and implement noise reduction based on the determined peak areas and non-peak areas.
[0122] The filter 120 refers to a device for filtering electrical signals such as ECG signals and PPG signals. The filter 120 can filter a frequency point of a certain frequency in the electrical signal or frequencies other than the frequency to obtain an electrical signal of a specific frequency.
[0123] The key 130 includes a power key, a volume key, etc. The key 130 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0124] The internal memory 140 may be used to store computer executable program codes, where the executable program codes include instructions.
[0125] The wireless communication module 150 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (WiFi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication function of the electronic device 100 can be implemented through the wireless communication module 150, the modem processor and the baseband processor.
[0126] The ECG sensor 160A is a device for measuring and recording the electrical activity of the human heart. The electronic device 100 can collect ECG signals through the ECG sensor 160A.
[0127] The PPG sensor 160B is a photoelectric sensor for monitoring cardiovascular vital signs. The electronic device 100 can collect PPG signals through the PPG sensor 160B.
[0128] The touch sensor 160C is also called a “touch panel.” The touch sensor 160C is used to detect touch operations applied to or near the electronic device.
[0129] The hardware structure of the electronic device 100 is introduced here. It can be understood that: Figure 7 The components included in the hardware structure shown do not constitute a specific limitation on the electronic device 100. The electronic device 100 may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0130] In addition, an operating system is running on the above components, such as the iOS operating system developed by Apple, the Android open source operating system developed by Google, and the Windows operating system developed by Microsoft. Application programs can be installed and run on the operating system.
[0131] The operating system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the operating system of the electronic device 100.
[0132] Figure 8 1 is a schematic diagram of the software structure of the electronic device 100 of the embodiment of the present application. The software structure includes several layers, each layer has a clear role and division of labor, and the layers communicate with each other through software interfaces. In some embodiments, the software structure is divided into an application layer, a service layer, an algorithm layer, and a kernel layer from top to bottom.
[0133] The application layer can include a series of application packages, such as ECG collection, health management, phone, weather, etc.
[0134] The service layer is used to provide system support for the applications in the application layer. For example, the service layer may include modules such as step counting service, heart rate service, calorie service, and health service.
[0135] The algorithm layer is used to provide algorithm support for the service layer. For example, the algorithm layer may include: heart rate algorithm, sleep algorithm, wearing algorithm, etc. Among them, the heart rate algorithm may include a low-pass filter module A, a noise suppression judgment module, a low-pass filter module B, a noise suppression module and a high-pass filter module A, etc. The low-pass filter module A can remove frequencies higher than the value A in the electrical signal and retain frequencies lower than or equal to the value A. The noise suppression judgment module can determine whether the electrical signal is subject to strong noise interference. The low-pass filter module B can remove frequencies higher than the value B in the electrical signal and retain frequencies lower than or equal to the value B, and the value B is greater than the value A. The noise suppression module can perform noise reduction processing on the electrical signal. The high-pass filter module A can retain frequencies greater than the value C and remove frequencies less than the value C, and the value C is less than the value A. The role of each module in the heart rate algorithm can be referred to the following embodiments, which will not be repeated here.
[0136] The kernel layer can include multiple driver modules, such as audio driver, sensor driver, Bluetooth driver, etc.
[0137] Understandably, Figure 8 The layers in the software structure shown and the components contained in each layer do not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer layers than shown in the figure, and each layer may include more or fewer components. For example, the software structure may also include a hardware abstraction layer, etc., which is not limited in the present application.
[0138] It is understandable that in order to implement the noise reduction method in the embodiment of the present application, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments.
[0139] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS or Windows.
[0140] The executor of the noise reduction method provided in the embodiment of the present application may be the electronic device mentioned above, or may be a functional module and / or functional entity in the electronic device that can implement the noise reduction method, and the scheme of the present application may be implemented in hardware and / or software, which may be determined according to actual usage requirements and is not limited in the embodiment of the present application.
[0141] The above embodiment introduces the hardware structure and software architecture of the electronic device 100. The following embodiment introduces the application scenario of the noise reduction method provided by the embodiment of the present application in combination with the accompanying drawings. The embodiment of the present application takes the electronic device as a wearable device and the wearable device as a watch as an example.
[0142] For example, see Fig. 9 , Fig. 9 1 is an example diagram of an ECG signal measured by a user through a watch provided in an embodiment of the present application. Fig. 9 As shown in (a) of FIG. 1 , the watch may display an interface 910, which includes an icon 911. The user may click on the icon 911, and the watch may display a response to the user clicking on the icon 911. Fig. 9 Interface 920 shown in (b) of FIG. Interface 920 displays an image 921 for reminding the user. After the user touches the lower electrode of the watch with his finger based on image 921, the watch starts to collect the ECG signal of the user, and the watch displays Fig. 9 The interface 930 shown in (c) of FIG. The remaining time 932 of the current acquisition may be displayed in the interface 930 . After the current acquisition is completed, the ECG signal of the current acquisition may be displayed in 931 .
[0143] For another example, please refer to Fig.10 , Fig.10 This is an example diagram of a user performing pulse wave arrhythmia analysis using a watch, provided in an embodiment of the present application. Fig.10As shown in (a) of FIG. 1 , the watch can display interface 1010, which includes icon 1011. The user can click icon 1011, and the watch displays interface 1020 in response to the user clicking icon 1011. Interface 1020 includes control 1021. The user can click control 1021. The watch displays interface 1030 in response to the user clicking control 1021. Interface 1030 includes a time remaining for displaying the current analysis 1031. After the current analysis is completed, interface 1040 can be displayed. Interface 1040 includes analysis result 1041 of the current analysis, and can also display control 1042. The user can click control 1042. The watch displays interface 1010 in response to the user clicking control 1042.
[0144] The above embodiments introduce the application scenarios of the noise reduction method provided in the embodiments of the present application. The following embodiments introduce the implementation process of the noise reduction method provided in the embodiments of the present application.
[0145] Please refer to Fig.11 , Fig.11 is a schematic flow chart of a noise reduction method provided in an embodiment of the present application. The method can be Figure 6 The electronic device 100 shown is executed, and may also be executed by a processor or chip in the electronic device 100, and the present application embodiment does not make any limitation. For ease of description, the method is described in detail by taking an electronic device as an example. The method includes steps 201 to 207.
[0146] Step 201 : The electronic device detects an electrical signal 1 .
[0147] It should be understood that the electrical signal refers to the electrical signal generated by human activities, such as ECG signals, PPG signals, etc. The embodiments of the present application do not limit the type of electrical signals.
[0148] Step 202 : The electronic device performs filtering processing on the electrical signal 1 to obtain the electrical signal 2 .
[0149] It should be understood that in this embodiment, the electronic device performs filtering processing on the electrical signal 1 to remove frequencies higher than the value A in the electrical signal 1, and retain frequencies lower than or equal to the value A. In this embodiment, the purpose of the electronic device performing filtering processing on the electrical signal 1 is to remove the medium and high frequency noise in the electrical signal 1, for example, the medium and high frequency noise may be power frequency noise, myoelectric interference noise, etc., and to retain the main feature points in the electrical signal 1. For example, assuming that the electrical signal 1 is an ECG signal, the voltage value of the R peak in the ECG signal can also be retained in the electrical signal 2 obtained after filtering processing. Assuming that the electrical signal 1 is a PPG signal, the voltage value of the main peak in the PPG signal can also be retained in the electrical signal 2 obtained after filtering processing.
[0150] For example, assuming that the electrical signal 1 is an ECG signal, the value A can be one of 15 to 25 Hz, for example, the value A can be 20 Hz, and the embodiment of the present application does not limit the size of the value A. It should be understood that the frequencies of the main characteristic points of the ECG signal (such as the QRS complex) are usually concentrated in the range of 5 to 20 Hz. The frequency of the power frequency noise, one of the main noises in the electrical signal, is 50 Hz or 60 Hz. The frequency of the myoelectric interference noise, one of the main noises in the electrical signal, is 30 to 300 Hz. Therefore, the embodiment of the present application performs low-pass filtering on the ECG signal 1 through the low-pass filtering module A. Specifically, the frequency of the low-pass filter is set to 20 Hz, so that in addition to removing the power frequency noise and the myoelectric interference noise in the electrical signal 1, the QRS complex in the ECG signal can also be retained.
[0151] It should also be understood that when the electrical signal 1 is an electrical signal other than an ECG signal, for example, the electrical signal 1 is a PPG signal, the value A can also be set according to the frequency range of the main characteristic points of the other electrical signals, for example, the main characteristic points of the PPG signal are Figure 2 Point A is shown. Assuming that the frequency range of point A is 2 Hz to 4 Hz, the value A can be 4 Hz. The embodiment of the present application does not limit the size of the value A. In this way, in addition to removing the power frequency noise and electromyographic interference noise in the electrical signal 1, the main characteristic points in the electrical signal 1 can also be retained.
[0152] Step 203 : The electronic device performs filtering processing on the electrical signal 1 to obtain the electrical signal 3 .
[0153] It should be understood that in this embodiment, the electronic device performs filtering processing on the electrical signal 1 to remove frequencies higher than the value B in the electrical signal, and retain frequencies lower than or equal to the value B, and the value B is greater than the value A. In this embodiment, the electronic device performs filtering processing on the electrical signal 1 to remove high-frequency noise in the electrical signal 1, which refers to noise with a frequency greater than the value B, and to retain the complete waveform of the electrical signal 1.
[0154] For example, assuming that the electrical signal 1 is an ECG signal, the value B may be one of 100 to 200 Hz, for example, the value B may be 100 Hz, 150 Hz, or 200 Hz. Of course, in some other embodiments, the value B may also be other values greater than the value A, such as 70 Hz, 80 Hz, 180 Hz, 200 Hz, etc. The embodiment of the present application does not limit the size of the value B.
[0155] It should be understood that the frequencies of ECG signals detected from the human body surface are usually concentrated in the range of 0.05 to 100 Hz. Therefore, the embodiment of the present application performs low-pass filtering on the ECG signal 1 through the low-pass filtering module B. Specifically, the frequency of the low-pass filter is set to 100 Hz. In this way, in addition to removing high-frequency noise, such as data points with a frequency greater than 100 Hz can be called noise points, the complete waveform of the ECG signal can also be retained.
[0156] It should also be understood that when the electrical signal 1 is an electrical signal other than the ECG signal, for example, the electrical signal 1 is a PPG signal, the value B can also be set according to the frequency range of the other electrical signal. For example, the frequency range of the PPG signal is 0.05 Hz to 5 Hz, then the value B can be 5 Hz. The embodiment of the present application does not limit the size of the value B. In this way, in addition to removing high-frequency noise, for example, data points with a frequency greater than 5 Hz can be called noise points, and the complete waveform of the PPG signal can be retained.
[0157] Step 204 : The electronic device determines, based on the electrical signal 2 , whether the data in the area where the main characteristic points in the electrical signal 1 are located is subject to strong noise interference.
[0158] It should be understood that from the above step 202, electrical signal 2 refers to the electrical signal that retains the main feature points in electrical signal 1 after the power frequency noise and electromyographic interference noise in electrical signal 1 are removed. Therefore, based on electrical signal 2, it can be determined whether the data in the area where the main feature points in electrical signal 1 are located is subject to strong noise interference.
[0159] Step 205, when the electronic device determines that the data in the area where the main feature points in the electrical signal 1 are located is subject to strong noise interference, it determines multiple voltage thresholds based on the electrical signal 2, and based on the multiple voltage thresholds, determines a voltage range 1 and a voltage range 2 in the electrical signal 3 (wherein voltage range 1 is used to indicate the voltage set in the peak area of the electrical signal 3, and voltage range 2 is used to indicate the voltage set in the non-peak area of the electrical signal 3), and performs noise reduction processing on voltage range 1 and voltage range 2 using different noise reduction strategies to obtain electrical signal 4.
[0160] It should be understood that the voltage range 1 includes data in the region where the main characteristic points in the electrical signal 1 are located, and the voltage range 2 refers to the voltage range in the electrical signal 3 except the voltage range 1. The meaning of the main characteristic points in the electrical signal 1 has been stated in the above embodiment and will not be repeated here. In other embodiments, the data in the voltage range 1 can also be referred to as the voltage set in the peak region of the electrical signal 3, and the data in the voltage range 2 can also be referred to as the voltage set in the non-peak region of the signal 3.
[0161] Regarding the implementation process of the electronic device determining multiple voltage thresholds based on the electrical signal 2, reference may be made to the following embodiments, which will not be described in detail here.
[0162] In implementation, after determining voltage range 1 and voltage range 2, the electronic device can perform noise reduction on voltage range 1 through noise reduction strategy 1. For example, noise reduction strategy 1 refers to that the electronic device smoothes the set of voltage values within voltage range 1 through multiple windows of different lengths that gradually decrease over time. The electronic device performs noise reduction on voltage range 2 through noise reduction strategy 2. For example, noise reduction strategy 2 refers to that the electronic device smoothes the set of voltage values within voltage range 1 through multiple windows of different lengths that gradually increase over time. The implementation process of noise reduction strategy 1 and noise reduction strategy 2 can be referred to the embodiments below, which will not be described here.
[0163] Step 206 : The electronic device performs high-pass filtering on the electrical signal 4 to obtain the electrical signal 5 .
[0164] It should be understood that in this embodiment, the electronic device performs high-pass filtering on the electrical signal 4 in order to remove low-frequency noise in the electrical signal 4. The low-frequency noise may be baseband drift. The meaning of baseband drift may be referred to the above embodiment, which will not be described here. The frequency of baseband drift is usually less than 1 Hz. The implementation method of the electronic device performing high-pass filtering on the electrical signal 4 may be referred to the following embodiment, which will not be described here.
[0165] Step 207 , when the electronic device determines that the data in the area where the main characteristic points in the electrical signal 1 are located is not interfered by strong noise, the electronic device performs high-pass filtering on the electrical signal 3 to obtain the electrical signal 6 .
[0166] It should be understood that in this embodiment, the electronic device performs high-pass filtering on the electrical signal 3 to remove low-frequency noise in the electrical signal 3. For the implementation of the electronic device performing high-pass filtering on the electrical signal 3, reference can be made to the following embodiments, which will not be repeated here.
[0167] The above embodiments take electronic equipment as an example to introduce the implementation process of the noise reduction method provided in the embodiments of the present application. Figure 8 The software architecture in the embodiment of the present application is introduced, and the electronic device is taken as a wearable device, and the wearable device is taken as a watch to introduce the implementation process of the noise reduction method provided in the embodiment of the present application.
[0168] For example, please refer to Fig.12 , Fig.12 301 to 316.
[0169] Step 301: The application layer generates a request for detecting an electrical signal in response to a user operation.
[0170] It should be understood that the electrical signal refers to the electrical signal generated by human activities, such as ECG signals, PPG signals, etc. The embodiments of the present application do not limit the type of electrical signals.
[0171] For example, in the case where the electrical signal is an ECG signal, an application program (such as Fig. 9 The “ECG Acquisition” application shown in (a) may generate a request for detecting an ECG signal in response to a user operation.
[0172] For another example, when the electrical signal is a PPG signal, an application program (such as Fig.10 The “Pulse Wave Arrhythmia Analysis” application shown in (a) may generate a request to detect a PPG signal in response to a user operation.
[0173] It should also be understood that the user operation may be a touch operation, a click operation, a voice control, etc., and the embodiments of the present application do not limit the type of user operation.
[0174] Step 302: The application layer sends a request for detecting electrical signals to the heart rate algorithm module in the algorithm layer through the heart rate service in the service layer.
[0175] Step 303: The heart rate algorithm module sends an instruction to detect the electrical signal to the kernel layer. After receiving the instruction, the kernel layer notifies the hardware layer to detect the electrical signal.
[0176] In the implementation, the kernel layer includes ECG sensor driver, PPG sensor driver, etc. Assuming that the heart rate algorithm module sends an instruction to detect ECG signals to the kernel layer, the ECG sensor driver in the kernel layer notifies the ECG sensor in the hardware layer to detect ECG signals after receiving the instruction.
[0177] Assuming that the heart rate algorithm module sends an instruction to detect the PPG signal to the kernel layer, the PPG sensor driver in the kernel layer notifies the PPG sensor in the hardware layer to detect the PPG signal after receiving the instruction.
[0178] Step 304: The hardware layer detects the electrical signal.
[0179] In implementation, the hardware layer may detect ECG signals through an ECG sensor, detect PPG signals through a PPG sensor, and so on.
[0180] Step 305: the hardware layer returns the detected electrical signal 1 to the kernel layer, and the kernel layer reports the electrical signal 1 to the low-pass filter module A and the low-pass filter module B in the heart rate algorithm module.
[0181] Step 306 , after receiving the electrical signal 1 , the low-pass filter module A performs low-pass filtering on the electrical signal 1 to obtain the electrical signal 2 .
[0182] It should be understood that the low-pass filtering module A can remove frequencies higher than the value A in the electrical signal 1, and retain frequencies lower than or equal to the value A. The implementation process of how the low-pass filtering module A can remove frequencies higher than the value A in the electrical signal 1 and retain frequencies lower than or equal to the value A can be referred to the above embodiment, and will not be repeated here.
[0183] Step 307 , after receiving the electrical signal 1 , the low-pass filter module B performs low-pass filtering on the electrical signal 1 to obtain the electrical signal 3 .
[0184] In implementation, the low-pass filter module B can remove frequencies higher than the value B in the electrical signal, retain frequencies lower than or equal to the value B, and the value B is greater than the value A. The implementation process of the low-pass filter module B being able to remove frequencies higher than the value B in the electrical signal, retain frequencies lower than or equal to the value B, and the value B being greater than the value A can be referred to the above embodiment, and will not be repeated here.
[0185] Step 308: The low-pass filter module A sends an electrical signal 2 to the noise suppression judgment module.
[0186] Step 309 , after receiving the electrical signal 2 , the noise suppression determination module determines whether to perform noise reduction processing on the electrical signal 3 through the noise suppression module in the heart rate algorithm module based on the electrical signal 2 .
[0187] It should be understood that from the above steps 202 and 306, the electrical signal 2 refers to the electrical signal that retains the main feature points in the electrical signal 1 after the power frequency noise and the myoelectric interference noise in the electrical signal 1 are removed. Therefore, the purpose of the noise suppression judgment module to judge whether to perform noise reduction processing based on the electrical signal 2 is to judge whether the data in the area where the main feature points in the electrical signal 1 (for example, the QRS wave group in the ECG signal, the main wave peak in the PPG signal) are located is subject to strong noise interference.
[0188] In an embodiment of the present application, after the noise suppression judgment module determines that the data in the area where the main feature points in the electrical signal 1 are located is subject to strong noise interference, the noise suppression module can be used to perform noise reduction processing on the electrical signal 3 to obtain the electrical signal 4, and then the high-pass filter module A in the heart rate algorithm module can be used to filter the electrical signal 4 to obtain the electrical signal 5.
[0189] After the noise suppression judgment module determines that the data in the area where the main feature points in the electrical signal 1 are located is not subject to strong noise interference, the electrical signal 3 is directly filtered by the high-pass filter module A in the heart rate algorithm module to obtain the electrical signal 6.
[0190] The implementation process of the noise suppression judgment module judging whether the main feature points in the electrical signal 1 are subject to strong noise interference based on the electrical signal 2 can be referred to the following embodiments, which will not be described here.
[0191] Step 310: When the noise suppression determination module determines that ECG2 is subject to strong noise interference, the noise suppression determination module sends ECG2 to the noise suppression module in the heart rate algorithm module.
[0192] Step 311, after obtaining the electrical signal 3 in step 307, the electrical signal 3 is sent to the noise suppression module in the heart rate algorithm module.
[0193] Step 312, after the noise suppression module receives the electrical signal 2 and the electrical signal 3, it determines multiple voltage thresholds based on the electrical signal 2, and determines the voltage range 1 and voltage range 2 in the electrical signal 3 based on each of the multiple voltage thresholds (wherein voltage range 1 is used to indicate the voltage set in the peak area of the electrical signal 3, and voltage range 2 is used to indicate the voltage set in the non-peak area of the electrical signal 3), and smoothes the multiple voltage values in the voltage range 1 through multiple windows of non-fixed length (the lengths of the multiple windows of non-fixed length gradually decrease over time), and smoothes the multiple voltage values in the voltage range 2 through multiple windows of non-fixed length (the lengths of the multiple windows of non-fixed length gradually increase over time), to obtain the electrical signal 4.
[0194] It should be understood that the meanings of the peak area and the non-peak area can be referred to the above embodiments and will not be repeated here.
[0195] The multiple voltage thresholds determined by the noise suppression module based on the electrical signal 2 can be referred to Fig.13 , Fig.13 is an example diagram of multiple voltage thresholds determined according to an embodiment of the present application. Fig.13 The waveform shown in FIG. 1 is a waveform of an enhanced signal of the electrical signal 2 within 0 to 70 mS. For example, the noise suppression module determines multiple voltage values based on the electrical signal 2 as follows: Fig.13 Threshold 1, threshold 2 and threshold 3 are shown. The implementation process of the noise suppression module determining multiple voltage thresholds based on the electrical signal 2 can be referred to the following embodiments and will not be described in detail here.
[0196] In the implementation, the process of the noise suppression module determining the voltage range 1 and the voltage range 2 in the electrical signal 3 based on each voltage threshold in the plurality of voltage thresholds may be: exemplarily, Fig.13The value of the threshold 1 in the enhanced signal of the electrical signal 2 shown in the figure is 4mV. The noise suppression module can determine the voltage value set greater than or equal to the threshold 1 in the 0th to 30th mS as the voltage value set of the enhanced signal of the electrical signal 2 in the peak region according to the threshold 1, and determine the voltage value set less than the threshold 1 in the 0th to 30th mS as the voltage value set of the enhanced signal of the electrical signal 2 in the non-peak region. Then the noise suppression module can determine the time period 1 of the set according to the voltage value set of the enhanced signal of the electrical signal 2 in the peak region, for example, the determined time period 1 is from the 15th to the 18th mS. After that, the noise suppression module determines the voltage value set in the time period 1 of the electrical signal 3 as the voltage range 1. And the noise suppression module can determine the time period 2 of the set according to the voltage value set of the enhanced signal of the electrical signal 2 in the non-peak region, for example, the determined time period 2 is from the 0th to the 15th mS, and from the 18th to the 30th mS. The noise suppression module determines the voltage value set in the time period 2 of the electrical signal 3 as the voltage range 2. The noise suppression module determines the voltage value set in the time period 2 of the electrical signal 3 as the voltage range 2. Fig.13 The threshold 2 and threshold 3 shown in the figure) are used to determine the voltage range 1 and voltage range 2 in the electrical signal 3. The implementation process of determining the voltage range 1 and voltage range 2 in the electrical signal 3 by the noise suppression module based on the threshold 1 can be referred to, and will not be repeated here.
[0197] It can also be understood that when the noise suppression module smoothes the data through a longer window, the influence of random errors caused by noise can be reduced, making the data in the window smoother and more consistent, and the noise reduction effect is better. When the noise suppression module smoothes the data through a shorter window, it can reduce random errors while retaining the original features of the data as much as possible to avoid the loss of the original features of the data, but the noise reduction effect is poorer than that of a longer window.
[0198] In the embodiment of the present application, because the voltage value set (voltage range 1) in the peak region of the electrical signal 3 contains the voltage value corresponding to the peak value (the peak value can be considered as the main characteristic point of the electrical signal), the noise suppression module needs to keep the main characteristic points of the electrical signal as much as possible when smoothing the voltage value set in the voltage range 1. And because step 312 is executed after the noise suppression judgment module in step 309 determines that the electrical signal 2 (the electrical signal 2 refers to the electrical signal that retains the main characteristic points in the electrical signal 1) is subject to strong noise interference, the noise suppression module also needs to perform noise reduction on the voltage set in the voltage range 1. Taking into account the above-mentioned two factors of needing to keep the main characteristic points of the electrical signal in the voltage range 1 as much as possible and performing noise reduction on the voltage range, the noise suppression module can smooth the voltage value set in the voltage range 1 through multiple windows of different lengths that gradually decrease over time, so that the main characteristic points of the electrical signal can be retained and a better noise reduction effect can be achieved.
[0199] In the implementation, the noise suppression module may smooth the voltage value set within the voltage range 1 through multiple windows of different lengths that gradually decrease over time (noise reduction strategy 1). The process may be: the noise suppression module calculates multiple voltage values within the voltage range 1 in the electrical signal 3 through the following formula to obtain the electrical signal 31:
[0200]
[0201] It refers to any one of the electrical signals 31 .
[0202] means iu The electrical signal at the time 3.
[0203] means i The electrical signal at the time 3.
[0204] means i+u The electrical signal at the time 3.
[0205] 2u+1 refers to the window length that decreases gradually over time, for example, u The value of can be [Q, ..., 4, 3, 2, 1, 0], where Q is a positive integer greater than 1. The embodiment of the present application does not limit the size of Q.
[0206] For example, please refer to Fig.14 , Fig.14 This is an example diagram provided by an embodiment of the present application of performing smoothing using a window whose length gradually decreases over time. Fig.14In the example, it is assumed that the voltage range 1 of the electrical signal 3 includes multiple voltage values {A1, A2, A3, A4, A5, A6, A7}, and the noise suppression module processes the above data through a window of length 7 during the first smoothing process. Then the data after the first processing is {A1, A2, A3, A8, A5, A6, A7}, where A8 = (A1 + A2 + A3 + A5 + A6 + A7) / 7. The noise suppression module processes the data after the first processing through a window of length 5 during the second smoothing process. Then the data after the second processing is {A1, A2, A3, A8, A9, A6, A7}, where A9 = (A3 + A8 + A5 + A6 + A7) / 5. The third smoothing process of the noise suppression module is to process the data after the second processing through a window of length 3, so the data after the third processing is {A1, A2, A3, A8, A9, A10, A7}, where A10 = (A9 + A6 + A7) / 3. The fourth smoothing process of the noise suppression module is to process the data after the third processing through a window of length 1, so the data after the fourth processing is {A1, A2, A3, A8, A9, A10, A7}. It should be noted that after the noise suppression module performs smoothing through a window of length 1, it stops smoothing the data within voltage range 1.
[0207] In an embodiment of the present application, in order to achieve a better noise reduction effect in the process of performing noise reduction processing on the voltage value set within the voltage range 2 (non-peak area), the noise suppression module may smooth the voltage value set within the voltage range 2 through multiple windows of different lengths that gradually increase over time to achieve a better noise reduction effect.
[0208] In the implementation, the noise suppression module may smooth the voltage value set within the voltage range 2 through multiple windows of different lengths that gradually decrease over time (noise reduction strategy 2). The process may be: the noise suppression module calculates multiple voltage values within the voltage range 2 in the electrical signal 3 through the following formula to obtain the electrical signal 32:
[0209]
[0210] It refers to any one of the electrical signals 32 .
[0211] means ij The electrical signal at the time 3.
[0212] means i The electrical signal at the time 3.
[0213] means i+j The electrical signal at the time 3.
[0214] 2 j +1 refers to the window length that gradually decreases over time, for example, j The value of can be [0, 1, 2, 3, 4, ..., Q], where Q is a positive integer greater than 1. The embodiment of the present application does not limit the size of Q.
[0215] For example, please refer to Fig.15 , Fig.15 This is an example diagram provided by an embodiment of the present application of performing smoothing using a window whose length gradually increases over time. Fig.15 In the example, it is assumed that the voltage range 2 of the electrical signal 3 includes multiple voltage values {B1, B2, B3, B4, B5, B6, B7}, and the noise suppression module processes the above data through a window of length 3 during the first smoothing process. Then the data after the first processing is {B1, B8, B3, B4, B5, B6, B7}, where B8=(B1+B2+B3) / 3. The noise suppression module processes the data after the first processing through a window of length 5 during the second smoothing process. Then the data after the second processing is {B1, B8, B9, B4, B5, B6, B7}, where B9=(B1 +B8+B9+B4+B5) / 5. The third smoothing process of the noise suppression module is to process the data after the second processing through a window of length 7. Then the data after the third processing is {B1, B8, B9, B10, B5, B6, B7}, where B10 = (B1+B8+B9+ B4+B5+B6+B7) / 7.
[0216] It should be understood that the above-mentioned multiple windows of different lengths are illustrated by taking the length as an odd number. In other embodiments, the length of the window may also be an even number, which is not limited in the embodiments of the present application.
[0217] It should also be understood that after the noise suppression module obtains the electrical signal 31 and the electrical signal 32 in the above manner, the combination of the electrical signal 31 and the electrical signal 32 can be used as the electrical signal 4, that is, the electrical signal 4 includes the electrical signal 31 and the electrical signal 32.
[0218] Step 313: The noise suppression module sends an electrical signal 4 to the high-pass filtering module A.
[0219] Step 314 : The high-pass filter module A performs filtering processing on the electrical signal 4 to obtain the electrical signal 5 .
[0220] It should be understood that the purpose of the high-pass filter module A to filter the electrical signal 4 is to remove the low-frequency noise in the electrical signal 4. The low-frequency noise may be the baseband drift. For the meaning of the baseband drift, please refer to the above embodiment and will not be repeated here. The frequency of the baseband drift is usually less than 1 Hz.
[0221] In one implementation, the high-pass filter module A can set the frequency threshold to a value C, and then the high-pass filter module A can retain the frequencies greater than the value C in the electrical signal 4 and remove the frequencies less than the value C, thereby obtaining the electrical signal 5. The value C is less than the value A. Exemplarily, the value C can be one of 0.5 Hz to 2 Hz, for example, the value C can be 0.67 Hz, 1 Hz, etc.
[0222] In another implementation, in order to simplify the calculation and ensure that the waveform is not deformed, the high-pass filter module A can first perform low-pass filtering on the electrical signal 4 to obtain the electrical signal 6, and then subtract the value of each data point in the electrical signal 4 from the value of the data point in the electrical signal 6 corresponding to each data point in the electrical signal 4 to obtain the electrical signal 5. For example, the electrical signal 4 includes data points 41 and 42, data point 41 is the voltage value at time point 1, and data point 42 is the voltage value at time point 2, and the electrical signal 6 includes data points 61 and 62, data point 61 is the voltage value at time point 1, and data point 62 is the voltage value at time point 2, then the electrical signal 5 may include data points 51 and 52, wherein data point 51 is obtained by subtracting the voltage value of data point 61 from the voltage value of data point 41, and data point 52 is obtained by subtracting the voltage value of data point 62 from the voltage value of data point 42. It should be understood that after the high-pass filter module A performs low-pass filtering on the electrical signal 4, the frequencies less than or equal to the value C in the electrical signal 4 can be retained, and the frequencies greater than the value C can be removed, thereby obtaining the electrical signal 6. The value C can be referred to the above embodiment, which will not be repeated here.
[0223] In some embodiments, before or after the high-pass filter module A performs filtering processing on the electrical signal 4 to obtain the electrical signal 5, or before or after the noise suppression module performs smoothing processing on the voltage set within the voltage range 1 and the voltage range 2 to obtain the electrical signal 4, the filtering module can also be used to remove intermediate frequency noise in the electrical signal. For example, the electrical signal may be interfered by power frequency noise, and the frequency of the power frequency noise is 50 Hz or 60 Hz. For ease of description, the power frequency noise is referred to as intermediate frequency noise in the embodiment of the present application. The embodiment of the present application does not limit the method for removing intermediate frequency noise.
[0224] Step 315: The high-pass filter module A returns the electrical signal 5 to the application layer through the service layer.
[0225] For example, assuming that the electrical signal is an ECG signal, the high-pass filter module A returns the electrical signal 5 to the application layer through the heart rate service in the service layer.
[0226] Step 316 , the application program in the application layer displays the electrical signal 5 .
[0227] For example, please refer to Fig.16 , Fig.16 is an example diagram of an electrical signal 5 and an electrical signal 1 provided in an embodiment of the present application. The electrical signal 1 refers to a signal that has not been subjected to noise reduction processing. Fig.16 It can be seen that the noise reduction effect of electrical signal 5 is significant compared with that of electrical signal 1, and the main feature points of electrical signal 1 are retained in electrical signal 5.
[0228] It should be noted that the above steps 301 to 316 can all process data in real time. For example, in the above step 304, each time the hardware layer detects an electrical signal, it reports the electrical signal to the low-pass filter module A and the low-pass filter module B. For another example, in the above step 312, after the noise suppression module receives each electrical signal 2 and an electrical signal 3, it determines the voltage threshold based on the electrical signal 2, and based on the voltage threshold, determines whether the electrical signal 3 belongs to the voltage range 1 or the voltage range 2, etc. Since the embodiment of the present application can process data in real time, the complexity of data calculation is reduced and the processing speed of data is increased.
[0229] In the embodiment of the present application, the electronic device can determine whether the electrical signal 2 (the electrical signal 2 includes the main characteristic points of the electrical signal 1) is subject to strong noise interference through the noise suppression module. When it is determined that the electrical signal 2 is not subject to strong noise interference, the electrical signal 3 is subjected to noise reduction processing through the high-pass filtering module A. The electrical signal 3 does not need to be input into the noise suppression module for noise reduction processing, which can reduce the calculation amount of the electronic device and save power consumption.
[0230] Moreover, when the electronic device determines through the noise suppression module that the electrical signal 2 is subject to strong noise interference, the noise suppression module can perform noise reduction processing on the strong noise existing in the electrical signal 3, and, in the process of noise reduction processing, the noise suppression module can determine multiple voltage thresholds based on the electrical signal 2, and based on each voltage threshold in the multiple voltage thresholds, determine a voltage range 1 in the electrical signal 3 that is greater than or equal to the voltage threshold and determine a voltage range 2 in the electrical signal 3 that is less than the voltage threshold, wherein the voltage value set in the voltage range 1 is used to indicate the voltage value set in the peak area, and the voltage value set in the voltage range 2 is used to indicate the voltage value set in the non-peak area. That is to say, the noise suppression module can determine the peak area and the non-peak area based on multiple voltage thresholds, compared with the related scheme through fixed voltage thresholds. The scheme for determining peak areas and non-peak areas may mistakenly determine the peak area as a non-peak area and cause misdetection due to the fact that the peak values of the electrical signals generated by the same user in different periods are different, or the peak values of the electrical signals generated by different users due to differences in their physical conditions, or the peak values of the electrical signals generated by the same user under different detection conditions are different. The embodiment of the present application can determine multiple voltage thresholds for electrical signals of various waveforms, and determine the peak area and non-peak area based on the multiple voltage thresholds. This can reduce the probability of misdetection and improve the accuracy of determining the peak area and non-peak area. The subsequent noise suppression module can achieve noise reduction based on the determined more accurate peak area and non-peak area, thereby improving the noise reduction effect.
[0231] Moreover, since when the data is smoothed through a window of a longer length, the influence of random errors caused by noise can be reduced, the data in the window is made smoother and more consistent, and the noise reduction effect is better. When the data is smoothed through a window of a shorter length, the original characteristics of the data can be retained as much as possible while reducing random errors to avoid the loss of the original characteristics of the data. However, the noise reduction effect is poorer than that of a window of a longer length. When performing noise reduction, the noise suppression module can smooth multiple voltage values within a voltage range 1 (the voltage range 1 includes a voltage value corresponding to a peak value, which is considered to be a main feature point of the electrical signal) through multiple windows of non-fixed lengths (the lengths of the multiple windows of non-fixed lengths gradually decrease over time). In this way, compared with the related scheme that does not perform noise reduction on the peak area with strong noise interference, the embodiment of the present application can retain the main feature points of the electrical signal, reduce the probability of distortion of the waveform of the electrical signal, and achieve better noise reduction effect. And the noise suppression module performs smoothing processing on multiple voltage values within the voltage range 2 through multiple windows of non-fixed lengths (the lengths of the multiple windows of non-fixed lengths gradually increase with time), which can achieve a better noise reduction effect.
[0232] The above embodiments are combined with Figures 12 to 16 The whole implementation process of the noise reduction method is introduced. Fig.12 The implementation process of step 309 in the noise reduction method shown is introduced.
[0233] Please refer to Fig.17 , Fig.17 is a timing diagram of the implementation process of step 309 provided in an embodiment of the present application. Fig.17 It can be seen that the electronic device executes Fig.12 The noise suppression judgment module of step 309 shown includes a high-pass filter module B, a peak detection module and a judgment module. Step 309 may also include steps 3091 to 3094.
[0234] Step 3091 , after receiving the electrical signal 2 , the high-pass filter module B performs filtering processing on the electrical signal 2 to obtain the electrical signal 21 .
[0235] It should be understood that the high-pass filter module B can remove the frequencies below the value D in the electrical signal 2 and retain the frequencies above the value D in the electrical signal 2. The function of the high-pass filter module B is to remove low-frequency noise in the electrical signal 2. For example, the low-frequency noise may be a baseband drift. For the meaning of the baseband drift, please refer to the above embodiment and will not be repeated here. The frequency of the baseband drift is usually less than 1 Hz.
[0236] In implementation, the value D may be one of 0.5 Hz to 2 Hz, such as 2 Hz. Then, the high-pass filter module B may remove the frequencies below 2 Hz in the electrical signal 2 and retain the frequencies above 2 Hz in the electrical signal 2.
[0237] Step 3092: The high-pass filter module B sends the electrical signal 21 to the peak detection module.
[0238] Step 3093: The peak detection module performs peak detection on the electrical signal 21 to obtain a plurality of peak data and a plurality of interval data.
[0239] It should be understood that the peak detection method may be a threshold method, a slope method, a maximum value method, etc., and the embodiment of the present application does not limit the peak detection method.
[0240] Exemplarily, assuming that the electrical signal is an ECG signal, then the multiple peak data refer to the voltage values of multiple R peaks, and the interval refers to the duration of the time interval between two adjacent R peaks. Assuming that the electrical signal is a PPG signal, then the multiple peak data refer to the voltage values of multiple main wave peaks, and the interval refers to the duration of the time interval between two adjacent main wave peaks. For example, the peak detection module performs peak detection on the electrical signal 21 to obtain 3 peak data, then the interval data refers to the interval duration between the two peak data in the 3 peak data, such as the interval duration between the first peak data and the second peak data, and the interval duration between the second peak data and the third peak data.
[0241] In the embodiment of the present application, after obtaining a plurality of peak data and a plurality of interval data, the peak detection module may input the plurality of peak data and the plurality of interval data into the judgment module, and the judgment module performs processing based on the above data.
[0242] In other embodiments, in order to reduce the amount of data processed by the judgment module, avoid the judgment module from blocking or crashing the program due to the excessive amount of data processed, and speed up the processing speed of the judgment module to process data, the peak detection module can store the peak data and the interval data in the buffer pool every time it detects a peak data and a detection data. After the buffer pool stores a preset number of peak data and interval data, the judgment module processes the preset number of peak data and interval data. For example, the preset number of peak data and interval data can be 5 peak data, 4 interval data, etc. The embodiment of the present application does not limit the size of the preset number.
[0243] After the judgment module processes the preset number of peak data and interval data, the buffer pool can clear the stored data, and the buffer pool continues to receive the data detected by the peak detection module. After the buffer pool stores the preset number of peak data and interval data again, the judgment module processes the preset number of peak data and interval data again until the peak detection module stops detecting. In this way, the judgment module can make judgments based on the segmented signals in the electrical signal 21 (for example, the preset number of peak data and interval data can be considered as one segment of signal). The segmented signal is smaller than the data volume of the electrical signal 21, which can speed up the processing speed of the judgment module and avoid program blocking or program crash.
[0244] Step 3094, the judgment module determines whether to perform noise reduction processing on the electrical signal 3 through the noise suppression module based on the multiple peak data, the multiple interval data and condition 1.
[0245] It should be understood that condition 1 refers to a condition for determining whether the electrical signal 21 is interfered by strong noise, which is generated by user movement, impedance generated by contact between the user's skin and the electronic device, and the like.
[0246] It should also be understood that condition 1 is obtained through testing of test data. For example, condition 1 can be that the average value of multiple peak data is greater than value 1, and the standard deviation of multiple interval data is less than value 2, and the standard deviation of multiple peak data is less than value 3 multiplied by the average value of multiple peak data. After testing and data analysis, it can be known that value 1 can be one of 0.2mV to 0.4mV, such as 0.3mV. Value 2 can be one of 40mS to 60mS, such as 50mS. Value 3 can be one of 0.04 to 0.06, such as 0.05.
[0247] In the implementation, the judgment module calculates the average value and standard deviation of multiple peak data, and calculates the standard deviation of multiple interval data, and substitutes the average value and standard deviation of multiple peak data, and the standard deviation of multiple interval data into the above condition 1. Assuming that condition 1 is not met, it is judged that the electrical signal 21 is subject to strong noise interference, and it is necessary to perform noise reduction processing on the electrical signal 3 through the noise suppression module. Assuming that condition 1 is met, it is judged that the electrical signal 21 is not subject to strong noise interference, and it is not necessary to perform noise reduction processing on the electrical signal 3 through the noise suppression module.
[0248] In some embodiments, the judgment module can judge whether each segmented signal is subject to strong noise interference based on the segmented signal in the electrical signal 21 (for example, a preset number of peak data and interval data can be considered as a segment signal). For example, after judging that the segment A signal is subject to strong noise interference, the electronic device performs noise reduction processing on the segment B signal in the electrical signal 3 (the segment B signal corresponds to the segment A signal) through the noise suppression module. After judging that the segment C signal is not subject to strong noise interference, the electronic device does not need to perform noise reduction processing on the segment D signal in the electrical signal 3 (the segment D signal corresponds to the segment C signal) through the noise suppression module. For example, please refer to Fig.18 , Fig.18 This is an example diagram of segmented processing of an electrical signal provided in an embodiment of the present application. Fig.18 ECG1 in the above embodiment refers to the multiple voltage values of 0 to 70 mS detected by step 304 in the above embodiment. ECG2 is obtained by step 306 in the above embodiment, ECG21 is obtained by step 3091, and ECG3 is obtained by step 307 in the above embodiment. Assume that the A segment signal of ECG21 is determined by step 3094 ( Fig.17 After the signal within 0 to 45mS in ECG21 is interfered by strong noise, the electronic device uses the noise suppression module to suppress the B segment signal in ECG3 ( Fig.17 The signal within 0 to 45 mS in ECG3 shown in FIG. 30 is subjected to noise reduction processing. Assume that the C segment signal of ECG21 ( Fig.18After the signal within 45 to 70mS in ECG21 shown in the figure is not interfered by strong noise, the electronic device does not need to use the noise suppression module to suppress the D segment signal in ECG3 ( Fig.18 The signal within 45 to 70 mS in ECG3 is shown to be subjected to noise reduction processing.
[0249] In an embodiment of the present application, the peak detection module can perform peak detection on the electrical signal 21 to obtain multiple peak data and multiple interval data. The judgment module can accurately determine whether to perform noise reduction processing through the noise suppression module based on the multiple peak data, multiple interval data and condition 1.
[0250] Moreover, the judgment module can also determine whether to perform noise reduction processing through the noise suppression module based on a preset number of peak data and a preset number of interval data. After determining whether to perform noise reduction processing through the noise suppression module based on a preset number of peak data and a preset number of interval data, it can again determine whether to perform noise reduction processing through the noise suppression module based on a preset number of peak data and a preset number of interval data until the peak detection module stops detecting. In this way, the judgment module can make judgments based on the segmented signals in the electrical signal 21 (for example, the preset number of peak data and interval data can be considered as one segment of the signal). The segmented signal has a smaller data volume than the electrical signal 21, which can speed up the processing speed of the judgment module and avoid program blocking or program crash.
[0251] The above embodiments are combined with Fig.17 and Fig.18 The implementation process of step 309 in the noise reduction method is introduced. Fig.12 Step 312 in the noise reduction method shown is introduced.
[0252] Please refer to Fig.19 , Fig.19 is a timing diagram of the implementation process of step 312 provided in an embodiment of the present application. Fig.19 It can be seen that the electronic device executes Fig.12 The noise suppression module of step 312 shown also includes a signal enhancement module, a threshold calculation module and a suppression module. Step 312 may also include steps 3121 to 3127.
[0253] Step 3121 , after receiving the electrical signal 2 , the signal enhancement module performs differential processing on the electrical signal 2 to obtain the electrical signal 22 .
[0254] It should be understood that the purpose of the signal enhancement module performing differential processing on the electrical signal 2 is to reduce the irregular fluctuations between the various data in the electrical signal 2 and make the fluctuation curve of the waveform of the electrical signal 2 more stable. At the same time, performing differential processing on the electrical signal can also remove some mutation noise mixed in the electrical signal 2.
[0255] In implementation, the signal enhancement module can perform differential processing on the electrical signal 2 by subtracting the i-1th voltage value from the i-th voltage value to obtain the electrical signal 22, where i is an integer greater than 1. The embodiment of the present application does not limit the differential processing method. For example, please refer to Fig. 20 , Fig. 20 This is an example diagram of a data processing process within a signal enhancement module provided in an embodiment of the present application. Fig. 20 The electrical signal 2 shown in (a) includes 7 voltage values from C1 to C7. The signal enhancement module performs differential processing on the electrical signal 2, and the obtained electrical signal 22 includes 6 voltage values from C8 to C13, among which C8=C2-C1, C9=C3-C2, C10=C4-C3, C11=C5-C4, C12=C6-C5, and C13=C7-C6.
[0256] In other embodiments, the electrical signal 22 may be called a differential signal and may be represented by the symbol ECGDiff.
[0257] In step 3122, the signal enhancement module marks each voltage value in the electrical signal 22 to obtain a noise mark.
[0258] It should be understood that Fig.19 The steps in Fig.17 Step 3094 is executed after determining that electrical signal 21 is subject to strong noise interference, and electrical signal 21 is obtained based on electrical signal 2. Therefore, it can be inferred that electrical signal 2 is subject to strong noise interference. Although the sudden noise in electrical signal 2 can be removed by step 3121, medium and high frequency noise is still mixed in electrical signal 2. Therefore, data points that obviously belong to medium and high frequency noise can be marked by step 3122, which can facilitate subsequent data processing.
[0259] In the implementation, after obtaining the electrical signal 22 through step 3121, the signal enhancement module can determine whether each voltage value in the electrical signal 22 satisfies condition 2. Assuming that condition 2 is satisfied, the voltage value satisfying condition 2 is marked as noise, for example, the signal enhancement module sets the noise flag (Noise Flag) to 1. Assuming that condition 2 is not satisfied, the voltage value not satisfying condition 2 is marked as non-noise, for example, the Noise Flag is set to 0.
[0260] It should be understood that condition 2 can be a condition obtained by testing the test data for determining whether the data is noise. For example, condition 2 can be that the absolute value of the voltage value is greater than value 4. After testing and data analysis, it can be known that data 4 can be one of 4mV to 6mV, for example, value 4 can be 5mV.
[0261] Step 3123 , the signal enhancement module squares each voltage value in the electrical signal 22 to obtain the electrical signal 23 .
[0262] It should be understood that the squaring process is to increase the value of each voltage value in the electrical signal 22 to facilitate subsequent data processing. In implementation, for example, Fig. 20 As shown in (a) in FIG. 2 , the signal enhancement module performs square processing on each voltage value in the electrical signal 22 to obtain an electrical signal 23 .
[0263] In some embodiments, the electrical signal 23 may be referred to as a squared signal and may be represented by the symbol ECGSquare.
[0264] Step 3124 , the signal enhancement module performs sliding average processing on the electrical signal 23 to obtain the electrical signal 24 .
[0265] It should be understood that the purpose of the signal enhancement module performing sliding average processing on the electrical signal 23 to obtain the electrical signal 24 is to determine the peak area and non-peak area in the electrical signal 3 by combining the electrical signal 24 and the electrical signal 25 obtained by the signal enhancement module performing exponential sliding processing on the electrical signal 24 in step 3125, and the peak area and non-peak area can be determined more accurately compared to the related scheme. The reason why the peak area and non-peak area can be more accurately determined by combining the electrical signal 24 and the electrical signal 25 is stated in the following embodiments and will not be repeated here.
[0266] In implementation, the signal enhancement module may perform sliding average processing on the electrical signal 23 through multiple windows of fixed length to obtain the electrical signal 24. For example, the implementation process may be: the signal enhancement module calculates multiple voltage values in the electrical signal 23 through the following formula to obtain the electrical signal 24:
[0267]
[0268] Refers to one of the electrical signals 24 .
[0269] means ij The electrical signal 23 at the time.
[0270] means i The electrical signal 23 at the time.
[0271] means i+j The electrical signal 23 at the time.
[0272] 2 j +1 refers to a fixed window length, for example, 2 j+1 can be a range from 100mS to 300mS, such as 200mS. The embodiment of the present application does not limit the window length.
[0273] For example, please refer to Fig. 20 In (b), assuming that the signal enhancement module performs sliding average processing on the electrical signal 23 through a fixed window of length 3, during the processing, the signal enhancement module needs to wait for the window to be filled with data before starting processing. For example, when window A includes the 1st to 3rd data of the electrical signal 23, the above three data are substituted into the above formula to obtain the second data C14 of the electrical signal 24. When window B includes the 2nd to 4th data of the electrical signal 23, the above three data are substituted into the above formula to obtain the third data C15 of the electrical signal 24. When window C includes the 3rd to 5th data of the electrical signal 23, the above three data are substituted into the above formula to obtain the fourth data C16 of the electrical signal 24. When window D includes the 4th to 6th data of the electrical signal 23, the above three data are substituted into the above formula to obtain the fourth data C17 of the electrical signal 24, where. When window E is not filled with data, the sliding average processing is stopped to obtain the electrical signal 24.
[0274] The electrical signal 24 includes the following data:
[0275]
[0276]
[0277] In some embodiments, the electrical signal 24 may be referred to as an enhanced signal and may be represented by the symbol ECGMov. The sliding average process may be referred to as a simple sliding average process or the like.
[0278] Step 3125 , the signal enhancement module performs exponential sliding processing on the electrical signal 24 to obtain the electrical signal 25 .
[0279] In implementation, the signal enhancement module may perform exponential sliding processing on the electrical signal 24 by the following formula to obtain the electrical signal 25:
[0280] The electrical signal 25 (i) = the electrical signal 24 (i) × K + the electrical signal 25 (i-1) × (1-K).
[0281] The electrical signal 25 (i) refers to a signal in the electrical signal 25. K refers to a weight coefficient. After testing and data analysis, K can be a value between 0.5 and 0.9, for example, K is 0.9. The electrical signal 25 (i-1) refers to the previous signal of the electrical signal 25 (i).
[0282] For example, please refer to Fig. 20 In (c), when the signal enhancement module performs exponential sliding processing on the electrical signal 24, the first data in the electrical signal 24 can be As the first data in the electrical signal 25, the first data in the electrical signal 25 and the second data C14 in the electrical signal 24 are substituted into the above formula to obtain the second data C19 in the electrical signal 25. Then the second data in the electrical signal 25 and the third data C15 in the electrical signal 24 are substituted into the above formula to obtain the third data C20 in the electrical signal 25. In this way, the electrical signal 25 can be obtained. The data in the electrical signal 25 includes , C19, C20, C21, C22, C23.
[0283] In some embodiments, the electrical signal 25 may be referred to as a smoothed signal and may be represented by the symbol ECGMovFilt. The exponential sliding process may be referred to as an exponential sliding average process or the like.
[0284] Please refer to Fig.21 , Fig.21 is an example diagram of a waveform of an electrical signal provided in an embodiment of the present application. Fig.21 (a) in the figure is the waveform of the electrical signal 2. Fig.21 (b) in FIG. 2 is the waveform of the electrical signal 22. Fig.21 (c) in FIG. 2 is the waveform of the electrical signal 23. Fig.21 (d) in FIG. 2 is the waveform of the electrical signal 24. Fig.21 (e) in FIG. 2 is the waveform of the electrical signal 25 .
[0285] It should be noted that the above steps 3121 to 3125 can all process the data in real time. For example, in step 3121, after the signal enhancement module receives each signal, it can perform differential processing on the signal to obtain the differential signal of the signal. Then, the differential signal of the signal is marked through step 3122 to obtain the noise mark of the signal. Then, the signal is squared through step 3123 to obtain the squared signal of the signal. Then, the squared signal is subjected to sliding average processing through step 3124 to obtain the enhanced signal of the signal. Then, the enhanced signal is subjected to exponential sliding processing through step 3125 to obtain the smoothed signal of the signal.
[0286] Step 3126 , the signal enhancement module sends the noise mark, the electrical signal 24 , and the electrical signal 25 to the threshold calculation module.
[0287] In the implementation, after the signal enhancement module obtains the noise mark, enhanced signal and smoothed signal of a signal, it sends the noise mark, enhanced signal (electrical signal 24) and smoothed signal (electrical signal 24) of the signal to the threshold calculation module.
[0288] In step 3127 , the threshold calculation module determines a plurality of voltage thresholds based on the noise marker, the electrical signal 24 , and the electrical signal 25 .
[0289] The implementation process of determining multiple voltage thresholds can be referred to the following embodiments, which will not be described in detail here.
[0290] In step 3128, the threshold calculation module sends multiple voltage thresholds to the suppression module.
[0291] Step 3129, the suppression module determines the voltage range 1 and the voltage range 2 in the electrical signal 3 based on each voltage threshold in the multiple voltage thresholds, and smoothes the multiple voltage values in the voltage range 1 through multiple windows of non-fixed lengths (the lengths of the multiple windows of non-fixed lengths gradually decrease over time), and smoothes the multiple voltage values in the voltage range 2 through multiple windows of non-fixed lengths (the lengths of the multiple windows of non-fixed lengths gradually increase over time), to obtain the electrical signal 4.
[0292] The implementation method of step 3129 can refer to the implementation method of step 312 in the above embodiment, which will not be repeated here.
[0293] The above embodiments are combined with Figures 19 to 21 The implementation process of step 312 in the noise reduction method is introduced. Fig.19 The detailed implementation process of step 3127 is introduced.
[0294] Step 3127 is a step in which the threshold calculation module determines a plurality of voltage thresholds based on the noise marker, the electrical signal 24 and the electrical signal 25 .
[0295] It should be understood that electrical signal 24 and electrical signal 25 are obtained based on electrical signal 2 (the process of obtaining electrical signal 24 and electrical signal 25 through electrical signal 2 can refer to the above embodiment), and electrical signal 2 is obtained based on electrical signal 1 (the process of obtaining electrical signal 2 through electrical signal 1 can refer to the above embodiment). The reason why the embodiment of the present application determines multiple voltage thresholds in combination with electrical signal 24 and electrical signal 25 is that the tester obtains multiple groups of electrical signals 24 and electrical signals 25 by calculating a large amount of test data. After data analysis of the multiple groups of electrical signals 24 and electrical signals 25, it is found that electrical signals 24 and electrical signals 25 have the following characteristics in terms of values: in the peak area of electrical signal 1 (the definition of the peak area can refer to the above embodiment), the value of electrical signal 24 is greater than or equal to the value of electrical signal 25. In the non-peak area of electrical signal 1, the value of electrical signal 24 is less than the value of electrical signal 25. Therefore, the threshold calculation module can determine the voltage threshold based on the above characteristics, so that the voltage threshold can be used as a critical point to distinguish the peak area and the non-peak area, ensuring that the value of the electrical signal 24 in the voltage value set in the peak area is greater than or equal to the value of the electrical signal 25, and ensuring that the value of the electrical signal 24 in the non-peak area is less than the value of the electrical signal 25.
[0296] In implementation, the threshold calculation module may determine multiple voltage thresholds by the following steps:
[0297] It should be noted that the threshold calculation module can process the data sent by the signal enhancement module in real time, that is, after the signal enhancement module obtains the noise mark, enhanced signal and smoothed signal of a signal, the threshold calculation module determines the voltage threshold based on the noise mark, enhanced signal and smoothed signal of the signal. For ease of description, the noise mark, enhanced signal and smoothed signal of a signal are referred to as a set of data in the subsequent embodiments.
[0298] For example, please refer to Fig. 22 , Fig. 22 It is a schematic flowchart of determining multiple voltage thresholds provided in an embodiment of the present application. Fig. 22 The method comprises steps A and E.
[0299] Step A, receiving the i-th group of data.
[0300] It should be understood that the i-th group of data refers to any group of data among multiple groups of data received by the threshold calculation module within the duration 1. i is an integer greater than 0.
[0301] Step B: The threshold calculation module determines whether the noise flag of the i-th group of data received within the duration 1 is 1.
[0302] Step C: when it is determined that the noise mark of the i-th group of data is 1, re-determine whether the noise mark of the data received within the duration 1 is 1, until it is determined that the noise marks of multiple groups of data received within the duration 1 are all 0.
[0303] It should be understood that the purpose of steps B and C is that the electrical signal initially received by the threshold calculation module is unstable, and the noise in the unstable stage can be eliminated by the noise marker to prevent the noise from affecting the subsequent determination of the voltage threshold.
[0304] In the implementation, the threshold calculation module can set a timer, and after receiving the first group of data, start the timer to start the countdown. For example, the duration set in the timer is duration 1, and duration 1 can be 0.4 seconds to 0.6 seconds, such as 0.5 seconds. Then, after the threshold calculation module starts the timer, the timer starts to count down for 0.5 seconds. Assuming that before the timer ends, the threshold calculation module determines that the noise mark of the received i-th group of data (such as the fifth group of data) is 1, then the threshold calculation module resets the timer, and the timer starts counting down again, for example, the timer counts down again for 0.5 seconds. Assuming that before the timer ends, the threshold calculation module determines that the noise marks of the received multiple groups of data are not 0, then after the timer ends, the threshold calculation module starts to execute subsequent steps.
[0305] Step D: After the timer ends, the threshold calculation module initializes the threshold and threshold parameters.
[0306] It should be understood that the threshold parameters include the threshold update status (UpdateFlag), the peak value (PeakData) of the electrical signal 24, in mV, the baseline value (BaseData) of the threshold, in mV, the reference value (ReferData) of the threshold, in mV, and the rising branch count value (UpCount) in the waveform of the electrical signal 25. Among them, UpdateFlag represents whether the threshold is updated. The value of UpdateFlag can be 0 or 1. When UpdateFlag is 0, it means that the threshold needs to be updated. When UpdateFlag is 1, it means that the threshold does not need to be updated. PeakData refers to the maximum voltage value in the electrical signal 24 within a heartbeat or pulse cycle. For example, please refer to Fig.23 , Fig.23 is an example diagram of the waveform of an electrical signal 24 and an electrical signal 25 provided in an embodiment of the present application. PeakData can be Fig.23 BaseData refers to the voltage value of the intersection of the rising branch of the electrical signal 24 and the electrical signal 25. For example, BaseData can be Fig.23ReferData refers to the voltage value of the intersection of the electrical signal 24 and the descending branch of the electrical signal 25. For example, ReferData can be Fig.23 The voltage values of R1, R2 and R3 are shown. UpCount refers to the count value of the rising branch in the waveform of the electrical signal 25. The rising branch can refer to Fig.23 For example, U1 includes 5 data in total. Then, the data received by the threshold calculation module is the 4th data among the 5 data. Then the count value of the UpCount is 4. The value of the DownCount can be referred to Fig.23 D1 and D2 are shown in FIG.
[0307] In the implementation, after the timer ends, the threshold calculation module can set UpdateFlag to 0, PeakData to 0, BaseData to 0, and ReferData to a value of 5 (the value 5 is obtained by the tester based on experience and data analysis, and the embodiment of the present application does not limit the size of the value 5. For example, the value 5 can be 1.5 times the voltage value of the first electrical signal 24 received by the threshold calculation module after the timer ends), and set UpCount to 0 to initialize the threshold parameters. The threshold calculation module can also set an initial threshold after the timer ends to initialize the threshold. It should be understood that the initial threshold can be set based on test data and data analysis, and the embodiment of the present application does not limit the size of the initial threshold.
[0308] Step E: After initializing the threshold value and the threshold value parameter, the threshold value calculation module continues to receive the i-th group of data, and determines a threshold value based on the i-th group of data to obtain multiple threshold values.
[0309] It should be understood that the i-th group of data refers to any one of the multiple groups of data received by the threshold calculation module after the timer ends and after initialization, each group of data includes the electrical signal 24, the electrical signal 25 and the noise mark. m is an integer greater than 0.
[0310] In implementation, for example, please refer to Fig.24 , Fig.24 It is a schematic flow chart of a step E provided in an embodiment of the present application. Step E includes steps E1 to E17.
[0311] Step E1: After initializing the threshold value and the threshold value parameter, the threshold value calculation module receives the i-th group of data.
[0312] It should be understood that the i-th group of data in this embodiment is a group of data received by the threshold calculation module after the threshold and threshold parameters are initialized.
[0313] Step E2: the threshold calculation module determines whether the noise flag of the i-th group of data is 1.
[0314] Step E3: If the threshold calculation module determines that the noise flag of the i-th group of data is 1, the threshold parameter and the threshold are not updated.
[0315] It should be understood that the noise mark is marked through step 2122 in the above embodiment. It can be seen from step 2122 that when noise marking is performed, data points that obviously belong to medium and high frequency noise are marked as 1. Therefore, when the noise mark of the i-th group of data is determined to be 1 in step E3, it proves that medium and high frequency noise exists in the i-th group of data. In order to avoid the influence of medium and high frequency noise on the subsequent determination of the threshold, step E3 does not update the threshold parameters and thresholds.
[0316] Step E4: if the threshold calculation module determines that the noise mark of the i-th group of data is 0, it is determined whether the voltage value of the electrical signal 24 in the i-th group of data is greater than the voltage value of the electrical signal 25 .
[0317] Step E5: if the threshold calculation module determines that the voltage value of the electrical signal 24 in the i-th group of data is greater than the voltage value of the electrical signal 25, the threshold parameter of the i-th group of data is updated.
[0318] In the implementation, when the voltage value of the electric signal 24 in the i-th group of data is greater than the voltage value of the electric signal 25, the UpdateFlag in the threshold parameter is set to 1, the PeakData is set to the voltage value of the electric signal 24 in the i-th group of data, and the data in the UpCount is increased by 1. It should be understood that the values of BaseData and ReferData will not be updated when the voltage value of the electric signal 24 in the i-th group of data is greater than the voltage value of the electric signal 25, and will be updated only when the voltage value of the electric signal 24 in the i-th group of data is equal to the voltage value of the electric signal 25. The process of updating the values of BaseData and ReferData by the threshold calculation module is as follows: if the threshold calculation module determines that the voltage value of the electrical signal 24 in the i-th group of data is equal to the voltage value of the electrical signal 25, the threshold calculation module determines whether the voltage values of the electrical signal 25 of the first few groups of data of the i-th group of data (including the i-th group of data) gradually increase or decrease over time. If it is determined that the voltage value of the electrical signal 25 gradually increases over time, the voltage value of the electrical signal 25 in the i-th group of data (this voltage value is equal to the voltage value of the electrical signal 24 in the i-th group of data, and this voltage value can be considered as the voltage value of the intersection of the descending branch of the electrical signal 24 and the electrical signal 25) is used as ReferData. Before the subsequent threshold calculation module receives that the voltage value of the electrical signal 24 in a group of data is equal to the voltage value of the electrical signal 25, ReferData is no longer updated. If it is determined that the voltage value of the electrical signal 25 is gradually decreasing, the voltage value of the electrical signal 25 in the i-th group of data (this voltage value is equal to the voltage value of the electrical signal 24 in the i-th group of data, and this voltage value can be considered as the voltage value of the intersection of the electrical signal 24 and the rising branch of the electrical signal 25) is used as BaseData. Before the subsequent threshold calculation module receives a group of data in which the voltage value of the electrical signal 24 is equal to the voltage value of the electrical signal 25, the BaseData is no longer updated.
[0319] For example, please refer to Table 1:
[0320] Table 1
[0321]
[0322] Table 1 shows multiple groups of data that the threshold calculation module will receive in step E. The time in Table 1 is the time when the threshold calculation module receives each group of data. For example, when the threshold calculation module receives the first group of data (the voltage value of the electrical signal 24 is 22mV, and the voltage value of the electrical signal 25 is 10mV), the current threshold parameter of this group of data is the threshold parameter initialized by the above step B, and the current threshold of this group of data is the threshold initialized by the above step B. After the threshold calculation module determines that the voltage value of the electrical signal 24 in the first group of data is greater than the voltage value of the electrical signal 25, the threshold calculation module updates the value of UpdateFlag in the current threshold parameter from 0 to 1, updates the value of PeakData from 0 to 22, updates UpCount from 0 to 1, the value of BaseData is 0, and the value of ReferData is 5. From the above, it can be seen that the threshold calculation module does not update BaseData and ReferData for the following reasons: when the threshold calculation module receives the first group of data, the voltage value of the electrical signal 24 in the first group of data is not equal to the voltage value of the electrical signal 25. Then the threshold calculation module can determine that the first group of data is not the intersection of the rising branch or the falling branch of the electrical signal 24 and the electrical signal 25, so BaseData and ReferData are not updated.
[0323] For another example, when the threshold calculation module receives the second group of data (the voltage value of the electrical signal 24 is 24mV, and the voltage value of the electrical signal 25 is 11mV), the current threshold parameter of the group of data is the threshold parameter of the first group of data, and the current threshold of the group of data is the threshold of the first group of data. After the threshold calculation module determines that the voltage value of the electrical signal 24 in the second group of data is greater than the voltage value of the electrical signal 25, the threshold calculation module sets the value of UpdateFlag in the current threshold parameter to 1, updates the value of PeakData from 22 to 24, updates UpCount from 1 to 2, the value of BaseData is 0, and the value of ReferData is 5. As can be seen from the above, the threshold calculation module does not update BaseData and ReferData. The reasons for not updating BaseData and ReferData can be referred to the above embodiments, which will not be repeated here.
[0324] For another example, when the threshold calculation module receives the 7th group of data (the voltage value of the electrical signal 24 is 15mV, and the voltage value of the electrical signal 25 is 13mV), the current threshold parameter of the group of data is the threshold parameter of the 6th group of data, and the current threshold of the group of data is the threshold of the 6th group of data. After the threshold calculation module determines that the voltage value of the electrical signal 24 in the 7th group of data is greater than the voltage value of the electrical signal 25, the threshold calculation module sets the value of UpdateFlag in the current threshold parameter to 1, the value of PeakData to 15, the value of UpCount to 1, the value of BaseData to 12, and the value of ReferData to 16. As can be seen from the above, the threshold calculation module updates BaseData and ReferData.
[0325] The reason why the threshold calculation module updates ReferData is that before the threshold calculation module receives the 7th group of data, the threshold calculation module first receives the 1st to 6th groups of data, wherein, when processing the 3rd group of data, the threshold calculation module determines that the voltage value of the electrical signal 24 in the 3rd group of data is equal to the voltage value of the electrical signal 25 (the voltage value of the electrical signal 24 in the 3rd group of data is 16 mV, and the voltage value of the electrical signal 25 is 16 mV), and then the threshold calculation module determines that the voltage value of the electrical signal 25 gradually increases with time based on the first few groups of data of the 3rd group of data (including the 3rd group of data) (for example, the voltage value of the electrical signal 25 in the 1st group of data is 10 mV, the voltage value of the electrical signal 25 in the 2nd group of data is 11 mV, and the voltage value of the electrical signal 25 in the 3rd group of data is 16 mV, and the voltage value of the electrical signal 25 gradually increases with time), then, the threshold calculation module uses the voltage value (16 mV) of the electrical signal 25 in the 3rd group of data as the value of ReferData. When the threshold calculation module continues to receive subsequent data, if the subsequent data does not meet the above-mentioned conditions for updating ReferData, the threshold calculation module continues to use the voltage value (16mV) of the electrical signal 25 in the third group of data as the value of ReferData, and does not update the value of ReferData. For example, the seventh group of data received by the threshold calculation module does not meet the above-mentioned conditions for updating ReferData, so the threshold calculation module sets the ReferData value in the threshold parameter corresponding to the seventh group of data to the voltage value (16mV) of the electrical signal 25 in the third group of data.
[0326] The reason why the threshold calculation module updates PeakData is that before the threshold calculation module receives the 7th group of data, the threshold calculation module first receives the 1st to 6th groups of data, wherein, when processing the 6th group of data, the threshold calculation module determines that the voltage value of the electrical signal 24 in the 6th group of data is equal to the voltage value of the electrical signal 25 (the voltage value of the electrical signal 24 in the 6th group of data is 12 mV, and the voltage value of the electrical signal 25 is 12 mV), and then the threshold calculation module determines that the voltage value of the electrical signal 25 gradually decreases according to the first few groups of data of the 6th group of data (including the 6th group of data) (for example, the voltage value of the electrical signal 25 in the 4th group of data is 15 mV, the voltage value of the electrical signal 25 in the 5th group of data is 14 mV, and the voltage value of the electrical signal 25 in the 6th group of data is 12 mV, and the voltage value of the electrical signal 25 gradually decreases), then, the threshold calculation module uses the voltage value (12 mV) of the electrical signal 25 in the 6th group of data as the value of PeakData. When the threshold calculation module continues to receive subsequent data, if the subsequent data does not meet the above-mentioned condition for updating PeakData, the threshold calculation module continues to use the voltage value (12mV) of the electrical signal 25 in the sixth group of data as the value of PeakData, and does not update the value of PeakData. For example, the seventh group of data received by the threshold calculation module does not meet the above-mentioned condition for updating PeakData, and therefore, the threshold calculation module sets the PeakData value in the threshold parameter corresponding to the seventh group of data to the voltage value (12mV) of the electrical signal 25 in the sixth group of data.
[0327] Step E6: after updating the threshold parameter, the threshold calculation module determines whether the current threshold of the i-th group of data satisfies condition A.
[0328] It should be understood that condition A is obtained based on test data and data analysis, and is used to accurately determine the conditions of the peak area and the non-peak area when the voltage value of the electrical signal 24 in the i-th group of data is greater than the voltage value of the electrical signal 25 (for example, the i-th group of data can be any group of data in time period 1, time period 3, and time period 5 shown in Table 1). For example, condition A can be that the current threshold is less than the voltage value of the electrical signal 25 in the i-th group of data.
[0329] For example, please refer to Table 1. After the threshold calculation module receives the first group of data, the current threshold of the first group of data is the initial threshold. Then the threshold calculation module determines whether the threshold of the first group of data (such as the initial threshold) is less than the voltage value (10mV) of the electrical signal 25 in the first group of data. Assuming that the threshold calculation module determines that the current threshold of the first group of data is less than 10mV, the threshold calculation module executes step E7 to update the current threshold from the initial threshold to 10mV (Table 1 is an example of the current threshold of the first group of data satisfying condition A). Assuming that the threshold calculation module determines that the initial threshold of the first group of data is greater than or equal to 10mV, the threshold calculation module executes step E8.
[0330] For another example, please refer to Table 1. After the threshold calculation module updates the threshold of the first group of data to 10mV, the threshold calculation module receives the second group of data. At this time, the current threshold of the second group of data is 10mV. The threshold calculation module determines whether the current threshold of the second group of data is less than the voltage value (11mV) of the electrical signal 25 in the second group of data. Assuming that the current threshold of the second group of data is less than 11mV, the threshold calculation module executes step E7 to update the current threshold of the second group of data from 10mV to 11mV (Table 1 is an example of the current threshold of the second group of data satisfying condition A). Assuming that the current threshold of the second group of data is greater than or equal to 11mV, the threshold calculation module executes step E8.
[0331] The process of the threshold calculation module processing other groups of data (the voltage value of the electrical signal 24 in the other groups of data is greater than the voltage value of the electrical signal 25) through step E6 can refer to the above embodiment and will not be repeated here.
[0332] Step E7: if it is determined that the current threshold value of the i-th group of data satisfies condition A, the current threshold value of the i-th group of data is updated to the voltage value of the electrical signal 25 in the i-th group of data.
[0333] Step E8: If it is determined that the current threshold value of the i-th group of data does not satisfy condition A, then determine whether the current threshold value parameter of the i-th group of data satisfies condition B.
[0334] It should be understood that condition B is obtained based on test data and data analysis. The effect of condition B is: when the i-th group of data is data near the intersection of the electrical signal 24 and the electrical signal 25 (for example, the i-th group of data is Fig.23In the waveform diagram shown, for data near the right side of point E1, when the voltage value of the electrical signal 24 of the data is greater than the voltage value of the electrical signal 25, the value of the current threshold of the i-th group of data may be relatively large. Using the current threshold to determine the peak area or the non-peak area may result in the peak area being mistakenly determined as the non-peak area, or the non-peak area being mistakenly determined as the peak area, resulting in false detection. In this case, the value of the current threshold is lowered to ensure that the current threshold can accurately determine the peak area or the non-peak area, thereby avoiding false detection.
[0335] For example, condition B may be that the baseline value in the current threshold parameter of the i-th group of data is greater than 0, and the rising branch count value is greater than the value 6 (the value 6 is obtained based on the test data and data analysis, and the embodiment of the present application does not limit the size of the value 6), and the difference between the voltage value of the electrical signal 25 in the i-th group of data and the baseline value in the threshold parameter of the i-th group of data is greater than the value 7 (the value 7 is obtained based on the test data and data analysis, and the embodiment of the present application does not limit the size of the value 7).
[0336] In the implementation, for example, please refer to Table 1. After the threshold calculation module receives the 7th group of data, the current threshold of the 7th group of data is the threshold of the 6th group of data before it is updated (for example, the threshold of the 6th group of data shown in Table 1 is 16mV). The threshold calculation module determines that the current threshold of the 7th group of data is greater than the voltage value of the electrical signal 25 within the 7th group of values (the voltage value of the electrical signal 25 within the 7th group of data shown in Table 1 is 13mV), and does not meet condition A (condition A means that the current threshold of the 7th group of data is less than the voltage value of the electrical signal 25 within the 7th group of values). Then the threshold calculation module determines whether the threshold parameter of the 7th group of data meets condition B. When condition B is met, the threshold calculation module executes step E9. When condition B is not met, the threshold calculation module executes step E10.
[0337] For example, Table 1 is an example of the threshold parameter of the 7th group of data satisfying condition B. In Table 1, after the threshold calculation module receives the 7th group of data, the threshold update state in the current threshold parameter of the 7th group of data is obtained through step E5 as 1, the peak value is 15 mV, the baseline value is 12 mV, the reference value is 16 mV, and the rising branch count value is 1. Therefore, the threshold calculation module determines that the baseline value (12mV) in the current threshold parameter of the 7th group of data is greater than 0, and the rising branch count value (1) is greater than the value 6 (assuming that the value 6 is 0), and the difference (13mV-12mV=1mV) between the voltage value (13mV) of the electrical signal 25 in the 7th group of data and the baseline value (12mV) in the threshold parameter of the 7th group of data is greater than the value 7 (assuming that the value 7 is 0), then the threshold calculation module updates the current threshold value of the 7th group of data (the current threshold value is the threshold value 16mV of the 6th group of data shown in Table 1) to the voltage value (13mV) of the electrical signal 25 in the 7th group of data.
[0338] Step E9: if it is determined that the threshold parameter of the i-th group of data satisfies condition B, the current threshold of the i-th group of data is updated to the voltage value of the electrical signal 25 in the i-th group of data.
[0339] Step E10: If it is determined that the threshold parameter of the i-th group of data does not satisfy condition B, then determine whether the current threshold parameter of the i-th group of data satisfies condition C.
[0340] It should be understood that condition C is obtained based on test data and data analysis. The function of condition C is: when the i-th group of data is the data just received by the threshold calculation module (for example Fig.23 In the waveform diagram shown, in the data just received by the threshold calculation module (data in time period 1), the voltage value of the electrical signal 24 is greater than the voltage value of the electrical signal 25). The value of the current threshold of the i-th group of data may be relatively large. Using the current threshold to determine the peak area or the non-peak area may result in the peak area being mistakenly determined as the non-peak area, or the non-peak area being mistakenly determined as the peak area. In the event of misdetection, the value of the current threshold is reduced to ensure that the current threshold can accurately determine the peak area or the non-peak area, thereby avoiding misdetection.
[0341] For example, condition C may be that the reference value of the current threshold parameter of the i-th group of data is greater than 0, and the rising branch count value is greater than the value 6 (the meaning of the value 6 has been stated in the above condition B and will not be repeated here), and the difference between the voltage value of the electrical signal 24 of the i-th group of data and the reference value of the threshold parameter of the i-th group of data is greater than the value 8 (the value 8 is obtained based on test data and data analysis, and the embodiment of the present application does not limit the size of the value 8).
[0342] In the implementation, illustratively, please refer to Table 1, after the threshold calculation module receives the first group of data, assuming that the first group of data does not meet condition A and does not meet condition B, the threshold calculation module determines whether the threshold parameter of the first group of data meets condition C. If condition C is met, the threshold calculation module executes step E11.
[0343] For example, in Table 1, the threshold calculation module determines that the reference value of the current threshold parameter of the first group of data (value 5) is greater than 0, and the rising branch count value (1) is greater than the value 6 (assuming that the value 6 is 0), and the difference (22-20=2) between the voltage value (22) of the electrical signal 24 of the first group of data and the reference value of the threshold parameter of the first group of data (assuming that the value 5 is 20) is greater than the value 8 (assuming that the value 8 is 0), then the threshold calculation module updates the current threshold value (such as the initial threshold value) of the first group of data to the voltage value of the electrical signal 25 in the first group of data (such as 10mV).
[0344] Step E11: if it is determined that the threshold parameter of the i-th group of data satisfies the condition C, the current threshold of the i-th group of data is updated to the voltage value of the electrical signal 25 in the i-th group of data.
[0345] It should be understood that the order of execution of the above-mentioned steps E6 to E11 does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. For example, after the threshold calculation module executes step E5, it can first execute the step of determining whether the i-th group of data meets condition B, then execute the step of determining whether the i-th group of data meets condition A, and then execute the step of determining whether the i-th group of data meets condition C. It can also first execute the step of determining whether the i-th group of data meets condition C, then execute the step of determining whether the i-th group of data meets condition A, and then execute the step of determining whether the i-th group of data meets condition B, etc.
[0346] Step E12: if the threshold calculation module determines that the voltage value of the electrical signal 24 in the i-th group of data is less than or equal to the voltage value of the electrical signal 25, then determine whether the current threshold parameter of the i-th group of data meets the condition D.
[0347] It should be understood that condition D is obtained based on test data and data analysis. The function of condition D is: when the i-th group of data is the threshold calculation module just beginning to receive data (for example, the i-th group of data can be Fig.25 Any set of data in period 1 in the waveform diagram shown, Fig.25It is a waveform diagram of another electrical signal 24 and an electrical signal 25 provided in an embodiment of the present application). The value of the current threshold of the i-th group of data may be relatively large. When the current threshold is used to determine the peak area or the non-peak area, the peak area may be mistakenly determined as the non-peak area, or the non-peak area may be mistakenly determined as the peak area, resulting in false detection. In this case, the value of the current threshold is lowered to ensure that the current threshold can accurately determine the peak area or the non-peak area to avoid false detection.
[0348] For example, condition D may be that the reference value in the current threshold parameter of the i-th group of data is greater than a preset multiple of the voltage value of the electrical signal 25 in the i-th group of data (the embodiment of the present application does not limit the value of the preset multiple).
[0349] In the implementation, for example, please refer to Table 2:
[0350] Table 2
[0351]
[0352] Table 2 is an example diagram of multiple groups of data provided by an embodiment of the present application. Assuming that the i-th group of data is the first group of data that the threshold calculation module has just received (the voltage value of the electrical signal 24 in the first group of data is 14mV, which is less than the voltage value of the electrical signal 25, 15mV), after the threshold calculation module receives the first group of data, the current threshold parameter of the first group of data is the threshold parameter after initialization obtained by the threshold calculation module through step B in the above embodiment. For example, the current threshold parameter of the first group of data includes: UpdateFlag is 0, PeakData is 0, BaseData is 0, ReferData is a value of 5, UpCount is 0, and the current threshold of the first group of data is the initial threshold after initialization obtained by the threshold calculation module through step B in the above embodiment. The threshold calculation module determines whether the ReferData (for example, a value of 5) in the current threshold parameter of the first group of data is greater than a preset multiple (for example, the preset multiple is 6 times) of the voltage value of the electrical signal 25 in the first group of data (for example, the voltage value is 15mV). Assuming that the threshold calculation module determines that the ReferData in the current threshold parameter of the first group of data is greater than the preset multiple of the voltage value of the electrical signal 25 in the first group of data, the threshold calculation module executes step E13. For example, as shown in Table 2, the threshold calculation module updates the current threshold value (such as the initial threshold value) of the first group of data to the voltage value of the electrical signal 25 in the first group of data (such as 15mV), and sets the threshold update state, the peak value of the electrical signal 24, the reference value of the threshold and the rising branch count value in the current threshold parameter of the first group of data to 0. The implementation process of whether the threshold calculation module updates BaseData has been described in the above embodiment and will not be repeated here.
[0353] Assuming that the threshold calculation module determines that the ReferData in the current threshold parameter of the first group of data is less than or equal to a preset multiple of the voltage value of the electrical signal 25 in the first group of data, the threshold calculation module executes step E14.
[0354] Step E13, if the threshold calculation module determines that the current threshold parameters of the i-th group of data meet condition D, the current threshold of the i-th group of data is updated to the voltage value of the electrical signal 25 in the i-th group of data, and the threshold update state, the peak value of the electrical signal 24, the reference value of the threshold and the rising branch count value in the current threshold parameters of the i-th group of data are set to 0.
[0355] Step E14: if the threshold calculation module determines that the current threshold parameter of the i-th group of data does not satisfy condition D, then determine whether the i-th group of data satisfies condition E.
[0356] It should be understood that condition E is obtained based on test data and data analysis, and is used when the voltage value of the electrical signal 24 is equal to the voltage value of the electrical signal 25 in the i-th group of data (for example, the i-th group of data may be Fig.23 The conditions of the peak area and the non-peak area can be accurately determined by the electric signal 24 and the electric signal 25 corresponding to the point R1, R2 or R3 shown in the figure. For example, the condition E can be that the voltage value of the electric signal 24 in the i-th group of data is equal to the voltage value of the electric signal 25 in the i-th group of data, and the value of the electric signal 25 in the first few groups of data of the i-th group of data (including the i-th group of data) gradually increases over time.
[0357] Exemplarily, please refer to Table 1. After receiving the first group of data and the second group of data shown in Table 1, the threshold calculation module starts to receive the third group of data. Assuming that the threshold calculation module determines that the third group does not meet the condition D, the threshold calculation module determines whether the third group of data meets the condition E. For example, the threshold calculation module determines that the voltage value of the electrical signal 24 (for example, 16mV) in the third group of data is equal to the voltage value of the electrical signal 25 (for example, 16mV), and determines that the voltage value of the electrical signal 25 of the first few groups of data of the third group of data (including the third group of data) gradually increases over time (for example, the electrical signal 25 in the first group of data is 10mV, the electrical signal 25 in the second group of data is 11mV, and the electrical signal 25 in the third group of data is 16mV, and the voltage value of the electrical signal 25 gradually increases over time), then the threshold calculation module determines that the third group of data meets the condition E. Assuming that the threshold calculation module determines that the i-th group of data satisfies condition E, step E15 is executed, that is, exemplarily, as shown in Table 1, the threshold calculation module updates the ReferData in the current threshold parameter of the third group of data to the voltage value of the electrical signal 24 of the third group of data (for example, 16 mV, which is the same as the voltage value of the electrical signal 24, and the voltage value can be considered as the voltage value of the intersection of the electrical signal 24 and the descending branch of the electrical signal 25), and updates the current threshold of the third group of data (for example, the current threshold is 11 mV) to the reference value in the current threshold parameter of the third group of data (for example, the reference value is 16 mV).
[0358] Step E15, if the i-th group of data of the threshold calculation module meets condition E, the reference value in the current threshold parameter of the i-th group of data is updated to the voltage value of the electrical signal 25 of the i-th group of data, and the current threshold of the i-th group of data is updated to the reference value in the current threshold parameter of the i-th group of data.
[0359] Step E16: the threshold calculation module determines whether the current threshold parameter of the i-th group of data satisfies the condition F.
[0360] It should be understood that condition F is a condition obtained based on test data and data analysis, and is used to determine whether the threshold determined by step E15 is large. It should also be understood that the electrical signal 24 and the electrical signal 25 of the i-th group of data may be mixed with medium and high frequency noise. Assuming that the threshold calculation module determines through step E14 that the i-th group of data mixed with high-frequency noise meets condition E, then the threshold determined by step E15 may be large, and the peak area and non-peak area may not be accurately determined by a large threshold. Therefore, the embodiment of the present application can determine whether the threshold determined by step E15 is large through condition F. When it is determined that the threshold is large, the value of the current threshold is reduced to ensure that the peak area or non-peak area can be accurately determined using the current threshold.
[0361] For example, condition F may be that the rising branch count in the current threshold parameter of the i-th group of data is greater than a value of 9 (the value of 9 is obtained based on test data and data analysis, and the embodiment of the present application does not limit the size of the value of 9), and the difference between the peak value of the electrical signal 24 in the current threshold parameter of the i-th group of data and the baseline value of the threshold is greater than a reference value of the threshold, and the reference value of the threshold is greater than the product of the voltage value of the electrical signal 25 of the i-th group of data and the coefficient 1.
[0362] In the implementation, please refer to Table 1, assuming that the i-th group of data is the third group of data received by the threshold calculation module (the voltage value 16mV of the electrical signal 24 in the third group of data is equal to the voltage value 16mV of the electrical signal 25), before the current threshold parameter and the current threshold of the third group of data are updated, the current threshold parameter of the third group of data is the current threshold parameter of the second group of data, for example, the current threshold parameter of the second group of data shown in Table 1 includes: UpdateFlag is 1, PeakData is 24, BaseData is 0, ReferData is a value of 5, and UpCount is 2. The current threshold of the third group of data is the threshold of the second group of data, for example, 11mV. Assuming that the threshold calculation module determines through step E14 that the third group of data meets condition E, the threshold calculation module updates the ReferData in the current threshold parameter of the third group of data to the voltage value of the electrical signal 24 of the third group of data (for example, 16mV, which is the same as the voltage value of the electrical signal 24, and which can be considered as the voltage value of the intersection of the descending branch of the electrical signal 24 and the electrical signal 25), and updates the current threshold of the third group of data (for example, the current threshold is 11mV) to the reference value in the current threshold parameter of the third group of data (for example, the reference value is 16mV). The current threshold parameters of the third group after meeting condition E include: UpdateFlag is 1, PeakData is 24, BaseData is 0, ReferData is 16mV, and UpCount is 2. The current threshold of the third group after meeting condition E is 16mV.
[0363] The threshold calculation module determines whether condition F is satisfied based on the current threshold parameters of the third group of data after condition E is satisfied. For example, the threshold calculation module determines whether UpCount (for example, value 2) in the current threshold parameters of the third group of data is greater than value 9 (for example, value 9 is 1), and determines whether the difference between PeakData (for example, 24) and BaseData (for example, 0) in the third group of data is greater than ReferData (for example, 16mV), and determines whether ReferData (for example, 16mV) in the third group of data is greater than the product of the voltage value of the electrical signal 25 of the third group of data (for example, 16mV) and coefficient 1 (for example, coefficient 1 is 0.2).
[0364] Assuming that the threshold calculation module determines that the current threshold parameter of the third group of data meets the above condition F, the threshold calculation module executes step E17. For example, the threshold calculation module updates the reference value (for example, 16 mV) in the current threshold parameter of the third group of data to a value of 10 (the value 10 is obtained based on the test data and data analysis, and the value 10 is smaller than the reference value in the current threshold parameter of the i-th group of data. For example, the value 10 can be the product of the sum of the baseline value in the current threshold parameter of the i-th group of data and the voltage value of the electrical signal 25 in the i-th group of data and the coefficient 2 (for example, the value 10 can be (0+16)×0.3=4.8 mV)), and updates the current threshold of the third group of data from 16 mV to a value of 10 (for example, 4.8 mV).
[0365] Afterwards, the threshold calculation module updates UpdateFlag, PeakData and UpCount in the current threshold parameters of the third group of data to 0. The implementation process of whether the threshold calculation module updates BaseData has been described in the above embodiment and will not be repeated here. Exemplarily, after the current threshold parameters of the third group of data meet the above condition F, the threshold parameters in the third group of data include: UpdateFlag is 0, PeakData is 0, ReferData is 4.8mV, and UpCount is 0. The threshold in the third group of data is 4.8mV.
[0366] Assuming that the threshold calculation module determines that the current threshold parameter of the third group of data does not meet the above condition F, the threshold calculation module executes step E18. For example, the threshold calculation module does not update the reference value (for example, the reference value is still 16mV) and the current threshold value (for example, the threshold value is still 16mV) in the current threshold parameter of the third group of data, and the threshold calculation module updates UpdateFlag, PeakData and UpCount in the current threshold parameter of the third group of data to 0. The implementation process of whether the threshold calculation module updates BaseData has been described in the above embodiment and will not be repeated here.
[0367] Exemplarily, after the current threshold parameters of the third group of data do not meet the above condition F, the threshold parameters in the third group of data include: UpdateFlag is 0, PeakData is 0, ReferData is 16mV, and UpCount is 0. The threshold in the third group of data is 16mV.
[0368] Step E17, if the threshold calculation module determines that the current threshold parameters of the i-th group of data meet condition F, then the reference value in the current threshold parameters of the i-th group of data is updated to the value 10, and the current threshold of the i-th group of data is updated to the value 10, and the threshold update state, peak value and rising branch count value in the current threshold parameters of the i-th group of data are updated to 0, where the value 10 is less than the reference value in the current threshold parameters of the i-th group of data.
[0369] Step E18, if the threshold calculation module determines that the current threshold parameter of the i-th group of data does not meet condition F, the reference value and current threshold in the current threshold parameter of the i-th group of data are not updated, and the threshold update status, peak value and rising branch count value in the current threshold parameter of the i-th group of data are updated to 0.
[0370] Step E19: if the threshold calculation module determines that the current threshold parameter of the i-th group of data does not satisfy condition E, it determines whether the threshold update state in the current threshold parameter of the i-th group of data is 0.
[0371] Step E20: If the threshold calculation module determines that the threshold update state in the current threshold parameter of the i-th group of data is 0, the current threshold of the i-th group of data is not updated.
[0372] For example, the i-th group of data received by the threshold calculation module is the fourth group of data shown in Table 1 (in the fourth group of data, the electrical signal 24 is 14 mV, the electrical signal 25 is 15 mV, and the voltage value of the electrical signal 24 is less than the voltage value of the electrical signal 25). Assuming that the threshold calculation module determines that the fourth group of data does not meet conditions D and E, and the threshold update state in the current threshold parameter in the fourth group of data is 0, then the threshold calculation module does not update the current threshold of the fourth group of data, and the current threshold of the fourth group of data is 16 mV (this threshold is the same as the threshold of the third group of data).
[0373] For another example, the i-th group of data received by the threshold calculation module is the second group of data shown in Table 2 (in the second group of data, the electrical signal 24 is 11 mV, the electrical signal 25 is 14 mV, and the voltage value of the electrical signal 24 is less than the voltage value of the electrical signal 25). Assuming that the threshold calculation module determines that the second group of data does not meet conditions D and E, and the threshold update state in the current threshold parameter in the second group of data is 0, then the threshold calculation module does not update the current threshold of the second group of data, and the current threshold of the second group of data is 15 mV (this threshold is the same as the threshold of the first group of data).
[0374] Exemplarily, the threshold calculation module is Fig.24 The multiple voltage thresholds can be determined by referring to Fig.23 and Fig.25The electronic device can then determine the voltage range 1 and the voltage range 2 in the electrical signal 3 based on the multiple voltage thresholds. For example, please refer to Fig.26 , Fig.26 This is an example diagram for determining voltage range 1 and voltage range 2 in an electrical signal 3 provided in an embodiment of the present application. Fig.26 (a) shows that Fig.24 The method determines the threshold map of multiple voltage thresholds, Fig.26 (b) in the figure shows an example waveform of the electrical signal 3 . Fig.26 (a) shows the electrical signal 24 and the electrical signal 25, and Fig.26 The electrical signal 3 shown in (b) is obtained based on the electrical signal 1. For example, if the electronic device detects a data in the electrical signal 1 at time 1, then based on the data, one of the electrical signals 24, 25 and 3 at time 1 can be obtained. Fig.26 From (a) in the figure, it can be seen that if the value of the electrical signal 24 in time period 1, time period 3 and time period 5 is greater than or equal to the voltage threshold, then the electronic device can Fig.26 The voltage set of the electrical signal 3 in the time period 1, time period 3 and time period 5 shown in (b) is determined as the voltage range 1. Fig.26 From (a) in the figure, it can be seen that the value of the electrical signal 24 in time period 2 and time period 4 is less than the voltage threshold, then the electronic device can Fig.26 The voltage set in the electrical signal 3 in the time period 2 and the time period 4 shown in (b) is determined as the voltage range 2.
[0375] It should be understood that the order of execution of the above-mentioned steps E12 to E17 does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. For example, after the threshold calculation module executes step E4, it can first execute the step of determining whether the i-th group of data meets the condition E, then execute the step of determining whether the i-th group of data meets the condition D, and then execute step 17. It can also first execute step 17, then execute the step of determining whether the i-th group of data meets the condition D, and then execute the step of determining whether the i-th group of data meets the condition E, etc.
[0376] It should also be understood that after the threshold calculation module executes step E4, it may first execute steps E5 to E11 and then execute steps E12 to E17, or it may first execute steps E12 to E17 and then execute steps E5 to E11. This embodiment of the application is not limited to this.
[0377] The above embodiments are combined with 10 to Fig.26The application scenario and implementation process of the noise reduction method provided in the embodiments of the present application are introduced, and the following embodiments introduce the scheme involved in the claims.
[0378] Please refer to Fig. 27 , Fig. 27 is a schematic flow chart of a noise reduction method provided in an embodiment of the present application. The method can be Figure 6 The electronic device 100 shown is executed, and may also be executed by a processor or chip in the electronic device 100, and the present application embodiment does not make any limitation. For ease of description, the method is described in detail by taking an electronic device as an example. The method includes steps 401 to 403.
[0379] Step 401: The electronic device determines a plurality of target thresholds based on a detected first electrical signal.
[0380] It should be understood that the first electrical signal can refer to the electrical signal 1 mentioned above, which will not be described here. Figure 6 The threshold values 1, 2 and 3 shown can also be referred to as Fig.23 and Fig.25 shows the voltage thresholds.
[0381] In implementation, the electronic device can determine a target threshold value based on each data detected in the first electrical signal, thereby determining multiple target threshold values, that is, the electronic device can process the data in the first electrical signal in real time, and obtain a threshold value each time a data is detected and processed. The electronic device can also determine multiple voltage thresholds based on each of the multiple data after detecting a complete first electrical signal, which includes multiple data, and the embodiments of the present application are not limited to this.
[0382] Step 402: The electronic device determines M1 first data sets and M2 second data sets in a first electrical signal based on multiple target thresholds.
[0383] Among them, the multiple target thresholds include M1 first target threshold groups and M2 second target threshold groups, the first target threshold group includes at least one target threshold, the second target threshold group includes at least one target threshold, one first target threshold group corresponds to a first data set, one second target threshold group corresponds to a second data set, the first data set includes the peak data of the first electrical signal, the M2 second data sets are the data sets in the first electrical signal except the M1 first data sets, and M1 and M2 are integers greater than or equal to 1.
[0384] For example, please refer to Fig.26 , Fig.26(a) shows the waveforms of the electrical signal 24 and the electrical signal 25 obtained based on the first electrical signal (electrical signal 1), and the waveform of the voltage threshold, wherein the horizontal axis represents time. Fig.26 The horizontal axis shows five time periods, namely time period 1 to time period 5, each time period corresponds to a target threshold group, for example, time period 1, time period 3 and time period 5 correspond to three first target threshold groups, time period 2 and time period 4 correspond to two second target threshold groups. Each target threshold group corresponds to a data set, for example, please refer to Fig.26 In (a) and (b), time period 1, time period 3, and time period 5 (time period 1, time period 3, and time period 5 correspond to three first target threshold groups) correspond to a first data set respectively, and time period 2 and time period 4 (time period 2 and time period 4 correspond to two second target threshold groups) correspond to a second data set respectively.
[0385] It should also be understood that the first data set includes peak data of the first electrical signal. For details about the peak data, reference may be made to the above embodiments and will not be repeated here.
[0386] In the implementation, for example, the electronic device can obtain based on the first electrical signal Fig.26 In (a) of the electric signal 24 and the electric signal 25, after determining multiple target thresholds based on the electric signal 24 and the electric signal 25, the time period in which the electric signal 24 is greater than or equal to the target threshold can be determined, for example, Fig.26 The value of the electrical signal 24 in time period 1, time period 3 and time period 5 shown in (a) is greater than or equal to the first target threshold value group, and the electronic device can determine the voltage sets in the electrical signal 1 corresponding to time period 1, time period 3 and time period 5 as M1 first data sets. The electronic device can also determine the time period when the electrical signal 24 is less than the target threshold value, for example, Fig.26 In (b), the value of the electrical signal 24 in the time period 2 and the time period 4 is less than the first target threshold group. The electronic device can determine the voltage sets in the electrical signal 1 corresponding to the time period 2 and the time period 4 as M1 first data sets.
[0387] In another implementation, the implementation method of the electronic device determining M1 first data sets and M2 second data sets in the first electrical signal based on multiple target thresholds can refer to the implementation method of determining voltage range 1 and voltage range 2 in the above embodiment, which will not be repeated here.
[0388] Step 403: The electronic device performs noise reduction processing on the M1 first data sets and the M2 second data sets to obtain a second electrical signal.
[0389] It should be understood that the second electrical signal refers to the electrical signal 5 in the above embodiment.
[0390] In implementation, the electronic device may use filtering denoising, wavelet decomposition denoising, singular value decomposition denoising and other methods to perform denoising. It should be noted that since the M1 first data sets include the peak data of the first electrical signal, the peak data can be considered as the characteristic data of the first electrical signal. Therefore, in the process of denoising the first data set, it is necessary to retain the characteristic data as much as possible.
[0391] In an embodiment of the present application, the electronic device can determine multiple target thresholds based on the detected first electrical signal, and based on the multiple target thresholds, determine M1 first data sets and M2 second data sets in the first electrical signal, and then perform noise reduction processing on the M1 first data sets and the M2 second data sets to obtain a second electrical signal. Since the first data set includes peak data of the first electrical signal, the first data set can be considered as a data set in the peak area, and the second data set can be considered as a data set in the non-peak area. That is, the electronic device can determine the data set in the peak area and the data set in the non-peak area based on the multiple target thresholds. Compared with the related scheme in which the data set in the peak area and the data set in the non-peak area are determined by a fixed voltage threshold, the related scheme is more efficient in determining the peak area. When comparing the data set in the peak area and the data set in the non-peak area, the peak area may be mistakenly determined as the non-peak area, resulting in misdetection, because the peak values of the electrical signals generated by the same user in different periods are different, or the peak values of the electrical signals generated by different users may be different due to their own physical conditions, or the peak values of the electrical signals generated by the same user under different detection conditions are different. The embodiment of the present application can determine multiple voltage thresholds for electrical signals of various waveforms, and determine the data set of the peak area and the data set of the non-peak area based on the multiple voltage thresholds. This can reduce the probability of misdetection and improve the accuracy of determining the peak area and the non-peak area. In the subsequent process of realizing noise reduction based on the determined more accurate peak area and non-peak area, the noise reduction effect can be improved, and the user experience can be improved.
[0392] In some embodiments, the electronic device determines a plurality of target thresholds based on the detected first electrical signal, including:
[0393] The electronic device performs a first filtering process on the first electrical signal to obtain a third electrical signal, where the third electrical signal includes a plurality of first candidate data; performs a second filtering process on the first electrical signal to obtain a reference electrical signal, where the reference electrical signal includes a plurality of second candidate data; and determines a plurality of target thresholds based on the third electrical signal and the reference electrical signal; wherein the process of determining one of the plurality of target thresholds based on the third electrical signal and the reference electrical signal includes:
[0394] The electronic device determines a target threshold corresponding to the i-th group of data based on the i-th group of data, where the i-th group of data includes a first candidate data and a second candidate data, where the first candidate data and the second candidate data in the i-th group of data are obtained based on the same data of the first electrical signal, and i is an integer greater than or equal to 1.
[0395] It should be understood that the third electrical signal may be the electrical signal 24 in the above embodiment, and the reference electrical signal may be the electrical signal 25 in the above embodiment.
[0396] In implementation, performing a first filtering process on the first electrical signal to obtain a third electrical signal may be performing a sliding average process on the first electrical signal to obtain the third electrical signal, performing a second filtering process on the first electrical signal to obtain a reference electrical signal, or performing a sliding average process on the first electrical signal to obtain the third electrical signal, and then performing an exponential sliding process on the third electrical signal to obtain a fourth electrical signal.
[0397] For example, please refer to Fig.23 The electrical signal 24 (third electrical signal) includes a plurality of data, which can be considered as a plurality of first candidate data. The electrical signal 25 (fourth electrical signal) includes a plurality of data, which can be considered as a plurality of second candidate data.
[0398] It should also be understood that the i-th group of data may be a group of data among multiple groups of data received by the electronic device, each group of data including a first candidate data in the electrical signal 24 (the third electrical signal) and a second candidate data in the electrical signal 25 (the fourth electrical signal), and a first candidate data and a second candidate data in a group of data are obtained based on the same data of the first electrical signal, that is, a first candidate data and a second candidate data in a group of data are obtained by processing the same data of the first electrical signal.
[0399] In implementation, the electronic device may determine a target threshold value of a group of data based on the group of data, that is, the electronic device may process the received data in real time to obtain the target threshold value.
[0400] In the embodiment of the present application, the reason why the electronic device can determine the target threshold corresponding to the i-th group of data based on a first candidate data and a second candidate data included in the i-th group of data is that by calculating a large amount of test data, multiple groups of data are obtained, each group of data includes the first candidate data and the second candidate data, and after data analysis of the first candidate data and the second candidate data in the multiple groups of data, it is found that the first candidate data and the second candidate data have the following characteristics in terms of value: in the peak area of the first electrical signal, the value of the first candidate data is greater than or equal to the value of the second candidate data, and in the non-peak area of the first electrical signal, the value of the first candidate data is less than the value of the second candidate data. Therefore, the electronic device determines the target threshold corresponding to the i-th group of data based on the first candidate data and the second candidate data included in the i-th group of data according to the above characteristics, which can be used as a basis for determining the data in the peak area (the first data set) and the non-peak area (the second data set), so that the electronic device can accurately determine the first data set and the second data set based on the target threshold.
[0401] Furthermore, the electronic device determines the target threshold corresponding to a group of data (the i-th group of data) and can process the data in real time, thereby reducing the computational complexity when determining the target threshold and increasing the data processing speed.
[0402] In some embodiments, the electronic device determines, based on the i-th group of data, a target threshold corresponding to the i-th group of data, including:
[0403] When the electronic device determines that the first candidate data in the i-th group of data is greater than the second candidate data, it determines whether the target threshold corresponding to the i-1th group of data is less than the second candidate data in the i-th group of data, and the target threshold corresponding to the i-1th group of data is obtained based on the initialization processing, or based on the i-1th group of data; when it is determined that the target threshold corresponding to the i-1th group of data is less than the second candidate data in the i-th group of data, the target threshold corresponding to the i-th group of data is determined to be the second candidate data in the i-th group of data.
[0404] It should be understood that the target threshold corresponding to the i-1th group of data may be an initial threshold obtained based on initialization processing, or may be a target threshold corresponding to the previous group of data of the i-th group of data, and this embodiment of the present application does not limit this.
[0405] It should also be understood that whether the target threshold corresponding to the i-1th group of data in the embodiment of the present application is less than the second candidate data in the i-th group of data refers to condition A mentioned in the above embodiment. For a detailed explanation of condition A, please refer to the above embodiment and will not be repeated here.
[0406] The implementation process of this embodiment can refer to step E5 to step E7 in the above embodiment, which will not be repeated here.
[0407] In an embodiment of the present application, when the electronic device determines that the first candidate data in the i-th group of data is greater than the second candidate data, and when it determines that the target threshold corresponding to the i-1-th group of data is less than the second candidate data in the i-th group of data, the target threshold corresponding to the i-th group of data is determined to be the second candidate data in the i-th group of data, and the target threshold corresponding to the i-th group of data can be accurately determined.
[0408] In some embodiments, the method further comprises:
[0409] When the electronic device determines that the target threshold corresponding to the i-1th group of data is greater than or equal to the second candidate data in the i-th group of data, it determines whether the threshold parameter corresponding to the i-th group of data satisfies a first condition, and the first condition is used to indicate that when the first candidate data in the i-1th group of data is equal to the second candidate data, the target threshold corresponding to the i-th group of data is lowered; when it is determined that the threshold parameter corresponding to the i-th group of data satisfies the first condition, it determines that the target threshold corresponding to the i-th group of data is the second candidate data in the i-th group of data; wherein the threshold parameter corresponding to the i-th group of data is a parameter representing an update range of the target threshold corresponding to the i-th group of data, and a parameter representing whether the second candidate data in the i-th group of data increases relative to the second candidate data in the i-1th group of data.
[0410] It should be understood that the electronic device determines that the target threshold corresponding to the i-1th group of data is greater than or equal to the second candidate data in the i-th group of data means that the target threshold corresponding to the i-1th group of data does not meet the condition A mentioned in the above embodiment.
[0411] It should also be understood that the first condition may refer to the condition B in the above embodiment. For a detailed explanation of the first condition, reference may be made to the condition B in the above embodiment, which will not be repeated here.
[0412] The implementation process of this embodiment can refer to step E8 and step E9 in the above embodiment, which will not be repeated here.
[0413] It can also be understood that the first condition is obtained based on test data and data analysis. The first condition is: when the i-th group of data is data near the intersection of the electrical signal 24 and the electrical signal 25 (for example, the i-th group of data is Fig.23In the waveform diagram shown, for data near the right side of point E1, when the voltage value of the electrical signal 24 of the data is greater than the voltage value of the electrical signal 25, the value of the current threshold of the i-th group of data may be relatively large. Using the current threshold to determine the peak area or the non-peak area may result in the peak area being mistakenly determined as the non-peak area, or the non-peak area being mistakenly determined as the peak area, resulting in false detection. In this case, the value of the current threshold is lowered to ensure that the current threshold can accurately determine the peak area or the non-peak area, thereby avoiding false detection.
[0414] In an embodiment of the present application, when the electronic device determines that the target threshold corresponding to the i-1th group of data is greater than or equal to the second candidate data in the i-th group of data, and when the electronic device determines that the threshold parameter corresponding to the i-th group of data satisfies the first condition, the electronic device can judge that the value of the current threshold of the i-th group of data may be large. In order to avoid false detection due to the large value of the current threshold of the i-th group of data, the electronic device can determine the target threshold corresponding to the i-th group of data as the second candidate data in the i-th group of data. In this way, the electronic device can lower the value of the threshold when it is determined that the value of the current threshold of the i-th group of data may be large.
[0415] In some embodiments, the threshold parameter corresponding to the i-th group of data of the electronic device includes a baseline value corresponding to the i-th group of data and a rising branch count value corresponding to the i-th group of data; and the first condition is that the baseline value corresponding to the i-th group of data is greater than a first value, and the rising branch count value corresponding to the i-th group of data is greater than a second value, and the difference between the second candidate data in the i-th group of data and the baseline value corresponding to the i-th group of data is greater than a third value;
[0416] Among them, the baseline value corresponding to the i-th group of data is the minimum value in the update range of the target threshold corresponding to the i-th group of data, the rising branch count value corresponding to the i-th group of data refers to the number of second candidate data in the K groups of data in the i-th group of data, the last group of data in the K groups of data is the i-th group of data, the second candidate data in the j-th group of data in the K groups of data is greater than the second candidate data in the j-1th group, K is an integer greater than or equal to 1, and J is an integer greater than 1 and less than or equal to K.
[0417] It should be understood that the baseline value corresponding to the i-th group of data can be Fig.23 The voltage values of points E1 and E2 shown in the figure can be referred to as the reference value corresponding to the i-th data. Fig.23 The voltage values, baseline values and reference values shown in R1, R2 and R3 can constitute the update range of the target threshold corresponding to the i-th group of data, the baseline value is the minimum value in the update range, and the reference value is the maximum value in the update range. For example, Fig.23 The update range of the target threshold in the time period 3 is shown as [voltage value at point E1, voltage value at point R1]. The rising branch can be Fig.23 U1 and U2 are shown. The rising branch count value corresponding to the i-th group of data means: for example, the i-th group of data currently received is the 10th group of data, and the second candidate data of each group of data in the first 5 groups of data in the 10th group of data (the first 5 groups of data include the 10th group of data, and the 5 groups of data can be considered as K groups of data) is greater than the second candidate data of the previous group of data, then the rising branch count value is 5. When the electronic device receives a group of data whose second candidate data is less than or equal to the second candidate data of the previous group of data, the rising branch count value is reset to 0.
[0418] It should also be understood that the first value may be 0, the second value may be the value 6 mentioned in the above embodiment, and the third value may be the value 7 mentioned in the above embodiment.
[0419] In some embodiments, the method further comprises:
[0420] When the electronic device determines that the threshold parameter corresponding to the i-th group of data does not satisfy the first condition, it determines whether the threshold parameter corresponding to the i-th group of data satisfies the second condition, and the second condition is used to indicate that when the i-th group of data is the first group of data, the target threshold corresponding to the i-th group of data should be lowered; when it is determined that the threshold parameter corresponding to the i-th group of data satisfies the second condition, it determines that the target threshold corresponding to the i-th group of data is the second candidate data in the i-th group of data.
[0421] It should be understood that the second condition may refer to the condition C in the above embodiment. For a detailed explanation of the second condition, reference may be made to the condition C in the above embodiment, which will not be repeated here. It should also be understood that the meaning of the threshold parameter may refer to the above embodiment, which will not be repeated here.
[0422] The implementation process of this embodiment may refer to step E10 and step E11 in the above embodiment, which will not be described in detail here.
[0423] It should be understood that the second condition is obtained based on test data and data analysis. The second condition is: when the i-th group of data is the data just received by the threshold calculation module (for example Fig.23 In the waveform diagram shown, in the data just received by the threshold calculation module (data in time period 1), the voltage value of the electrical signal 24 is greater than the voltage value of the electrical signal 25). The value of the current threshold of the i-th group of data may be relatively large. Using the current threshold to determine the peak area or the non-peak area may result in the peak area being mistakenly determined as the non-peak area, or the non-peak area being mistakenly determined as the peak area. In the event of misdetection, the value of the current threshold is reduced to ensure that the current threshold can accurately determine the peak area or the non-peak area, thereby avoiding misdetection.
[0424] In an embodiment of the present application, when the electronic device determines that the threshold parameter corresponding to the i-th group of data does not satisfy the first condition, and when the electronic device determines that the threshold parameter corresponding to the i-th group of data satisfies the second condition, the electronic device can judge that the i-th group of data is data that has just been received, and the value of the current threshold of the i-th group of data may be large. In order to avoid false detection when determining the peak area or non-peak area with the current threshold of the i-th group of data when the data is just received, the electronic device can determine the target threshold corresponding to the i-th group of data as the second candidate data in the i-th group of data to lower the current threshold of the i-th group of data that the electronic device has just received.
[0425] In some embodiments, the threshold parameter corresponding to the i-th group of data includes a reference value corresponding to the i-th group of data and an ascending branch count value corresponding to the i-th group of data; and the second condition is that the reference value corresponding to the i-th group of data is greater than a fourth value, and the ascending branch count value corresponding to the i-th group of data is greater than a fifth value, and the difference between the second candidate data in the i-th group of data and the reference value corresponding to the i-th group of data is greater than a sixth value;
[0426] Among them, the reference value corresponding to the i-th group of data is the maximum value in the update range of the target threshold corresponding to the i-th group of data, the rising branch count value corresponding to the i-th group of data refers to the number of second candidate data in the K groups of data in the i-th group of data, the last group of data in the K groups of data is the i-th group of data, the second candidate data in the j-th group of data in the K groups of data is greater than the second candidate data in the j-1th group, K is an integer greater than or equal to 1, and J is an integer greater than 1 and less than or equal to K.
[0427] It should be understood that the meanings of the reference value corresponding to the i-th group of data, the rising branch count value corresponding to the i-th group of data, and the update range of the target threshold corresponding to the i-th group of data can be referred to the above embodiments and will not be repeated here.
[0428] It should also be understood that the fourth value may be 0, the fifth value may be the value 6 mentioned in the above embodiment, and the sixth value may be the value 8 mentioned in the above embodiment.
[0429] In some embodiments, the electronic device determines, based on the i-th group of data, a target threshold corresponding to the i-th group of data, including:
[0430] The electronic device determines whether the threshold parameter corresponding to the i-1th group of data satisfies a third condition when it is determined that the first candidate data in the i-th group of data is less than or equal to the second candidate data; determines that the target threshold corresponding to the i-th group of data is the second candidate data in the i-th group of data, and determines that the threshold update state in the threshold parameter corresponding to the i-th group of data is zero when it is determined that the threshold parameter corresponding to the i-1th group of data satisfies the third condition;
[0431] Among them, the third condition is used to indicate that when the i-th group of data is the first group of data and the target threshold corresponding to the i-1-th group of data is obtained based on the initialization processing, the target threshold corresponding to the i-th group of data is lowered, the threshold parameter corresponding to the i-1-th group of data is obtained based on the initialization processing, and the threshold parameter corresponding to the i-1-th group of data is a parameter that characterizes the update range of the target threshold corresponding to the i-1-th group of data.
[0432] It should be understood that the third condition can refer to condition D in the above embodiment.
[0433] The implementation process of this embodiment may refer to steps E12 and E13 in the above embodiment.
[0434] It should also be understood that the third condition is obtained based on test data and data analysis. The third condition is used as follows: when the i-th group of data is the threshold calculation module just beginning to receive data (for example, the i-th group of data may be Fig.25 Any set of data in period 1 in the waveform diagram shown, Fig.25 It is a waveform diagram of another electrical signal 24 and an electrical signal 25 provided in an embodiment of the present application). The value of the current threshold of the i-th group of data may be relatively large. When the current threshold is used to determine the peak area or the non-peak area, the peak area may be mistakenly determined as the non-peak area, or the non-peak area may be mistakenly determined as the peak area, resulting in false detection. In this case, the value of the current threshold is lowered to ensure that the current threshold can accurately determine the peak area or the non-peak area to avoid false detection.
[0435] In an embodiment of the present application, when the electronic device determines that the first candidate data in the i-th group of data is less than or equal to the second candidate data, and when the electronic device determines that the threshold parameter corresponding to the i-1-th group of data satisfies the third condition, the electronic device can judge that the i-th group of data is data that has just been received, and the value of the current threshold of the i-th group of data may be large. In order to avoid false detection when determining the peak area or non-peak area with the current threshold of the i-th group of data when the data is just received, the electronic device can determine the target threshold corresponding to the i-th group of data as the second candidate data in the i-th group of data to reduce the current threshold of the i-th group of data just received by the electronic device, and the electronic device determines the threshold update state in the threshold parameter corresponding to the i-th group of data to be zero.
[0436] In some embodiments, the threshold parameters corresponding to the i-1th group of data include a reference value corresponding to the i-1th group of data; and, the third condition is that the reference value corresponding to the i-1th group of data is greater than the first multiple of the second candidate data in the i-1th group of data, and the reference value corresponding to the i-1th group of data is obtained based on initialization processing; wherein, the reference value corresponding to the i-1th group of data is the maximum value in the update range of the target threshold corresponding to the i-1th group of data.
[0437] It should be understood that the detailed explanation of the third condition can refer to the above embodiment, and the first multiple can refer to the preset multiple in condition D.
[0438] In some embodiments, the method further comprises:
[0439] The electronic device determines, when determining that the threshold parameter corresponding to the i-1th group of data does not satisfy the third condition, whether the first candidate data in the i-th group of data is equal to the second candidate data in the i-th group of data, and whether the plurality of second candidate data in the n-th group of data gradually increases over time; when determining that the first candidate data in the i-th group of data is equal to the second candidate data in the i-th group of data, and the plurality of second candidate data in the n-th group of data gradually increases over time, determines that the reference value in the threshold parameter corresponding to the i-th group of data is the second candidate data in the i-th group of data, and determines that the target threshold corresponding to the i-th group of data is the reference value in the threshold parameter corresponding to the i-th group of data;
[0440] Among them, the n groups of data include the i-th group of data and the n-1 groups of data before the i-th group of data, n is an integer greater than 1, the threshold parameter corresponding to the i-th group of data is a parameter characterizing the update range of the target threshold corresponding to the i-th group of data, and the reference value in the threshold parameter corresponding to the i-th group of data is the maximum value in the update range of the target threshold corresponding to the i-th group of data.
[0441] It should be understood that whether the first candidate data in the i-th group of data is equal to the second candidate data in the i-th group of data in the embodiment of the present application, and whether the plurality of second candidate data in the n-group of data gradually increases over time refers to the condition E mentioned in the above embodiment. The n-group of data can be considered as the first few groups of data of the i-th group of data, and the first few groups of data include the i-th group of data.
[0442] The implementation process of this embodiment may refer to E14 and E15 in the above embodiments.
[0443] It can also be understood that condition E is obtained based on test data and data analysis, and is used when the voltage value of the electrical signal 24 in the i-1th group of data is greater than the voltage value of the electrical signal 25, and the voltage value of the electrical signal 24 in the i-th group of data is equal to the voltage value of the electrical signal 25 (for example, the i-th group of data can be Fig.23 The electrical signals 24 and 25 corresponding to the points R1, R2 or R3 shown in the figure) accurately determine the conditions of the peak area and the non-peak area.
[0444] In an embodiment of the present application, when the electronic device determines that the threshold parameter corresponding to the i-1th group of data does not satisfy the third condition, and when it is determined that the first candidate data in the i-th group of data is equal to the second candidate data in the i-th group of data, and the multiple second candidate data in the n-th group of data gradually increase over time, the electronic device can judge that the i-th group of data is a critical value in which the voltage value of the electrical signal 24 is greater than the voltage value of the electrical signal 25, and the voltage value of the electrical signal 24 is less than the voltage value of the electrical signal 25. The electronic device can determine the reference value in the threshold parameter corresponding to the i-th group of data as the second candidate data in the i-th group of data, and determine the target threshold value corresponding to the i-th group of data as the reference value in the threshold parameter corresponding to the i-th group of data. In this way, the target threshold value corresponding to the i-th group of data can be accurately determined, so as to accurately determine the peak area and the non-peak area based on the target threshold value corresponding to the i-th group of data when the i-th group of data is a critical value in which the voltage value of the electrical signal 24 is greater than the voltage value of the electrical signal 25, and the voltage value of the electrical signal 24 is less than the voltage value of the electrical signal 25.
[0445] In some embodiments, after the electronic device determines that the reference value in the threshold parameter corresponding to the i-th group of data is the second candidate data in the i-th group of data, and determines that the target threshold corresponding to the i-th group of data is the reference value in the threshold parameter corresponding to the i-th group of data, the method further includes:
[0446] Determine whether the threshold parameter corresponding to the i-1th group of data satisfies a fourth condition, the fourth condition being used to indicate that when the target threshold corresponding to the i-th group of data is determined to be the reference value in the threshold parameter corresponding to the i-th group of data, the target threshold corresponding to the i-th group of data is lowered; when it is determined that the threshold parameter corresponding to the i-1th group of data satisfies the fourth condition, the reference value in the threshold parameter corresponding to the i-th group of data is changed from the second candidate data in the i-th group of data to the seventh value, and the target threshold corresponding to the i-th group of data is changed to the seventh value, and the threshold update state in the threshold parameter corresponding to the i-th group of data is determined to be zero, and the seventh value is less than the second candidate data in the i-th group of data.
[0447] It should be understood that the fourth condition can refer to the condition F in the above embodiment. The seventh value can refer to the value 10 in step E17 in the above embodiment.
[0448] The implementation method in this embodiment can refer to step E16 and step E17 in the above embodiment, which will not be repeated here.
[0449] It should be understood that the fourth condition is obtained based on test data and data analysis, and is used to determine whether the threshold determined by the above condition E is large. It should also be understood that the electrical signal 24 and the electrical signal 25 of the i-th group of data may be mixed with medium and high frequency noise. Assuming that the i-th group of data mixed with high frequency noise meets condition E, the threshold corresponding to the determined i-th group of data may be large, and the peak area and non-peak area may not be accurately determined by the large threshold. Therefore, the embodiment of the present application can determine whether the threshold determined by step E15 is large through the fourth condition. When the threshold is determined to be large, the reference value in the threshold parameter corresponding to the i-th group of data can be changed from the second candidate data in the i-th group of data to the seventh value, and the target threshold corresponding to the i-th group of data can be changed to the seventh value, which can reduce the value of the current threshold to ensure that the peak area or non-peak area can be accurately determined using the current threshold. And the threshold update state in the threshold parameter corresponding to the i-th group of data is determined to be zero, and the electronic device can determine whether to update the target threshold corresponding to the i-th group of data received subsequently based on the threshold update state.
[0450] In some embodiments, the method further comprises:
[0451] When determining that the threshold parameter corresponding to the i-1th group of data does not satisfy the fourth condition, the electronic device determines that the threshold update state in the threshold parameter corresponding to the i-th group of data is zero.
[0452] The implementation method of this embodiment can refer to step E19 in the above embodiment, which will not be repeated here.
[0453] In some embodiments, the threshold parameters corresponding to the i-1th group of data include the rising branch count value corresponding to the i-1th group of data, the baseline value corresponding to the i-1th group of data, and the reference value corresponding to the i-1th group of data; and the fourth condition is that the rising branch count value corresponding to the i-1th group of data is greater than the eighth value, and the difference between the first candidate data in the i-1th group of data and the baseline value corresponding to the i-1th group of data is greater than the reference value corresponding to the i-1th group of data, and the reference value corresponding to the i-1th group of data is greater than the second multiple of the second candidate data in the i-1th group of data;
[0454] Among them, the rising branch count value corresponding to the i-1th group of data refers to the number of second candidate data in the K-1 group of data in the i-1 group of data, the last group of data in the K-1 group of data is the i-1th group of data, the second candidate data in the jth group of data in the K-1 group of data is greater than the second candidate data in the j-1th group, K is an integer greater than or equal to 1, J is an integer greater than 1 and less than or equal to K, the baseline value corresponding to the i-1th group of data is the minimum value in the update range of the target threshold corresponding to the i-1th group of data, and the reference value corresponding to the i-1th group of data is the maximum value in the update range of the target threshold corresponding to the i-1th group of data.
[0455] It should be understood that the eighth value can refer to the value 9 in the above embodiment, and the second multiple can refer to the coefficient 1 in the above embodiment.
[0456] In some embodiments, the method further comprises:
[0457] When the electronic device determines that the first candidate data in the i-th group of data is not equal to the second candidate data in the i-th group of data, and / or the multiple second candidate data in the n groups of data do not gradually increase over time, it determines whether the threshold update state in the threshold parameter corresponding to the i-1th group of data is zero; when it is determined that the threshold update state in the threshold parameter corresponding to the i-1th group of data is zero, it determines that the target threshold corresponding to the i-th group of data is the target threshold corresponding to the i-1th group of data.
[0458] The implementation method of this embodiment can refer to step E19 and step E20 in the above embodiment, and the embodiment of the present application is not limited to this.
[0459] In some embodiments, the electronic device performs a first filtering process on the first electrical signal to obtain a third electrical signal, including:
[0460] The electronic device performs a third filtering process on the first electrical signal to obtain a fourth electrical signal, wherein the frequency range of the fourth electrical signal is the first frequency range, and the first frequency range is smaller than the frequency range of the first electrical signal; performs a differential process on the fourth electrical signal to obtain a fifth electrical signal; performs a square process on the fifth electrical signal to obtain a sixth electrical signal; and performs a sliding average process on the sixth electrical signal to obtain a third electrical signal;
[0461] Accordingly, performing a second filtering process on the first electrical signal to obtain a reference electrical signal includes:
[0462] The third electrical signal is subjected to exponential sliding processing to obtain a reference electrical signal.
[0463] It should be understood that the third electrical signal may refer to the electrical signal 2 in the above embodiment. In implementation, the third filtering process may refer to the implementation process of step 202, which will not be described in detail here. It should also be understood that performing the first filtering process on the first electrical signal refers to removing the frequencies higher than the value A in the first electrical signal and retaining the frequencies lower than or equal to the value A, so the first frequency range refers to the frequency range less than or equal to the value A in the frequency range of the first electrical signal.
[0464] The fifth electrical signal refers to the electrical signal 22 in the above embodiment. The electronic device performs differential processing on the fourth electrical signal to obtain the fifth electrical signal. The implementation process can refer to step 3121 in the above embodiment, which will not be repeated here.
[0465] The sixth electrical signal refers to the electrical signal 23 in the above embodiment. The electronic device performs square processing on the fifth electrical signal to obtain the sixth electrical signal. The implementation process can refer to step 3123 in the above embodiment, which will not be repeated here.
[0466] The electronic device performs sliding average processing on the sixth electrical signal to obtain the third electrical signal. The implementation process can refer to step 3124 in the above embodiment, which will not be repeated here.
[0467] The electronic device performs exponential sliding processing on the third electrical signal to obtain the reference electrical signal. The implementation process may refer to step 3125 in the above embodiment, which will not be repeated here.
[0468] In the embodiment of the present application, the electronic device can reprocess the first electrical signal, and the reprocessing includes third filtering processing, differential processing, squaring processing, sliding average processing and exponential sliding processing. Since the third electrical signal and the reference signal can be obtained, the third electrical signal and the reference signal after reprocessing are convenient for subsequent data operations.
[0469] In some embodiments, before the electronic device determines a plurality of target thresholds based on the detected first electrical signal, the method further includes:
[0470] The electronic device performs a fourth filtering process on the first electrical signal to obtain a seventh electrical signal, wherein the frequency range of the seventh electrical signal is the second frequency range, and the second frequency range is smaller than the frequency range of the first electrical signal; determining whether a plurality of first characteristic data in the seventh electrical signal satisfies a fifth condition, wherein the fifth condition is used to indicate that noise data exists in a first data set in the first electrical signal, and the plurality of first characteristic data include a plurality of peak data of the first electrical signal and a plurality of interval durations corresponding to the plurality of peak data;
[0471] Accordingly, based on the detected first electrical signal, a plurality of target thresholds are determined, including:
[0472] In the case where it is determined that the plurality of first feature data in the seventh electrical signal satisfies the fifth condition, a plurality of target thresholds are determined based on the detected first electrical signal.
[0473] It should be understood that the seventh electrical signal may refer to the electrical signal 21 in the above embodiment, and the electronic device performing the fourth filtering processing on the first electrical signal may include: the electronic device performs filtering processing on the first electrical signal through the low-pass filtering module A mentioned in the above embodiment, and then performs filtering processing through the high-pass filtering module B mentioned above to obtain the electrical signal 21. The implementation process of the electronic device performing the fourth filtering processing on the first electrical signal may refer to the above embodiment and will not be repeated here.
[0474] It should also be understood that in the process of performing the fourth filtering process on the first electrical signal to obtain the seventh signal, the low-pass filtering module A can remove the frequencies higher than the numerical value A in the first electrical signal, and retain the frequencies lower than or equal to the numerical value A, and the high-pass filtering module B can remove the frequencies lower than the numerical value D in the first electrical signal, and retain the frequencies higher than the numerical value D in the first electrical signal. Therefore, the second frequency range refers to the frequency range higher than the numerical value D and less than or equal to the numerical value A in the first electrical signal. It can be seen from the above embodiments that the low-pass filtering module A can remove the power frequency noise and electromyographic interference noise in the first electrical signal, and can also retain the main characteristic points of the first electrical signal. The high-pass filtering module B can remove the low-frequency noise in the first electrical signal, so the power frequency noise, electromyographic interference noise, and low-frequency noise have been removed from the seventh signal, and the main characteristic points of the first electrical signal are retained.
[0475] From the above embodiments, it can be seen that condition 1 refers to a condition for determining whether the electrical signal 21 (the seventh electrical signal, in which the main feature points of the first electrical signal are retained) is subject to strong noise interference. Therefore, condition 1 can be used to determine whether the data in the area where the main feature points of the first electrical signal are located is subject to strong noise interference.
[0476] It can also be understood that the fifth condition refers to the condition 1 mentioned in the above embodiment. The meaning of the multiple peak data can be referred to the above embodiment, and will not be repeated here. The multiple interval durations corresponding to the multiple peak data refer to the multiple interval data mentioned in the above embodiment.
[0477] The implementation method of this embodiment can refer to step 3094 in the above embodiment, which will not be repeated here.
[0478] In the embodiment of the present application, since the electronic device performs the fourth filtering processing on the first electric signal, the obtained seventh electric signal includes the main feature points of the first electric signal, and the fifth condition is used to indicate that there is noise data in the first data set in the first electric signal. Therefore, the electronic device can accurately determine whether the data in the area where the main feature points of the first electric signal are located are subject to strong noise interference by determining whether multiple first feature data in the seventh electric signal meet the fifth condition. When it is determined that the data in the area where the main feature points of the first electric signal are located are subject to strong noise interference, multiple target thresholds are determined to achieve noise reduction. When it is determined that the data in the area where the main feature points of the first electric signal are located are not subject to strong noise interference, noise reduction processing is not performed, thereby reducing the power consumption of the electronic device.
[0479] In some embodiments, the fifth condition is that the mean of the multiple peak data is greater than the ninth value, the standard deviation of the multiple interval durations is less than the tenth value, and the standard deviation of the multiple peak data is less than the third multiple of the mean of the multiple peak data.
[0480] It should be understood that the ninth value can refer to the value 1 in the above embodiment, the tenth value can refer to the value 2 in the above embodiment, and the third multiple can refer to the value 3 in the above embodiment.
[0481] In some embodiments, the electronic device performs noise reduction processing on M1 first data sets and M2 second data sets to obtain a second electrical signal, including:
[0482] The electronic device performs noise reduction processing on M1 first data sets through multiple windows of non-fixed length that gradually decrease over time to obtain an eighth electrical signal; and performs noise reduction processing on M2 second data sets through multiple windows of non-fixed length that gradually increase over time to obtain a ninth electrical signal, and the second electrical signals include the eighth electrical signal and the ninth electrical signal.
[0483] The implementation process of this embodiment can refer to the implementation method of step 312, which will not be repeated here. The eighth electrical signal can refer to the electrical signal 31 mentioned in the above embodiment, and the ninth electrical signal can refer to the electrical signal 32 mentioned in the above embodiment.
[0484] It should be understood that when the data is smoothed through a longer window, the influence of random errors caused by noise can be reduced, making the data in the window smoother and more consistent, and the noise reduction effect is better. When the noise suppression module smoothes the data through a shorter window, it can reduce random errors while retaining the original features of the data as much as possible to avoid the loss of the original features of the data, but the noise reduction effect is poorer than that of a longer window.
[0485] In the embodiment of the present application, the electronic device performs smoothing processing on the M1 first data sets through multiple windows of different lengths that gradually decrease over time, so that the main feature points of the first electrical signal can be retained and a better noise reduction effect can be achieved. The electronic device performs smoothing processing on the data in the M2 second data sets through multiple windows of different lengths that gradually increase over time, which can achieve a better noise reduction effect.
[0486] In some embodiments, before the electronic device determines a plurality of target thresholds based on the detected first electrical signal, the method further includes:
[0487] The electronic device detects a first electrical signal in response to a trigger event;
[0488] Correspondingly, after performing noise reduction processing on the M1 first data sets and the M2 second data sets to obtain the second electrical signal, the method further includes:
[0489] The electronic device displays a first interface including a second electrical signal.
[0490] It should be understood that the trigger event refers to an event that triggers the electronic device to detect the first electrical signal. For example, the trigger event may be an operation of the electronic device by the user, such as the user clicking Fig. 9 The "ECG Collection" application shown in (a) of FIG. 1 , and the operation of the user touching the electrode on the lower side of the watch with a finger, etc. The embodiment of the present application does not limit the triggering event.
[0491] The first interface refers to an interface including the second electrical signal. For example, the first interface may refer to Fig. 9 In the interface 930 shown in (c), the embodiment of the present application does not limit the first interface.
[0492] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0493] The embodiment of the present application provides a computer program product, when the computer program product is run on an electronic device, the electronic device executes the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above method-related embodiments, and will not be repeated here.
[0494] The embodiment of the present application provides a readable storage medium, the readable storage medium contains instructions, when the instructions are executed in an electronic device, the electronic device executes the technical solution of the above embodiment. The implementation principle and technical effect are similar, and will not be repeated here.
[0495] The embodiment of the present application provides a chip, the chip is used to execute instructions, when the chip is running, the technical solution in the above embodiment is executed. The implementation principle and technical effect are similar, and will not be repeated here.
[0496] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0497] It should be understood that the "embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the various embodiments in the entire specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0498] A person skilled in the art may understand that the various numerical numbers such as first and second involved in the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application, and also indicate the order of precedence.
[0499] In this application, elements expressed in the singular are intended to mean "one or more" rather than "one and only one", unless otherwise specified. In this application, "at least one" is intended to mean "one or more", and "more than one" is intended to mean "two or more", unless otherwise specified.
[0500] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. A can be singular or plural, and B can be singular or plural.
[0501] In this document, the term "at least one of..." means all or any combination of the listed items. For example, "at least one of A, B and C" may mean: A exists alone, B exists alone, C exists alone, A and B exist at the same time, B and C exist at the same time, and A, B and C exist at the same time. A may be singular or plural, B may be singular or plural, and C may be singular or plural.
[0502] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0503] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0504] The same or similar parts between the various embodiments in this application can refer to each other. In the various embodiments in this application, and the various implementation methods / implementation methods / implementation methods in each embodiment, if there is no special explanation and logical conflict, the terms and / or descriptions between different embodiments and the various implementation methods / implementation methods / implementation methods in each embodiment are consistent and can be referenced to each other. The technical features in different embodiments and the various implementation methods / implementation methods / implementation methods in each embodiment can be combined to form new embodiments, implementation methods, implementation methods, or implementation methods according to their inherent logical relationships. The above-described implementation methods of this application do not constitute a limitation on the scope of protection of this application.
[0505] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims. In short, the above is only a preferred embodiment of the technical solution of the present application, and is not used to limit the protection scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A noise reduction method, applied to electronic equipment, characterized in that: The method comprises: Performing a first filtering process on the first electrical signal to obtain a third electrical signal, wherein the third electrical signal includes a plurality of first candidate data; Performing a second filtering process on the first electrical signal to obtain a reference electrical signal, wherein the reference electrical signal includes a plurality of second candidate data; Determine a plurality of target thresholds based on the third electrical signal and the reference electrical signal; wherein the process of determining one of the plurality of target thresholds based on the third electrical signal and the reference electrical signal comprises: Based on an i-th group of data, determining the target threshold corresponding to the i-th group of data, the i-th group of data including one first candidate data and one second candidate data, one first candidate data and one second candidate data in the i-th group of data are obtained based on the same data of the first electrical signal, and i is an integer greater than or equal to 1; Based on the multiple target thresholds, M1 first data sets and M2 second data sets are determined in the first electrical signal, the multiple target thresholds include M1 first target threshold groups and M2 second target threshold groups, the first target threshold group includes at least one target threshold, the second target threshold group includes at least one target threshold, one first target threshold group corresponds to one first data set, one second target threshold group corresponds to one second data set, the first data set includes peak data of the first electrical signal, M2 second data sets are data sets in the first electrical signal other than the M1 first data sets, and M1 and M2 are integers greater than or equal to 1; Noise reduction processing is performed on M1 first data sets and M2 second data sets to obtain a second electrical signal.
2. The method according to claim 1, characterized in that The determining, based on the i-th group of data, the target threshold corresponding to the i-th group of data includes: In the case where it is determined that the first candidate data in the i-th group of data is greater than the second candidate data, determining whether the target threshold corresponding to the i-1th group of data is less than the second candidate data in the i-th group of data, the target threshold corresponding to the i-1th group of data being obtained based on initialization processing or based on the i-1th group of data; When it is determined that the target threshold corresponding to the i-1th group of data is smaller than the second candidate data in the i-th group of data, the target threshold corresponding to the i-th group of data is determined to be the second candidate data in the i-th group of data.
3. The method according to claim 2, characterized in that The method further comprises: In a case where it is determined that the target threshold corresponding to the i-1th group of data is greater than or equal to the second candidate data in the i-th group of data, determining whether the threshold parameter corresponding to the i-th group of data satisfies a first condition, the first condition being used to indicate that in a case where the first candidate data in the i-1th group of data is equal to the second candidate data, the target threshold corresponding to the i-th group of data is lowered; In a case where it is determined that the threshold parameter corresponding to the i-th group of data satisfies the first condition, determining that the target threshold corresponding to the i-th group of data is the second candidate data in the i-th group of data; Among them, the threshold parameter corresponding to the i-th group of data is a parameter characterizing the update range of the target threshold corresponding to the i-th group of data, and a parameter characterizing whether the second candidate data in the i-th group of data increases relative to the second candidate data in the i-1-th group of data.
4. The method according to claim 3, characterized in that The threshold parameter corresponding to the i-th group of data includes a baseline value corresponding to the i-th group of data and a rising branch count value corresponding to the i-th group of data; and the first condition is that the baseline value corresponding to the i-th group of data is greater than a first value, and the rising branch count value corresponding to the i-th group of data is greater than a second value, and the difference between the second candidate data in the i-th group of data and the baseline value corresponding to the i-th group of data is greater than a third value; Among them, the baseline value corresponding to the i-th group of data is the minimum value in the update range of the target threshold corresponding to the i-th group of data, the rising branch count value corresponding to the i-th group of data refers to the number of second candidate data in K groups of data in the i-th group of data, the last group of data in the K groups of data is the i-th group of data, the second candidate data in the j-th group of data in the K groups of data is greater than the second candidate data in the j-1-th group, K is an integer greater than or equal to 1, and J is an integer greater than 1 and less than or equal to K.
5. The method according to claim 3, characterized in that: The method further comprises: In a case where it is determined that the threshold parameter corresponding to the i-th group of data does not satisfy the first condition, determining whether the threshold parameter corresponding to the i-th group of data satisfies a second condition, the second condition being used to indicate that when the i-th group of data is the first group of data, the target threshold corresponding to the i-th group of data is lowered; When it is determined that the threshold parameter corresponding to the i-th group of data satisfies the second condition, the target threshold corresponding to the i-th group of data is determined to be the second candidate data in the i-th group of data.
6. The method according to claim 5, characterized in that The threshold parameter corresponding to the i-th group of data includes a reference value corresponding to the i-th group of data and a rising branch count value corresponding to the i-th group of data; and the second condition is that the reference value corresponding to the i-th group of data is greater than a fourth value, and the rising branch count value corresponding to the i-th group of data is greater than a fifth value, and a difference between the second candidate data in the i-th group of data and the reference value corresponding to the i-th group of data is greater than a sixth value; Among them, the reference value corresponding to the i-th group of data is the maximum value in the update range of the target threshold corresponding to the i-th group of data, the rising branch count value corresponding to the i-th group of data refers to the number of second candidate data in K groups of data in the i-th group of data, the last group of data in the K groups of data is the i-th group of data, the second candidate data in the j-th group of data in the K groups of data is greater than the second candidate data in the j-1-th group, K is an integer greater than or equal to 1, and J is an integer greater than 1 and less than or equal to K.
7. The method according to claim 1, characterized in that The determining, based on the i-th group of data, the target threshold corresponding to the i-th group of data includes: In the case where it is determined that the first candidate data in the i-th group of data is less than or equal to the second candidate data, determining whether a threshold parameter corresponding to the i-1-th group of data satisfies a third condition; In the case where it is determined that the threshold parameter corresponding to the i-1th group of data satisfies the third condition, determining that the target threshold corresponding to the i-th group of data is the second candidate data in the i-th group of data, and determining that the threshold update state in the threshold parameter corresponding to the i-th group of data is zero; Among them, the third condition is used to indicate that when the i-th group of data is the first group of data and the target threshold corresponding to the i-1th group of data is obtained based on initialization processing, the target threshold corresponding to the i-th group of data is lowered, the threshold parameter corresponding to the i-1th group of data is obtained based on initialization processing, and the threshold parameter corresponding to the i-1th group of data is a parameter that characterizes the update range of the target threshold corresponding to the i-1th group of data.
8. The method according to claim 7, characterized in that The threshold parameter corresponding to the i-1th group of data includes a reference value corresponding to the i-1th group of data; and the third condition is that the reference value corresponding to the i-1th group of data is greater than a first multiple of the second candidate data in the i-th group of data, and the reference value corresponding to the i-1th group of data is obtained based on initialization processing; The reference value corresponding to the i-1th group of data is the maximum value in the update range of the target threshold corresponding to the i-1th group of data.
9. The method according to claim 7, characterized in that: The method further comprises: In the case where it is determined that the threshold parameter corresponding to the i-1th group of data does not satisfy the third condition, determining whether the first candidate data in the i-th group of data is equal to the second candidate data in the i-th group of data, and whether a plurality of the second candidate data in the n groups of data gradually increases over time; In a case where it is determined that the first candidate data in the i-th group of data is equal to the second candidate data in the i-th group of data, and a plurality of the second candidate data in the n-th group of data gradually increases over time, determining that a reference value in the threshold parameter corresponding to the i-th group of data is the second candidate data in the i-th group of data, and determining that the target threshold corresponding to the i-th group of data is the reference value in the threshold parameter corresponding to the i-th group of data; Among them, the n groups of data include the i-th group of data and the n-1 groups of data before the i-th group of data, n is an integer greater than 1, the threshold parameter corresponding to the i-th group of data is a parameter characterizing the update range of the target threshold corresponding to the i-th group of data, and the reference value in the threshold parameter corresponding to the i-th group of data is the maximum value in the update range of the target threshold corresponding to the i-th group of data.
10. The method according to claim 9, characterized in that After determining that the reference value in the threshold parameter corresponding to the i-th group of data is the second candidate data in the i-th group of data, and determining that the target threshold corresponding to the i-th group of data is the reference value in the threshold parameter corresponding to the i-th group of data, the method further includes: determining whether the threshold parameter corresponding to the i-1th group of data satisfies a fourth condition, wherein the fourth condition is used to indicate that when the target threshold corresponding to the i-th group of data is the reference value in the threshold parameter corresponding to the i-th group of data, the target threshold corresponding to the i-th group of data is lowered; When it is determined that the threshold parameter corresponding to the i-1th group of data satisfies the fourth condition, the reference value in the threshold parameter corresponding to the i-th group of data is changed from the second candidate data in the i-th group of data to the seventh value, and the target threshold corresponding to the i-th group of data is changed to the seventh value, and the threshold update state in the threshold parameter corresponding to the i-th group of data is determined to be zero, and the seventh value is smaller than the second candidate data in the i-th group of data.
11. The method according to claim 10, characterized in that The method further comprises: When it is determined that the threshold parameter corresponding to the i-1th group of data does not satisfy the fourth condition, it is determined that the threshold update state in the threshold parameter corresponding to the i-th group of data is zero.
12. The method according to claim 10, characterized in that The threshold parameters corresponding to the i-1th group of data include a rising branch count value corresponding to the i-1th group of data, a baseline value corresponding to the i-1th group of data, and a reference value corresponding to the i-1th group of data; and the fourth condition is that the rising branch count value corresponding to the i-1th group of data is greater than an eighth value, and a difference between the first candidate data in the i-1th group of data and the baseline value corresponding to the i-1th group of data is greater than the reference value corresponding to the i-1th group of data, and the reference value corresponding to the i-1th group of data is greater than a second multiple of the second candidate data in the i-1th group of data; Among them, the rising branch count value corresponding to the i-1th group of data refers to the number of second candidate data in the K-1 group of data in the i-1 group of data, the last group of data in the K-1 group of data is the i-1th group of data, the second candidate data in the jth group of data in the K-1 group of data is greater than the second candidate data in the j-1th group, K is an integer greater than or equal to 1, J is an integer greater than 1 and less than or equal to K, the baseline value corresponding to the i-1th group of data is the minimum value in the update range of the target threshold corresponding to the i-1th group of data, and the reference value corresponding to the i-1th group of data is the maximum value in the update range of the target threshold corresponding to the i-1th group of data.
13. The method according to claim 9, characterized in that The method further comprises: In the case where it is determined that the first candidate data in the i-th group of data is not equal to the second candidate data in the i-th group of data, and / or the plurality of the second candidate data in the n-th group of data does not gradually increase over time, determining whether a threshold update state in the threshold parameter corresponding to the i-1-th group of data is zero; When it is determined that the threshold update state in the threshold parameter corresponding to the i-1th group of data is zero, the target threshold corresponding to the i-th group of data is determined to be the target threshold corresponding to the i-1th group of data.
14. The method according to claim 1, characterized in that The performing a first filtering process on the first electrical signal to obtain a third electrical signal includes: Performing a third filtering process on the first electrical signal to obtain a fourth electrical signal, wherein a frequency range of the fourth electrical signal is the first frequency range, and the first frequency range is smaller than the frequency range of the first electrical signal; performing differential processing on the fourth electrical signal to obtain a fifth electrical signal; Performing square processing on the fifth electrical signal to obtain a sixth electrical signal; Performing sliding average processing on the sixth electrical signal to obtain the third electrical signal; Accordingly, performing a second filtering process on the first electrical signal to obtain a reference electrical signal includes: The third electrical signal is subjected to exponential sliding processing to obtain the reference electrical signal.
15. The method according to any one of claims 1 to 14, characterized in that Before determining a plurality of target thresholds based on the detected first electrical signal, the method further includes: Performing a fourth filtering process on the first electrical signal to obtain a seventh electrical signal, wherein a frequency range of the seventh electrical signal is a second frequency range, and the second frequency range is smaller than a frequency range of the first electrical signal; Determine whether a plurality of first characteristic data in the seventh electrical signal satisfies a fifth condition, wherein the fifth condition is used to indicate that noise data exists in the first data set in the first electrical signal, and the plurality of first characteristic data include a plurality of peak data of the first electrical signal and a plurality of interval durations corresponding to the plurality of peak data; Accordingly, the step of determining a plurality of target thresholds based on the detected first electrical signal includes: In the case where it is determined that a plurality of the first feature data in the seventh electrical signal satisfies the fifth condition, a plurality of target thresholds are determined based on the detected first electrical signal.
16. The method according to claim 15, characterized in that The fifth condition is that the mean of the multiple peak data is greater than the ninth value, the standard deviation of the multiple interval durations is less than the tenth value, and the standard deviation of the multiple peak data is less than the third multiple of the mean of the multiple peak data.
17. The method according to any one of claims 1 to 14, characterized in that: The performing noise reduction processing on M1 first data sets and M2 second data sets to obtain a second electrical signal includes: Performing noise reduction processing on M1 first data sets through a plurality of windows of non-fixed lengths that gradually decrease over time to obtain an eighth electrical signal; The M2 second data sets are subjected to noise reduction processing through a plurality of windows of non-fixed lengths that gradually increase with time, so as to obtain a ninth electrical signal, wherein the second electrical signal includes the eighth electrical signal and the ninth electrical signal.
18. The method according to any one of claims 1 to 14, characterized in that Before determining a plurality of target thresholds based on the detected first electrical signal, the method further includes: In response to a triggering event, detecting the first electrical signal; Correspondingly, after performing noise reduction processing on the M1 first data sets and the M2 second data sets to obtain the second electrical signal, the method further includes: A first interface including the second electrical signal is displayed.
19. An electronic device, characterized in that: include: one or more processors; one or more memories; The one or more memories store one or more computer programs, and the one or more computer programs include instructions, which, when executed by the one or more processors, enable the electronic device to perform the method as claimed in any one of claims 1 to 18.
20. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 18.
21. A chip, characterized in that: The chip comprises: A memory for storing instructions; A processor, configured to call and execute the instructions from the memory, so that an electronic device equipped with the chip executes the method as claimed in any one of claims 1 to 18.
