Signal denoising method and electronic equipment

By identifying the continuous mutation of the peaks in the ECG signal, determining the denoising point, and constructing the characteristic sequence and threshold, it is possible to effectively denoise the ECG signal without interfering with the key characteristics of the ECG signal, and solve the problem of interfering with the key characteristics of the ECG signal in the prior art.

CN119866193APending Publication Date: 2025-04-22HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380067352.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-09-29
Filing Date
2023-09-08
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

The prior art easily interferes with key features in the ECG signal when denoising the ECG signal, such as P wave, T wave and R wave, causing the ECG signal to lose its reference value.

Method used

By utilizing the continuous mutation of the peaks with reference significance in the electrocardiogram, it is determined whether the signal point is a point on the signal wave with reference significance, and whether the signal point is denoised. The specific method includes constructing a first feature sequence corresponding to the target sampling point, and determining the cumulative variation threshold based on the sequence and the previous feature sequence. If the values ​​are both smaller than the threshold, performing average filtering and denoising.

Benefits of technology

While ensuring the reference value of the ECG signal, the ECG signal is effectively denoised to reduce the impact of noise, especially in the stationary signal, improving the accuracy and reliability of denoising.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119866193A_ABST
    Figure CN119866193A_ABST
Patent Text Reader

Abstract

The invention discloses a signal denoising method and electronic equipment, and the method can identify whether a signal point is a point on a signal wave with reference significance or not during denoising by means of the continuous mutability of a wave crest with reference significance in an electrocardiosignal, so as to determine whether to carry out denoising processing on the signal point or not. By implementing the method, the electrocardiosignal can be effectively denoised on the premise of ensuring the reference value of the electrocardiosignal.
Need to check novelty before this filing date? Find Prior Art

Description

Signal denoising method and electronic device

[0001] This application claims the priority of the Chinese patent application filed with the China Patent Office on September 29, 2022, with application number 202211202646.9 and application name “Signal Denoising Method and Electronic Device”, all contents of which are incorporated by reference in this application.

[0002] The present application relates to the technical field of life feature recognition and processing, and in particular to a signal denoising method and electronic equipment.

[0003] ECG signals are usually collected through electrodes attached to the surface of the skin. Since ECG signals on the skin are relatively weak and easily interfered by noise, there is a lot of noise in the collected ECG signals, which reduces the accuracy and reliability of ECG diagnosis. In particular, the ECG collected by wearable ECG devices when the user is in a non-stationary state contains a lot of noise.

[0004] Noises in ECG signals, such as myoelectric noise and motion noise, exist in the entire frequency band of ECG signals. Although the impact of these noises is small, it is difficult to completely eliminate them. The impact of these noises is more obvious in the stable section of the signal. When traditional denoising methods denoise these noises in ECG signals, they are likely to interfere with the peaks of the P wave, T wave, and R wave in the ECG signals; and the P wave, T wave, and R wave are the key features of the ECG signals. When they are affected, the ECG signals lose their reference value.

[0005] Therefore, how to denoise ECG signals while ensuring their reference value is an urgent problem to be solved.

[0006] Summary of the invention

[0007] The purpose of the present application is to provide a signal denoising method and electronic device. The method uses the continuous mutation of the peak with reference significance in the ECG signal to identify whether the signal point is a point on the signal wave with reference significance during denoising, thereby determining whether to perform denoising on the signal point. By implementing this method, the ECG signal can be effectively denoised while ensuring the reference value of the ECG signal.

[0008] The above-mentioned and other objects are achieved by the features of the independent claims. Further implementations are reflected in the dependent claims, the description and the drawings.

[0009] In a first aspect, the present application provides a signal denoising method, comprising: determining a first feature sequence corresponding to a target sampling point, the first feature sequence corresponding to the target sampling point includes j elements, the j elements correspond one-to-one to the j sampling points in the signal to be denoised, the element corresponding to any one of the j sampling points represents the sum of the rising or falling amplitudes of each sampling point between the any one sampling point and the first sampling point, the falling or rising amplitude of any one of the j sampling points is the difference between the amplitude of the any one sampling point and the amplitude of the next sampling point after the any one sampling point, and the first sampling point is located before the any one sampling point a sampling point that presents an opposite change trend to the any sampling point and is closest to the any sampling point; when the values ​​in the first feature sequence corresponding to the target sampling point are all smaller than the cumulative variation threshold corresponding to the target sampling point, the amplitude of the target sampling point and the amplitudes of the m sampling points around the target sampling point are averaged to obtain a target value, and the amplitude of the target sampling point is updated to the target value, and the cumulative variation threshold corresponding to the target sampling point is determined by the first feature sequence corresponding to the target sampling point and v first feature sequences corresponding to the v sampling points before the target sampling point.

[0010] In this method, the target sampling point is a sampling point in the signal to be de-noised, and the signal to be de-noised may be a signal directly collected by the electronic device, or a signal collected by other devices and sent to the electronic device. Afterwards, the electronic device may also send the signal obtained after de-noising the de-noised signal back to the other device.

[0011] Specifically, the signal to be denoised may be an electrocardiogram signal, and the electrocardiogram signal may be a bioelectric signal of a biological body surface extracted by the electronic device through electrodes, and the collected electrocardiogram signal is composed of a plurality of sampling points arranged according to the sampling time. In the electrocardiogram signal, the value of the sampling point is the intensity or energy value of the bioelectric signal of the body surface during the acquisition. The plurality of sampling points are arranged in the order of the sampling time to form an electrocardiogram with a certain degree of fluctuation. Generally speaking, the QRS wave in the electrocardiogram signal is often the largest, most obvious, and sharpest. Mathematically, it is called the "singularity" or "mutation" of the QRS wave, which is manifested as a sudden change in slope. In other words, compared with the stationary segment signal in the electrocardiogram signal, the amplitude difference between two adjacent sampling points on the QRS wave group in the electrocardiogram signal is very large, which also leads to the absolute value of the slope between two adjacent sampling points in the QRS wave group is also very large.

[0012] The “presenting an opposite trend of change” means that the amplitude of the sampling point before the first sampling point is greater than the amplitude of the first sampling point, but the amplitude of the sampling point after the first sampling point is smaller than the amplitude of the first sampling point; or it means that the amplitude of the sampling point before the first sampling point is smaller than the amplitude of the first sampling point, but the amplitude of the sampling point after the first sampling point is greater than the amplitude of the first sampling point. Specifically, on the image, the first sampling point may be a sampling point located on a peak or trough in the signal to be detected.

[0013] In addition, the "sum of the rising or falling amplitudes" means either the sum of the rising amplitudes or the sum of the falling amplitudes. That is, from only one change trend, it is determined whether there is a sufficient number of continuous sampling points with a sharp rising amplitude among the j sampling points, or whether there is a sufficient number of continuous sampling points with a sharp falling amplitude among the j sampling points.

[0014] The j may be any integer greater than 1. In an optional implementation, the j may be determined according to the sampling frequency of the signal to be denoised. Specifically, the j may be equal to thirty percent of the sampling frequency of the signal to be denoised. For example, when the sampling frequency of the signal with denoising is 500, the j may be 500×0.3=150.

[0015] It should be understood that a wave can be regarded as two parts according to the change trend, namely the rising part (the amplitude of the sampling point is getting larger and larger) and the falling part (the amplitude of the sampling point is getting larger and larger). The peak of the wave rises first and then falls, and the trough of the wave falls first and then rises. Compared with the stable segment signal, the amplitude of the sampling point in the QRS complex may change with a fixed change trend for a longer time. For example, in the QS segment of the QRS complex, the amplitude of the signal first rises persistently and then falls persistently. That is to say, in the ECG signal, if a sub-signal is selected from the ECG signal with a time window of a fixed length (for example, a time window including 30 sampling points), if this sub-signal is a signal completely located in the QRS complex, then the amplitude of this sub-signal is likely to rise or fall sharply; and if this sub-signal is a signal located in the stable segment signal, then the change trend of the amplitude of this signal is likely to change many times, such as rising first and then falling, and then rising again and then falling... and so on. And the change amplitude of this sub-signal (reflected in the image as whether the wave is sharp enough) may be very small.

[0016] Therefore, the electronic device can use a change trend as a dimension for reference, and check the persistence and mutation of a signal determined by a sampling point in a change trend, that is, whether there is a continuous sampling point in a signal, and the number of these sampling points is sufficient and the amplitude keeps rising or falling sharply, to determine whether the signal is a signal on the QRS wave group, thereby determining whether the sampling point is a point on the QRS wave group or around the QRS wave group. Based on this, in this method, the electronic device can construct a feature sequence that can reflect whether this point is a sampling point on the QRS wave group based on the change trend and change amplitude of the amplitude of each sampling point and the sampling points around the sampling point. This feature sequence can be called the first feature sequence corresponding to this point.

[0017] It should be understood that, in the process of the electronic device denoising the signal to be denoised, the electronic device first determines a sampling point in the signal to be denoised as a target sampling point, and then determines the first characteristic sequence corresponding to the target sampling point in the manner described above. After processing the amplitude of the target sampling point, the electronic device will take the next sampling point of the target sampling point as a new target sampling point, and obtain the first characteristic sequence corresponding to the new target sampling point in the same manner. It is not difficult to understand that when the target sampling point changes, the first time window corresponding to the target sampling point will also move backward accordingly (generally by the position of one sampling point). In other words, the electronic device has used each sampling point before the target sampling point as a target sampling point, and obtained the first characteristic sequence corresponding to these sampling points.

[0018] In this method, after the electronic device determines the first feature sequence corresponding to the target sampling point, the electronic device will determine a threshold value according to the first feature sequence corresponding to the target sampling point and the first feature sequences corresponding to the v sampling points before the target sampling point, that is, the cumulative variation threshold value corresponding to the target sampling point. This cumulative variation threshold value represents a distribution range of the values ​​of most elements in the sequence obtained by splicing the first feature sequence corresponding to the target sampling point and the v first feature sequences corresponding to the v sampling points before the target sampling point. When the value of an element in the sequence is greater than or equal to the cumulative variation threshold value, it means that the value of the element is significantly greater than the values ​​of other elements in the sequence, that is, the element is an element that has undergone a mutation, which coincides with the mutation of the QRS complex in the electrocardiogram signal. Therefore, in this method, if the values ​​of the elements in the first feature sequence corresponding to the target sampling point are all less than the cumulative variation threshold corresponding to the target sampling point, it means that the target sampling point is likely to be a sampling point located in the stationary segment signal in the signal to be de-noised, and the electronic device can use the average filtering method to average the amplitude of the target sampling point and the amplitude of the m sampling points around the target sampling point to obtain the target value, and update the amplitude of the target sampling point to the target value, so as to achieve the denoising effect of the target sampling point. Correspondingly, if there is an element in the values ​​of the first feature sequence corresponding to the target sampling point whose value is greater than or equal to the cumulative variation threshold corresponding to the target sampling point, it means that the target sampling point is likely to be a sampling point located in the QRS complex in the signal to be de-noised, and in order to protect the characteristics of the QRS complex, the electronic device does not change the amplitude of the target sampling point.

[0019] This method uses the continuous mutation of the peak with reference significance in the ECG signal to identify whether the sampling point is a point on the signal wave with reference significance during denoising, thereby determining whether to perform denoising on the sampling point. By implementing this method, the ECG signal can be effectively denoised while ensuring the reference value of the ECG signal.

[0020] In combination with the first aspect, in a possible implementation, before averaging the amplitude of the target sampling point and the amplitudes of m sampling points around the target sampling point to obtain the target value, the method further includes: determining a first eigenvalue corresponding to the target sampling point, the first eigenvalue corresponding to the target sampling point representing the average of the absolute values ​​of the amplitude differences between each two adjacent sampling points in a time window including the target sampling point and containing (k+1) sampling points; averaging the amplitude of the target sampling point and the amplitudes of the m sampling points around the target sampling point to obtain the target value, including: when the values ​​in the first feature sequence corresponding to the target sampling point are all less than the cumulative variation threshold corresponding to the target sampling point, and the first eigenvalue corresponding to the target sampling point is less than the average variation threshold, averaging the amplitude of the target sampling point and the amplitudes of the m sampling points around the target sampling point to obtain the target value; the average variation threshold corresponding to the target sampling point is determined by the first eigenvalue corresponding to the target sampling point and the first eigenvalues ​​corresponding to i sampling points; in the signal to be denoised, the i sampling points are i sampling points before the target sampling point.

[0021] It should be understood that for some abnormal ECG signals, the direction of the R wave in the QRS complex in the signal may be reversed. For example, for some people with heart disease, the R wave in the QRS complex in their ECG signal may be inverted due to myocardial ischemia. In this case, the rising and falling trends of the sampling points in the R wave are reversed, and the changing trends between the peaks and troughs of the R wave and the PR and ST segments are also reversed. In this case, if the position of the target sampling point is analyzed only by constructing the first feature sequence corresponding to the target sampling point, it is likely that an erroneous conclusion will be drawn, and the amplitude of the target sampling point may be processed in an inappropriate manner during the denoising process. However, the first eigenvalue corresponding to the target sampling point only focuses on the amplitude change of the sampling point, not the change trend of the sampling point amplitude. This embodiment uses the first eigenvalue corresponding to the target sampling point and the first feature sequence corresponding to the target sampling point to judge the area where the target sampling point is located, which can greatly reduce the probability of judging the position of the sampling point on the abnormal ECG signal, determine whether the target signal point is a point located on the QRS wave group, and denoise the noise of the stable segment signal in the signal while retaining the characteristics of the Q wave and the S wave. In addition, even for normal ECG signals, the first eigenvalue corresponding to the target sampling point is also conducive to electronic devices to more quickly and accurately identify whether it is a sampling point on the R wave.

[0022] In combination with the first aspect, in a possible implementation, the method further includes: when there is at least one value in the first feature sequence corresponding to the target sampling point that is greater than or equal to the cumulative variation threshold corresponding to the target sampling point, keeping the amplitude of the target sampling point unchanged; and / or when the first feature value corresponding to the target sampling point is greater than or equal to the average variation threshold, keeping the amplitude of the target sampling point unchanged.

[0023] It should be understood that when there is at least one value in the first characteristic sequence corresponding to the target sampling point that is greater than or equal to the cumulative variation threshold corresponding to the target sampling point, the target sampling point is likely to be a point on the QRS complex; in addition, if the first characteristic value corresponding to the target sampling point is greater than or equal to the average variation threshold, then the target sampling point is likely to be a point on the QRS complex and is most likely to be a point on the R wave. Therefore, in this embodiment, in order to protect the reference value of the key wave in the signal after signal denoising, when the electronic device determines that the target sampling point is a point on the QRS complex, the electronic device keeps the amplitude of the target sampling point unchanged.

[0024] In combination with the first aspect, in a possible implementation, before determining the first characteristic sequence corresponding to the target sampling point, the method further includes: performing high-pass filtering and low-pass filtering on the initial signal to obtain the signal to be denoised, wherein the initial signal is an electrical signal collected by the electronic device and representing the user's heart rhythm.

[0025] In this embodiment, the electronic device also performs high-pass filtering and low-pass filtering on the initial signal to obtain the signal to be denoised, wherein the initial signal is an electrical signal representing the user's heart rhythm collected by the electronic device. The high-pass filter and low-pass filter used by the electronic device can be multi-order filters, which can filter out higher and lower frequency bands in the initial signal collected by the electronic device, especially those that may contain artifacts. This facilitates subsequent analysis and retains the frequency range of the signal to be analyzed, thereby improving the processing efficiency of the subsequent processing process.

[0026] Specifically, in the high frequency band, the electronic device can use a low-pass filter with a cut-off frequency lower than the AC power frequency (50 Hz or 60 Hz) to avoid power frequency interference. In the low frequency band, that is, the frequency band below 1 Hz, the electronic device can use a high-pass filter that retains the highest frequency band of the signal of interest.

[0027] In combination with the first aspect, in a possible implementation, in the time window including the target sampling point and containing (k+1) sampling points, the target sampling point is the last sampling point in the time window including the (k+1) sampling points; or, in the time window including the target sampling point and containing (k+1) sampling points, there is at least one sampling point before and after the target sampling point.

[0028] In this implementation manner, after the electronic device currently obtains the latest sampling point signal, the electronic device can obtain k sampling points before the sampling point, and calculate the average of the absolute values ​​of the amplitude differences between each two adjacent sampling points among the (k+1) sampling points ending with the sampling point as the first eigenvalue corresponding to the sampling point. In this way, the electronic device can process the newly obtained sampling point with zero delay, and can complete the processing process of the target sampling point more efficiently. Alternatively, after the electronic device currently acquires the signal of the latest sampling point, the electronic device may not process the sampling point immediately, but continue to acquire signals of several sampling points after the sampling point, and then acquire at least one sampling point before the sampling point and at least one sampling point before the sampling point with the sampling point as the base point, a total of k sampling points, and determine them together with the sampling point as the (k+1) sampling points, and calculate the average of the absolute values ​​of the amplitude differences between every two adjacent sampling points in the (k+1) sampling points as the first eigenvalue corresponding to the sampling point. In this way, although the electronic device cannot process the sampling point just acquired immediately, the target sampling point is taken as the sampling point in the middle position among the (k+1) sampling points, so that the calculated first eigenvalue corresponding to the target sampling point can more truly reflect the change trend of the target sampling point, and can more accurately judge whether the target sampling point is a point on the QRS complex.

[0029] In combination with the first aspect, in a possible implementation, determining the first feature sequence corresponding to the target sampling point includes: taking the target sampling point as a starting point, determining a first time window including (j+1) sampling points; sequentially calculating the amplitude difference between each sampling point and the next sampling point except the last sampling point in the first time window to obtain j differences; resetting the numbers less than 0 in the j differences to 0 to obtain the first sequence corresponding to the target sampling point; sequentially performing a forward accumulation reconstruction operation on the elements in the first sequence corresponding to the target sampling point to obtain the j elements, and using the j elements as the first feature sequence corresponding to the target sampling point; wherein the accumulation reconstruction operation includes: when the value of the element is 0, keeping the value of the element unchanged; when the value of the element is not zero, accumulating the value of the element with the value of the previous element until an element with a value of 0 is encountered, and using the value obtained by the forward accumulation as the reconstructed value of the element.

[0030] Specifically, in an optional implementation, the electronic device may determine the first characteristic sequence corresponding to the target sampling point from the target sampling point in the following manner:

[0031] 1) Assume x t is the target sampling point, the time window is taken as j+1, and the amplitude of each sampling point in the window is obtained to obtain the sequence X B , then X B =[x t ,x t+1 ……,x t+j ]; 2) Calculate X B The backward difference of adjacent elements in the sequence M is obtained. B1 , that is, M B1 =[x t -x t+1 ,...,x t+j-1 -x t+j ]; 3) for sequence M B1 The data less than zero in M ​​is set to zero, that is, B1 [M B1 <0]=0, get sequence M B2 ; 4) for sequence M B2 Each primitive performs a forward accumulation reconstruction operation to obtain the sampling point x t The corresponding first feature sequence M B Specifically, for the sequence M B2 If any element in is 0, then the position will still be 0 after reconstruction. If the position is not zero, forward accumulation will be terminated until an element of 0 is encountered. The value obtained by forward accumulation is the value of the position after reconstruction.

[0032] In this implementation, the cumulative change trend of the subsequent j sampling points around the target sampling point is quantified in the first feature sequence corresponding to the target sampling point by means of amplitude subtraction, negative value zeroing, and forward accumulation reconstruction, and the first feature sequences corresponding to two consecutive sampling points have multiple identical elements, which is conducive to the electronic device analyzing the data features of the target sampling point and determining the area where the target sampling point is located.

[0033] In combination with the first aspect, in a possible implementation, determining the first eigenvalue corresponding to the target sampling point includes: determining a second time window including (k+1) sampling points; in the second time window, there are n sampling points before the target sampling point, and there are (kn) sampling points after the target sampling point; sequentially calculating the absolute value of the difference between each sampling point in the second time window and the previous sampling point to obtain k absolute values ​​of the difference, and taking the average of the k absolute values ​​of the difference as the first eigenvalue corresponding to the target sampling point.

[0034] Specifically, in this embodiment, the electronic device can determine the first eigenvalue corresponding to the target sampling point from the target sampling point in the following manner: 1) Assuming x t is the target sampling point, the time window is k+1, and the amplitude of each sampling point in the window is obtained to obtain the sequence X A , then X A =[x t-a ,……,x t-1 ,x t ,x t+1 ,……,x t+b ], k = a + b; 2) Calculate the sequence X A Difference absolute value mean m A , m A The target sampling point x t The corresponding first eigenvalue;

[0035] That is, the electronic device can determine a second time window containing (k+1) sampling points based on the target sampling point; in the second time window, there are n sampling points before the target sampling point, and there are (kn) sampling points after the target sampling point; then the electronic device can sequentially calculate the absolute value of the difference between each sampling point and the previous sampling point in the second time window, obtain k absolute values ​​of the difference, and take the average value of the absolute values ​​of the k differences as the first eigenvalue corresponding to the target sampling point.

[0036] It should be understood that, in this embodiment, different from the cumulative variation degree of the sampling points characterized by the first characteristic sequence on a single change trend, since the first characteristic value corresponding to the target sampling point is based on the absolute value of the amplitude difference between the two sampling points, no matter how the change trend of the (k+1) sampling points changes, the change amplitude between the two sampling points is a number greater than 0. In other words, no matter whether the amplitude of the sampling points in the time window containing the (k+1) sampling points is continuously rising, continuously falling, or alternatingly rising and falling, the first characteristic value corresponding to the target sampling point is the average value of the total slope between each adjacent two sampling points in the (k+1) sampling points. Then for the sampling points on the QRS wave group, especially the sampling points on the R wave, the slope (i.e., the degree of mutation) between each point of the points around these sampling points and the previous sampling point and the next sampling point is very large, which means that the electronic device can easily determine whether the target sampling point is a QRS wave, especially a point on the R wave, based on the first characteristic value corresponding to the target sampling point, so as to determine whether the target sampling point needs to be denoised.

[0037] In combination with the first aspect, in a possible implementation, after determining the first feature sequence corresponding to the target sampling point, the method further includes: splicing the first feature sequence corresponding to the target sampling point with the v first feature sequences corresponding to the v sampling points to obtain a second sequence, determining an outlier corresponding to the second sequence using the quartile method, and determining the outlier corresponding to the second sequence as the cumulative variation threshold corresponding to the target sampling point.

[0038] In this embodiment, the above-mentioned cumulative variation threshold can be determined by the quartile method. Since a certain indication of the center, spread and shape of the data distribution is given, it has certain robustness and scientificity. Therefore, by determining the cumulative variation threshold corresponding to the target sampling point by the quartile method, it can accurately reflect to a certain extent whether there is an element with a numerical mutation in the first characteristic sequence corresponding to the target sampling point, and further reflect whether the target sampling point is a point on the QRS complex.

[0039] In combination with the first aspect, in a possible implementation, after determining the first eigenvalue corresponding to the target sampling point, the method further includes: constructing a third sequence using the first eigenvalue corresponding to the target sampling point and the i first eigenvalues ​​corresponding to the i sampling points; determining an outlier corresponding to the third sequence using the quartile method, and determining the outlier corresponding to the third sequence as the average variation threshold corresponding to the target sampling point.

[0040] Specifically,

[0041] Among them, "*" represents the product operation, C B This is the cumulative mutation threshold mentioned above, M B is the first feature sequence corresponding to the above target sampling point, M B-1 is the first feature sequence corresponding to the sampling point before the target sampling point, and so on; For M B-v , M B-v+1 , …, M B The sequence obtained by expanding and splicing multiple sequences is the second sequence mentioned above. express The 75th percentile number (upper quartile) of the sequence, express The 25th percentile number (lower quartile) of the sequence. The values ​​of k1 and k2 are k1=4, k2=3, or k1=2.5, k2=1.5. When k1=4, k2=3, C B is the extreme outlier corresponding to the second sequence; when k1=2.5, k2=1.5, C B is the moderate outlier corresponding to the second sequence. It is not difficult to see that, with the change of the target sampling point, the electronic device adaptively updates the above-mentioned cumulative variation threshold.

[0042] Similarly, in this embodiment, the average variation threshold corresponding to the target sampling point is determined by the quartile method, which can accurately reflect to a certain extent whether the target sampling point is an element with a numerical mutation in the third sequence, and further reflect whether the target sampling point is a point on the QRS complex (especially the R wave).

[0043] Specifically, the average variation threshold corresponding to the target sampling point can be expressed as

[0044] Among them, "*" represents the product operation, C A This is the cumulative mutation threshold mentioned above, M A is the first eigenvalue corresponding to the above target sampling point, M A-1 is the first eigenvalue corresponding to the sampling point before the target sampling point, and so on; This is the third sequence mentioned above. express The 75th percentile number (upper quartile) of the sequence, express The 25th percentile number (lower quartile) of the sequence. The values ​​of k1 and k2 are k1=4, k2=3, or k1=2.5, k2=1.5. When k1=4, k2=3, C Ais the extreme outlier corresponding to the third sequence; when k1=2.5, k2=1.5, C A is the moderate outlier corresponding to the third sequence. It is not difficult to see that with the change of the target sampling point, the electronic device will also adaptively update the above average variation threshold.

[0045] In combination with the first aspect, in one possible implementation, the cumulative variation threshold corresponding to the target sampling point is an extreme outlier value corresponding to the second sequence determined using the quartile method, and / or the average variation threshold corresponding to the target sampling point is an extreme outlier value corresponding to the third sequence determined using the quartile method.

[0046] In combination with the characteristics of the quartile method, in this embodiment, when the signal to be denoised is a signal such as an electrocardiogram signal that contains a new signal segment with a very large amplitude mutation, the electronic device can determine the cumulative variation threshold corresponding to the target sampling point as the extreme outlier corresponding to the second sequence, and / or determine the average variation threshold corresponding to the target sampling point as the extreme outlier corresponding to the third sequence.

[0047] In a second aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute a method as in the first aspect or any possible implementation of the first aspect.

[0048] In a third aspect, a chip system is provided, which is applied to an electronic device, and the chip system includes one or more processors, and the processors are used to call computer instructions so that the electronic device executes the method in the first aspect or any possible implementation of the first aspect.

[0049] In a fourth aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method in the first aspect or any possible implementation of the first aspect.

[0050] FIG1 is a waveform diagram of an EGG signal provided in an embodiment of the present application;

[0051] FIG2 is a line graph showing the degree of change of data in a series provided by an embodiment of the present application;

[0052] FIG3 is a schematic diagram illustrating a noise reduction result of an electrocardiogram signal provided in an embodiment of the present application;

[0053] FIG4 is a schematic diagram of the appearance of an electronic device provided in an embodiment of the present application;

[0054] FIG5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0055] FIG6 is a flow chart of a signal denoising method provided in an embodiment of the present application;

[0056] FIG7 is a schematic diagram of a variation trend of amplitude of a sub-signal in a signal to be denoised provided by an embodiment of the present application;

[0057] FIG8 is a schematic diagram of a process of obtaining a first feature sequence corresponding to a target sampling point based on the target sampling point according to an embodiment of the present application;

[0058] FIG9 is a schematic diagram showing a comparison between an initial signal image and a first characteristic sequence image provided by an embodiment of the present application;

[0059] FIG10 is a flow chart of a signal denoising method provided in an embodiment of the present application;

[0060] FIG11 is a schematic diagram showing a comparison between an initial signal image and a first eigenvalue image provided in an embodiment of the present application.

[0061] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.

[0062] Since the embodiments of the present application involve the application of neural networks, for ease of understanding, the relevant terms involved in the embodiments of the present application are first introduced below.

[0063] (1) ECG signal wave group and plateau signal

[0064] Electrocardiogram (ECG or EKG), also known as ECG signal, records the bioelectric signals generated during the contraction and relaxation of the heart. Each time the heart completes a complete electrical activity, it corresponds to an ECG waveform as shown in Figure 1, including P wave, QRS complex (including Q wave, R wave and S wave) and T wave. Among them, the first waveform on the electrocardiogram that deviates positively from the baseline is the P wave, and the second band is the QRS complex. The QRS complex consists of a series of 3 deviations, reflecting the current related to the depolarization of the left and right ventricles. The first negative deviation in the QRS complex is called the Q wave, the first positive deviation in the QRS complex is called the R wave, and the negative deviation after the R wave is called the S wave. The waveform with a rounded top after the QRS complex is the T wave, which represents the state of ventricular repolarization. A complete waveform including the above waves is called a beat. In a sufficiently long signal, the ECG signal between two complete waveforms (beats) also appears as a wave shape, but the fluctuation of these waves is much smaller than that of the waves in the QRS complex (including Q wave, R wave and S wave). In other words, the ECG signal between these two complete waveforms (beats) is relatively stable. Therefore, in this application, we can call the ECG signal between every two complete waveforms (beats) in a segment of ECG signal, that is, the signal at the end of FIG1 that appears to have a relatively stable fluctuation, a "stable segment signal".

[0065] In addition, it should be further explained that myoelectric noise, motion noise and other noises are the most serious interference to the stable signal in the ECG signal. Normally, in an ECG signal with good noise conditions, the image of the stable signal should be relatively flat, and there should not be such frequent and short peaks as shown in Figure 1. It is precisely because of these noise interferences and ECG signals that cause ECG signal distortion and make the entire ECG signal waveform unclear, which will affect the recognition of each ECG band, and the diagnosis results obtained by medical staff based on the ECG signal will also be affected. Therefore, choosing a suitable noise reduction method is of great significance for ECG examination.

[0066] Among the existing denoising algorithms, some algorithms may have little denoising effect on the stationary segment signal, while some denoising algorithms may have some effect on the stationary segment signal, but will cause greater interference to the QRS complex in the ECG signal. Therefore, how to effectively denoise the stationary segment signal while minimizing the interference to the QRS complex is the problem that this application focuses on solving.

[0067] (2) Electromyography (EMG)

[0068] Myoelectric noise, also known as electromyographic noise signal, is the noise caused by human activity and muscle tension, that is, the superposition of motor unit action potentials (MUAP) of muscle fibers in the human body in time and space. Muscle activity in the head and neck is the main source of EEG electromyographic interference, and muscle activity below the neck generally does not cause significant interference to EEG. Such interference has a small amplitude but a high frequency, ranging from 5Hz to 2000Hz, and appears as an irregular and rapidly changing waveform.

[0069] (3) Motion noise

[0070] Motion noise is caused by slight movements of the human body. Its main characteristic is mutation. The frequency range is generally between 3Hz and 14Hz, and the duration is also very short.

[0071] (4) Sampling points and sampling frequency

[0072] ECG signals are usually bioelectric signals on the body surface extracted by ECG equipment through electrodes. The collected ECG signals are composed of multiple sampling points in time order. The value of the sampling point is the intensity or energy value of the bioelectric signal on the body surface during the collection. The multiple sampling points are arranged in the order of sampling time to form an ECG.

[0073] The sampling frequency refers to the number of points that the recorder collects the voltage of the ECG signal per second. The higher the sampling frequency, the less distortion the ECG waveform will have, and the collected data will more accurately describe the continuous ECG waveform. When the sampling frequency is too low, the amplitude of the Q wave, R wave, and S wave will decrease, the waveform will be step-shaped, and the ECG will lose some meaningful information. Therefore, it is necessary to apply an appropriate sampling frequency.

[0074] (5) ECG acquisition equipment

[0075] In the embodiment of the present application, the ECG acquisition device is a device that has the functions of collecting ECG signals, analyzing ECG signals, etc., and can be an ECG acquisition device, an ECG machine, etc., or a wearable device or terminal with an ECG sensor, etc.

[0076] (6) High-pass filter and low-pass filter

[0077] A filter is a device that filters waves. It is a circuit that allows signals within a certain frequency band to pass through while blocking signals outside this frequency band from passing through.

[0078] There are two main types of filters: low-pass filters and high-pass filters. The working principle is that inductors prevent high-frequency signals from passing through and allow low-frequency signals to pass through, while capacitors prevent high-frequency signals from passing through and allow low-frequency signals to pass through. Low-pass filters use the principle that capacitors pass high frequencies and block low frequencies, and inductors pass low frequencies and block high frequencies. For high frequencies that need to be cut off, capacitors absorb and inductors block them from passing; for low frequencies that need to be released, capacitors have high resistance and inductors have low resistance to allow them to pass through. Similarly, high-pass filters prevent low-frequency signals from passing through and allow high-frequency signals to pass through.

[0079] (7) Quartiles and outliers

[0080] Quartile, also known as quartile point, refers to the values ​​at three dividing points when all values ​​are arranged from small to large and divided into four equal parts in statistics. It is mostly used in box plot drawing in statistics. It is the value at 25% and 75% after a set of data is sorted. Quartile is to divide all data into 4 parts by 3 points, each of which contains 25% of the data. Obviously, the middle quartile is the median (usually represented by Q2), so the quartiles usually refer to the values ​​at the 25% position (called the lower quartile, usually represented by Q1) and the values ​​at the 75% position (called the upper quartile, usually represented by Q3).

[0081] In a sequence, the outliers in the sequence can usually be calculated with the help of quartiles. Generally speaking, we can use Q3+k(Q3-Q1) as a threshold, and the values ​​in the sequence that are greater than this threshold are outliers, that is, values ​​that are significantly larger than other values ​​in the sequence. When K is 1.5, the above threshold is the moderate anomaly threshold, and the values ​​in the sequence that are greater than the moderate anomaly threshold are moderate outliers; when K is 3, the above threshold is the extreme anomaly threshold, and the values ​​in the sequence that are greater than the extreme anomaly threshold are extreme outliers.

[0082] For example, suppose that a sequence of 10 values ​​[2, 3, 5, 6, 6, 7, 8, 9, 50, 75] is constructed, most of which (8) fall in the interval [0, 10], but there are two exceptions, namely 50 and 75. The calculation method of the quartile value can be calculated that in this sequence, the lower quartile is Q1 = 3 × 0.25 + 5 × 0.75 = 4.5, the median Q2 = (7 + 8) / 2 = 7.5, and the upper quartile Q3 = 9 × 0.75 + 50 × 0.25 = 19.25. Combined with the above description, it can be seen that the moderate anomaly threshold in the above sequence is Q3 + 1.5 (Q3-Q1) = 33.375. Therefore, in the above sequence, values ​​greater than 33.375 are all outliers, that is, 50 and 75 in the sequence.

[0083] Furthermore, if these values ​​are plotted in the form of points in a two-dimensional rectangular coordinate system, a line graph as shown in FIG2 can be obtained. As shown in FIG2, except for the line segment between points A, B, C, and D, the fluctuation of the line graph formed by other line segments is relatively gentle (or the absolute value of the slope between two adjacent points is relatively small), but the fluctuation of the line graph formed by line segment AB, line segment BC, and line segment CD is significantly greater (or the absolute value of the slope between two adjacent points in points A, B, C, and D is relatively small). It can be understood that the image of the ECG signal has the same characteristics as the image shown in FIG2, that is, the ECG signal also has a stable signal segment and a signal segment with a relatively obvious waveform. In the present application, when denoising the stationary segment of the ECG signal, for a single sampling point, the amplitude of the sampling point and the amplitude of the sampling point close to the sampling point can be referred to, and the quartile method can be combined to determine whether the sampling point is a sampling point that needs to be denoised, so that the noise of the stationary segment signal in the ECG signal can be denoised without interfering with the peaks of the P wave, T wave and R wave in the ECG signal. For details, please refer to the subsequent description, which will not be repeated here.

[0084] Electrocardiogram (ECG) / ECG signal is a comprehensive manifestation of cardiac electrical activity on the human epidermis. It contains rich physiological and pathological information reflecting cardiac rhythm and its electrical conduction. To a certain extent, it can objectively reflect the physiological conditions of various parts of the heart. At present, it has become one of the important methods for non-invasive examination and diagnosis of cardiovascular diseases, and one of the important bases for evaluating whether the heart function is good.

[0085] Whether it is professionals in the hospital or inexperienced home users, in the process of collecting ECG signals, due to interference from various factors, such as turning over, exercise, power lines, etc., a lot of noise appears in the collected ECG signals, especially in the ECG collected by wearable ECG devices when the user is in a non-stationary state, which may contain a lot of noise. These noises will undoubtedly cause quality problems in the signal, and will also interfere with the feature recognition that affects the ECG, reducing the accuracy and reliability of ECG diagnosis. Therefore, it is very necessary to denoise the quality of the ECG signal. The noises in the ECG signal, such as myoelectric noise and motion noise, exist in the full frequency band of the ECG signal. Although the impact of these noises is small, it is difficult to completely eliminate them. The impact of these noises is more obvious in the stable section of the signal. When the traditional denoising method denoises these noises in the ECG signal, it is easy to interfere with the peaks of the P wave, T wave and R wave in the ECG signal; and the P wave, T wave and R wave are the key features of the ECG signal. When they are affected, the ECG signal loses its reference value.

[0086] FIG3 is a schematic diagram of a denoising result of an ECG signal provided in an embodiment of the present application. FIG3 (A) shows an image of an original ECG signal before denoising, FIG3 (B) shows an image of an ECG signal obtained by denoising the original ECG signal using an existing denoising method, and FIG3 (C) shows an image of an ECG signal obtained by denoising the original ECG signal using the denoising method provided in the present application.

[0087] As shown in (A) of FIG. 3 , the original ECG signal can be a wearable device with an ECG sensor, such as an ECG signal collected by a smart bracelet, a smart watch, etc., or a dynamic ECG instrument widely used in hospitals and other institutions, that is, a traditional twelve-lead ECG signal acquisition instrument. It should be understood that the original ECG signal is an ECG signal directly collected by the device and has not yet been denoised, but may have undergone some preprocessing. Combined with the above description, it can be seen that the ECG signal is a weak signal with strong nonlinearity, non-stationarity and randomness. In the process of collecting it, it is very susceptible to the influence of the internal and external environment, such as the movement of the human limbs, breathing, electromagnetic interference in the surrounding environment, etc. Therefore, the directly collected ECG signal is accompanied by a lot of noise, which can be expressed as frequent and short peaks in the ECG signal image, that is, the peak caused by noise shown in (A) of FIG. 3 . It can be seen from (A) of FIG. 3 that the influence of these noises is more obvious in the stable segment signal of the ECG signal. In addition to these peaks, there may be some peaks in the ECG signal that are not caused by noise, but are persistent and have reference significance, such as the P wave and R wave mentioned above. Therefore, ideally, when denoising the above original ECG signal, those frequent and short peaks, that is, the peaks caused by noise, should be suppressed without interfering with these peaks with reference significance. In this way, the noise in the ECG signal, especially the noise in the stable segment signal, can be effectively denoised without affecting the reference value of the ECG signal.

[0088] (B) in FIG3 shows an image of an ECG signal obtained after denoising the original ECG signal using an existing denoising method. It should be noted that, in order to facilitate comparison with the original ECG signal, (B) in FIG3 uses a solid line to represent the image of the ECG signal obtained after denoising, and uses a dotted line to represent the image of the ECG signal before denoising (i.e., the ECG signal shown in (A) in FIG3). It can be seen that by denoising the original ECG signal using an existing denoising method, the noise condition of the ECG signal obtained is significantly improved, the frequent and short peaks caused by noise in the image are significantly reduced, and the change trend of the stable segment signal in the ECG signal becomes simpler and clearer.

[0089] However, in the image shown in (B) of FIG. 3 , if the image of the ECG signal before denoising and the image after denoising are compared, it is not difficult to see that although the existing denoising method can have a certain denoising effect on the original ECG signal, after the original ECG signal is denoised, the peaks of the original ECG signal with important reference significance in the new ECG signal are offset (distorted). As shown in (B) of FIG. 3 , in the first beat of the ECG signal, the peak values ​​of the R wave, the P wave, and the T wave of the ECG signal after denoising are all smaller than the peak values ​​of the R wave, the P wave, and the T wave of the ECG signal before denoising. In medicine, for example, waves with reference significance such as P waves and T waves can usually reflect the health status of a person's heart. When these waves are distorted, the diagnosis results obtained by medical staff based on the ECG signals where these waves are located may be inaccurate, and in severe cases may even endanger the life safety of the patient.

[0090] Therefore, in response to the above problems, the present application provides a signal denoising method and electronic device, which can use the continuous mutation of the peak with reference significance in the ECG signal to identify whether the signal point is a point on the signal wave with reference significance during denoising, thereby determining whether to perform denoising on the signal point. By implementing this method, the ECG signal can be denoised without affecting the wave with reference significance in the ECG signal, that is, the ECG signal can be effectively denoised while ensuring the reference value of the ECG signal.

[0091] (C) in FIG3 shows an image of an ECG signal obtained after denoising the original ECG signal using the denoising method provided by the present application. Similarly, in order to facilitate comparison with the original ECG signal, (C) in FIG3 uses a solid line to represent the image of the ECG signal obtained after denoising, and uses a dotted line to represent the image of the ECG signal before denoising (i.e., the ECG signal shown in (A) in FIG3). It can be seen that by denoising the original ECG signal using the method provided by the present application, the noise condition of the ECG signal obtained is also significantly improved, the frequent and short peaks caused by noise in the image are significantly reduced, and the change trend of the stable segment signal in the ECG signal becomes simpler and clearer. In addition, the denoising method provided by the present application not only ensures the denoising effect on the stable segment signal, but also further ensures the reference value of the ECG signal - after the ECG signal is denoised, the overlap degree of the key peaks in the denoised signal and the original signal before denoising is extremely high. For example, in the first beat of the ECG signal shown in (C) in Figure 3, the R wave, P wave, and T wave of the denoised ECG signal are basically overlapped with the R wave, P wave, and T wave of the ECG signal before denoising.

[0092] First, the electronic device provided by the embodiment of the present application is introduced.

[0093] The electronic device may be a mobile phone, a tablet computer, a wearable device such as a smart bracelet and a smart watch, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA) or a dedicated camera (such as a SLR camera, a card camera), etc. The present application does not impose any restrictions on the specific type of the electronic device.

[0094] In the case where the electronic device is a wearable device such as a smart bracelet and a smart watch, the appearance of the electronic device can refer to Figure 4. Among them, (A) in Figure 4 shows the specific style of the electronic device when worn on the wrist of the user, and (B) in Figure 4 may show the specific style of the back side of the electronic device (i.e., the side that is in close contact with the user's skin when worn).

[0095] As shown in FIG4 , the above-mentioned electronic device may be provided with an ECG sensor to collect the user's ECG data. Usually, the ECG sensor includes two electrodes for collecting ECG signals. In FIG4 , the two electrodes of the ECG sensor (i.e., electrode 111 and electrode 112) are both arranged on the back of the electronic device. The electronic device may include a data conversion module 113 inside, and the data conversion module 113 may perform analog-to-digital conversion on the analog ECG signal collected by electrodes 111 and 112 to obtain a discrete digitized ECG signal. Afterwards, the processing module inside the electronic device (not shown in FIG4 ) may use the digitized ECG signal as the ECG signal to be denoised and apply the signal denoising method in the embodiment of the present application to denoise the signal to obtain a denoised ECG signal.

[0096] It should be understood that when the user uses the above electronic device to collect ECG signals, the user can press the dial 114 of the electronic device with a finger so that the electrodes 112 and 111 contact the user's arm.

[0097] Optionally, the electronic device may also analyze the noise-reduced ECG signal to obtain an analysis result. Furthermore, the electronic device may also output the analysis result through an output device, such as a display, a loudspeaker, and the like.

[0098] The above-mentioned electronic device can also send the ECG signal to be denoised to the terminal or server to which it is bound, and the terminal or server applies the ECG denoising method in the embodiment of the present application to perform denoising processing on the ECG signal to be denoised to obtain the ECG signal after denoising. The terminal or server can send the ECG signal after denoising to the above-mentioned electronic device, or send the analysis result obtained by analyzing the ECG signal after denoising.

[0099] The above electronic device equipped with an ECG sensor can monitor the wearer's ECG data in real time or periodically to monitor the wearer's physical condition. It can be understood that the electronic device in the embodiment of the present application is a smart terminal device, which, in addition to indicating time, also has one or more functions such as reminder, navigation, calibration, monitoring, and interaction; the display mode of the smart watch includes pointers, numbers, images, etc.

[0100] It should be noted that the schematic diagram of the appearance of the electronic device shown in FIG4 does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the appearance of the electronic device 100 may be different from that shown in FIG4; for example, in some embodiments, the dial 114 of the electronic device may be circular; for another example, one electrode 111 of the electrocardiogram sensor of the electronic device may be disposed on the back of the electronic device, and the other electrode 112 may be disposed on the side of the electronic device. When collecting electrocardiogram signals, the user may press the electrode 112 with a finger, and the electrode 111 contacts the user's arm.

[0101] FIG5 exemplarily shows the structure of the above electronic device.

[0102] As shown in Figure 5, the electronic device 100 can perform the signal denoising method provided in the embodiment of the present application. Specifically, as shown in Figure 5, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna, a wireless communication module 150, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a button 172, a display screen 171, a sensor module 180, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an acceleration sensor 180C, a capacitive proximity sensor 180D, an electrocardiogram sensor 180E, an ambient light sensor 180F, etc.

[0103] 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.

[0104] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors. The controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.

[0105] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved. At the same time, the processor 110 may also store data received by the electronic device 100 from other electronic devices.

[0106] For example, in some embodiments of the present application, the processor 110 can control the electronic device 100 to send the ECG signal to be denoised to the terminal or server to which it is bound, and the terminal or server applies the ECG denoising method in the embodiment of the present application to perform denoising on the ECG signal to be denoised to obtain the ECG signal after denoising. The electronic device 100 can receive the ECG signal after denoising sent by the terminal or server, or receive the analysis result obtained by the terminal or server analyzing the ECG signal after denoising.

[0107] When the electronic device 100 is a smart watch, the processor 110 controls the dial and base of the smart watch to obtain an initial ECG signal. Optionally, the processor 110 includes a filter device or a filter circuit, which can filter the initial ECG signal, filter out the higher and lower frequency bands of the initial ECG signal, and retain the signal to be analyzed. Furthermore, the processor 110 will also apply the signal denoising method in the embodiment of the present application to the signal obtained by filtering to perform denoising processing to obtain a denoised ECG signal.

[0108] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, a Micro USB interface, a USB Type C interface, etc.

[0109] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing audio, video and other files in the external memory card.

[0110] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as voice broadcast, image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0111] The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0112] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0113] The wireless communication function of the electronic device 100 can be implemented through an antenna, a wireless communication module 150, a modulation and demodulation processor, and a baseband processor. The electronic device 100 can communicate wirelessly with other electronic devices through the wireless communication module 150. The antenna is used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna. For example, the antenna can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0114] The wireless communication module 150 may be one or more devices integrating at least one communication processing module. The wireless communication module 150 may provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., applied to the electronic device 100. The wireless communication module 150 may be one or more devices integrating at least one communication processing module. The wireless communication module 150 receives electromagnetic waves via an antenna, modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 150 may also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna.

[0115] In some embodiments, the electronic device 100 can be communicatively connected with other electronic devices via the wireless communication module 150 .

[0116] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, and the application processor.

[0117] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0118] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0119] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.

[0120] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to microphone 170C to input the sound signal into microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0121] The key 172 includes a power key, a volume key, etc. The key 172 can be a mechanical key or a touch key. The electronic device 100 can receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0122] The electronic device 100 implements the display function through a GPU, a display screen 171, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 171 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0123] The display screen 171 is used to display images, videos, etc. The display screen 71 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 171, where N is a positive integer greater than 1.

[0124] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 71. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 71, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0125] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.

[0126] The acceleration sensor 180C can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.

[0127] The capacitive proximity sensor 180D may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the capacitive proximity sensor 180D to detect that the user holds the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The capacitive proximity sensor 180D can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0128] The ECG sensor 180E usually includes two electrodes for collecting ECG signals. The sinoatrial node in the human heart rhythmically controls the contraction and relaxation of the heart to pump blood to the trunk. This control signal is an electrical signal (human nerve signals are manifested as electrical signals on the nerves), which will gradually spread to the body surface and can be measured through electrodes on the skin. The ECG sensor 180E can detect bioelectricity when in contact with human skin and convert it into electrical signals. These electrical signals can be digitally processed by the processor 110 and converted into digital signals. The processor can further process these digitized signals in conjunction with the GPU to obtain an accurate and detailed electrocardiogram and display it on the display screen 171.

[0129] The ambient light sensor 180F is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 171 according to the perceived ambient light brightness. The ambient light sensor 180F can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the capacitive proximity sensor 180D to detect whether the electronic device 100 is in a pocket to prevent accidental touch.

[0130] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.

[0131] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 171 and the wireless communication module 150. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0132] FIG6 is a flow chart of a signal denoising method provided in an embodiment of the present application. The method uses the continuous mutation of the peaks with reference significance in the ECG signal to identify whether the signal point is a point on the signal wave with reference significance during denoising, thereby determining whether to perform denoising on the signal point. By implementing this method, the ECG signal can be denoised without affecting the waves with reference significance in the ECG signal, that is, the ECG signal can be effectively denoised while ensuring the reference value of the ECG signal. As shown in FIG6, the method provided in an embodiment of the present application may include but is not limited to the following steps:

[0133] S601: The electronic device determines a first characteristic sequence corresponding to a target sampling point.

[0134] The electronic device may be the electronic device shown in FIG. 4 , or may be the electronic device 100 in the foregoing description.

[0135] The target sampling point is a sampling point in the signal to be de-noised. The signal to be de-noised may be a signal directly collected by the electronic device, or may be a signal collected by other devices and sent to the electronic device.

[0136] Specifically, the signal to be denoised may be an electrocardiogram signal, which may be a bioelectric signal of a biological body surface extracted by the electronic device through electrodes. The collected electrocardiogram signal is composed of multiple sampling points sorted according to sampling time. In the electrocardiogram signal, the value of the sampling point is the intensity or energy value of the bioelectric signal of the body surface during collection. The multiple sampling points are arranged in the order of sampling time to form an electrocardiogram with a certain degree of fluctuation.

[0137] In an optional embodiment, before executing step S601, the electronic device also performs high-pass filtering and low-pass filtering on the initial signal to obtain the above-mentioned signal to be denoised, and the initial signal is an electrical signal collected by the electronic device that represents the user's heart rhythm. Among them, the high-pass filter and low-pass filter used by the electronic device can be multi-order filters, which can filter out higher and lower frequency bands in the initial signal collected by the electronic device, especially those that may contain artifacts. It is convenient for subsequent analysis and retains the frequency range of the signal to be analyzed, thereby improving the processing efficiency of the subsequent processing process. Specifically, in the high frequency band, the electronic device can use a low-pass filter with a cutoff frequency lower than the AC power frequency (50Hz or 60Hz) to avoid power frequency interference. In the low frequency band, that is, the frequency band below 1Hz, since the electronic device can use a high-pass filter that retains the highest frequency band of the signal of interest.

[0138] It should be understood that normal ECG signals usually appear as peaks (or troughs) with different degrees of fluctuation. Combined with the above description, it can be seen that in the ECG signal, there are several peaks with particularly obvious fluctuations, namely the Q wave, R wave and S wave in the QRS complex. The QRS complex has the highest peak R wave in the ECG. These ECG signals are important reference features in the ECG signal. For example, when the Q wave is abnormal, it means that the patient may be at risk of old myocardial infarction. Therefore, retaining the authenticity of the QRS complex in the ECG signal when denoising the signal is of great significance for judging the overall rhythm and frequency.

[0139] Generally speaking, the QRS wave in the ECG signal is often the largest, most obvious, and sharpest. Mathematically, this is called the "singularity" or "mutation" of the QRS wave, which is manifested as a sudden change in slope. In other words, compared with the stationary signal in the ECG signal, the amplitude difference between two adjacent sampling points on the QRS wave group in the ECG signal is very large, which also leads to a very large absolute value of the slope between two adjacent sampling points in the QRS wave group.

[0140] In addition, a wave can be regarded as two parts according to the change trend, namely the rising part (the amplitude of the sampling point is getting larger and larger) and the falling part (the amplitude of the sampling point is getting larger and larger). The peak of the wave rises first and then falls, and the trough of the wave falls first and then rises. Compared with the stable segment signal, the amplitude of the sampling point in the QRS complex may change with a fixed change trend for a longer time. For example, in the QS segment of the QRS complex, the amplitude of the signal first rises persistently and then falls persistently. That is to say, in the ECG signal, if a sub-signal is selected from the ECG signal with a time window of a fixed length (for example, a time window including 30 sampling points), if this sub-signal is a signal completely located in the QRS complex, then the amplitude of this sub-signal is likely to rise or fall sharply; and if this sub-signal is a signal located in the stable segment signal, then the change trend of the amplitude of this signal is likely to change many times, such as rising first and then falling, and then rising again and then falling... and so on. In addition, the change amplitude of this sub-signal (reflected in the image as whether the wave is sharp enough) may be very small.

[0141] Therefore, the electronic device can use a change trend as a dimension for reference, and check the persistence and mutation of a signal determined by a sampling point in a change trend, that is, whether there is a continuous sampling point in a signal, the number of these sampling points is sufficient and the amplitude keeps rising or falling sharply, to determine whether the signal is a signal on the QRS wave group, thereby determining whether the sampling point is a point on the QRS wave group or around the QRS wave group. Based on this, in this method, the above-mentioned electronic device can construct a feature sequence that can reflect whether this point is a sampling point on the QRS wave group based on the change trend and change amplitude of the amplitude of each sampling point and the sampling points around the sampling point. This feature sequence can be called the first feature sequence corresponding to this point.

[0142] Taking the above-mentioned target sampling point as an example for explanation, the first feature sequence corresponding to the above-mentioned target sampling point includes j elements, and the j elements correspond one-to-one to the j sampling points in the above-mentioned denoised signal. The element corresponding to any one of the above-mentioned j sampling points represents the sum of the rising or falling amplitudes of the sampling points between the above-mentioned any one sampling point and the first sampling point. The falling or rising amplitude of any one of the above-mentioned j sampling points is the difference between the amplitude of the above-mentioned any one sampling point and the amplitude of the next sampling point of the above-mentioned any one sampling point. The above-mentioned first sampling point is a sampling point located before the above-mentioned any one sampling point, presenting an opposite change trend with the above-mentioned any one sampling point, and being the closest to the above-mentioned any one sampling point.

[0143] The above “presenting an opposite trend of change” means that the amplitude of the previous sampling point of the first sampling point is greater than the amplitude of the first sampling point, but the amplitude of the next sampling point of the first sampling point is smaller than the amplitude of the first sampling point; or it means that the amplitude of the previous sampling point of the first sampling point is smaller than the amplitude of the first sampling point, but the amplitude of the next sampling point of the first sampling point is greater than the amplitude of the first sampling point. Specifically, on the image, the first sampling point can be a sampling point located on a peak or trough in the above-mentioned signal to be detected.

[0144] In addition, the above “sum of rising or falling amplitudes” means either the sum of rising amplitudes or the sum of falling amplitudes. That is, only one change trend is observed, and it is determined whether there is a sufficient number of continuous sampling points with a sharp rising amplitude among the above j sampling points, or whether there is a sufficient number of continuous sampling points with a sharp falling amplitude among the above j sampling points.

[0145] The j can be any integer greater than 1. In an optional embodiment, the j can be determined according to the sampling frequency of the signal to be denoised. Specifically, the j can be equal to 30% of the sampling frequency of the signal to be denoised. For example, when the sampling frequency of the signal with noise reduction is 500, the j can be 500×0.3=150.

[0146] For details, please refer to the line graph shown in FIG7. Here, it is assumed that the curve in FIG7 is the image of a sub-signal in the above-mentioned signal to be denoised, and the sub-signal is composed of ten sampling points from sampling point 701 to sampling point 710. In the coordinate system shown in FIG7, the vertical axis represents the amplitude of the sampling point, and the amplitude of the sampling point located at the top is larger. Assuming that sampling point 701 is the above-mentioned target sampling point, it can be seen from FIG7 that this section of the ECG signal starting with sampling point 701 and ending with sampling point 710 can be divided into 6 sections according to the amplitude change trend, namely, the rising section corresponding to sampling point 701-sampling point 702, the falling section corresponding to sampling point 702-sampling point 705, the rising section corresponding to sampling point 705-sampling point 706, the falling section corresponding to sampling point 706-sampling point 708, the rising section corresponding to sampling point 708-sampling point 709, and the falling section corresponding to sampling point 709-sampling point 710. The change trend of each sampling point depends on whether the sampling point is in the rising section or the falling section. For example, if sampling point 701 is in the rising segment, the change trend of sampling point 701 is rising; if sampling point 704 is in the falling segment, the change trend of sampling point 704 is falling; sampling point 702, sampling point 705, sampling point 706, sampling point 708, and sampling point 709 are critical points where the change trend changes, and their change trends can be rising or falling, which should be determined according to the change trend of the signal segment in which they are located.

[0147] Here, the sub-signal shown in FIG7 is analyzed with the descending trend as the reference dimension. With the descending trend as the reference dimension, there is no need to consider the degree and speed of change of the rising segment image. For the sampling points in FIG7, the change trends between all the sampling points in the rising segment corresponding to sampling point 701-sampling point 702, the rising segment corresponding to sampling point 705-sampling point 706, and the rising segment corresponding to sampling point 708-sampling point 709 can be defaulted to 0, that is, x 701 <x 702 (x t Indicates the amplitude corresponding to the sampling point t, for example x 701 That is, it represents the amplitude of the sampling point 701, the same below), then x 701 to x 702 The change of x is considered to be 0. 705 to x 706 The change range of x 708 to x 709 The change range is 0.

[0148] In the descending section corresponding to sampling point 702-sampling point 705, the change trend of sampling point 703-sampling point 705 is a descending trend. For any sampling point in sampling point 703-sampling point 705, sampling point 702 is the closest sampling point that is located before them and presents an opposite change trend with them, that is, sampling point 702 is the "first sampling point" of sampling points 703-705. Then the sum of the decline amplitudes of each sampling point in sampling point 703-sampling point 705 and sampling point 702 is x 702 -x 703 、x 702 -x 704 、x 702 -x 705 Similarly, in the descending section corresponding to sampling point 706-sampling point 708, the sum of the descending amplitudes of each sampling point in sampling point 703-sampling point 705 and sampling point 702 is x 06 -x 707 、x 706 -x 708 In the descending section corresponding to sampling point 709-sampling point 710, the sum of the descending amplitudes of sampling point 710 and sampling point 709 is x 709 -x 710 .

[0149] Then the first feature sequence corresponding to the sampling point 701 as the target sampling point contains j (in this case, j is equal to 9) elements, which are [0, x 702 -x 703 , x 702 -x 704 , x 702 -x705 ,0,x 706 -x 707 , x 706 -x 708 ,0,x 709 -x 710 ]. It can be seen that the nine sampling points corresponding to these nine elements are sampling points 702 to sampling points 710, and these nine elements represent the degree of cumulative change of the corresponding sampling points in their respective corresponding signal segments.

[0150] Specifically, in an optional implementation, the electronic device may determine the first characteristic sequence corresponding to the target sampling point from the target sampling point in the following manner:

[0151] 1) Assume x t is the target sampling point, the time window is taken as j+1, and the amplitude of each sampling point in the window is obtained to obtain the sequence X B , then X B =[x t ,x t+1 ……,x t+j ];

[0152] 2) Calculate X B The backward difference of adjacent elements in the sequence M is obtained. B1 , that is, M B1 =[x t -x t+1 ,...,x t+j-1 -x t+j ];

[0153] 3) For sequence M B1 The data less than zero in M ​​is set to zero, that is, B1 [M B1 <0]=0, get sequence M B2 ;

[0154] 4) For sequence M B2 Each primitive performs a forward accumulation reconstruction operation to obtain the sampling point x t The corresponding first feature sequence M B Specifically, for the sequence M B2 If any element in is 0, then the position will still be 0 after reconstruction. If the position is not zero, forward accumulation will be terminated until an element of 0 is encountered. The value obtained by forward accumulation is the value of the position after reconstruction.

[0155] That is, taking the target sampling point as the starting point, determine the first time window containing (j+1) sampling points; calculate the amplitude difference between each sampling point and the next sampling point except the last sampling point in the first time window in sequence, and obtain j differences; reset the numbers less than 0 in the j differences to 0, and obtain the first sequence corresponding to the target sampling point; perform a forward accumulation reconstruction operation on the elements in the first sequence corresponding to the target sampling point in sequence, and obtain the j elements, and use the j elements as the first feature sequence corresponding to the target sampling point; wherein the accumulation reconstruction operation includes: when the value of the element is 0, keep the value of the element unchanged; when the value of the element is not zero, add the value of the element to the value of the previous element until an element with a value of 0 is encountered, and use the value obtained by the forward accumulation as the reconstructed value of the element.

[0156] Take Figure 8 as an example for explanation. As shown in Figure 8, sampling point 801 in Figure 8 is the target sampling point. Here, j=9, then the 9 sampling points after sampling point 801, that is, sampling point 802-sampling point 809 in Figure 8 are the j sampling points corresponding to the j elements. Sampling point 801-sampling point 810 are the (j+1) sampling points, and the time window corresponding to sampling point 801-sampling point 810 is the first time window.

[0157] Among them, the amplitudes of sampling points 801-sampling point 810 are 5, 10, 9, 7, 4, 8, 3, 1, 8, 1 respectively (it should be understood that the amplitudes set here are only for the convenience of readers to understand, and do not represent the amplitudes of the signals to be denoised in actual scenarios, the same below). The amplitudes of sampling points 801-sampling point 810 are arranged in sequence, and a sequence [5, 10, 9, 7, 4, 8, 3, 1, 8, 1] is obtained. After that, the amplitude difference between each sampling point and the next sampling point in the above sampling points 801-sampling point 810 is calculated in sequence (the previous term minus the latter term, if there is no sampling point after sampling point 810, the calculation is stopped), and 9 differences are obtained, which are -5, 1, 2, 3, -4, 5, 2, -7, 7 respectively; these 9 differences are the above j differences. These 9 differences are arranged in sequence, and a new sequence [-5, 1, 2, 3, -4, 5, 2, -7, 7] is obtained. In order to simplify the variation range (i.e., only consider whether there is a stable and sharply decreasing sampling point in the signal), the numbers less than 0 in the new sequence are reset to 0, and the first sequence [0, 1, 2, 3, 0, 5, 2, 0, 7] corresponding to the above target sampling point (i.e., sampling point 801) is obtained. Finally, the elements in the first sequence corresponding to the sampling point 801 are sequentially subjected to forward accumulation and reconstruction operations to obtain the first feature sequence corresponding to the sampling point 801; wherein, the first element in the first sequence is 0, so the first element is still 0 after reconstruction; the second element is 1, and the forward accumulation is terminated when it encounters the 0 element, so it is still 1 after reconstruction; the third element is 2, and the forward accumulation is terminated when it encounters the 0 element, so after reconstruction it is 2+1=3; the fourth element is 3, and the forward accumulation is terminated when it encounters the 0 element, so after reconstruction it is 3+2+1=6; the fifth element is 0, so after reconstruction it is still 0; the sixth element is 5 after reconstruction; the seventh element is 2+5 after reconstruction; the eighth element is 0 after reconstruction; the ninth element is 7 after reconstruction; therefore, the first feature sequence finally obtained is [0, 1, 3, 6, 0, 5, 7, 0, 7].

[0158] S602: When the values ​​in the first feature sequence corresponding to the target sampling point are all smaller than the cumulative variation threshold corresponding to the target sampling point, the electronic device averages the amplitude of the target sampling point and the amplitudes of m sampling points around the target sampling point to obtain a target value, and updates the amplitude of the target sampling point to the target value.

[0159] The cumulative variation threshold corresponding to the target sampling point is determined by the first feature sequence corresponding to the target sampling point and v first feature sequences corresponding to v sampling points before the target sampling point. Specifically, the specific role and determination method of the first feature sequence corresponding to any sampling point among the v sampling points can refer to the above description of the first feature sequence corresponding to the target sampling point, which will not be repeated here.

[0160] It should be understood that, in the process of denoising the above-mentioned signal to be denoised by the above-mentioned electronic device, the electronic device first determines that a sampling point in the above-mentioned signal to be denoised is the target sampling point, and then determines the first feature sequence corresponding to the target sampling point in the manner described above. After processing the amplitude of the target sampling point, the electronic device will take the next sampling point of the above-mentioned target sampling point as the new target sampling point, and obtain the first feature sequence corresponding to the new target sampling point in the same way. It is not difficult to understand that when the target sampling point changes, the first time window corresponding to the target sampling point will also move backward accordingly (generally moving the position of one sampling point). Taking Figure 8 as an example, if there is a sampling point 800 with an amplitude of 9 before the sampling point 801, then before the electronic device aligns the sampling point 801 as the target sampling point for denoising, the sampling point 800 is the historical target sampling point, and the sequence composed of the amplitudes of the sampling points in the first time window corresponding to the sampling point 800 is [9, 5, 10, 9, 7, 4, 8, 3, 1, 8,]. Correspondingly, according to the above description, the first characteristic sequence corresponding to the sampling point 800 is [4, 0, 1, 3, 6, 0, 5, 7, 0] (here it is assumed that the sampling point 800 is a point on a peak or a trough).

[0161] That is to say, the electronic device has used each sampling point before the target sampling point as the target sampling point, and obtained the first characteristic sequence corresponding to these sampling points. In addition, it can be seen from the first characteristic sequences corresponding to the sampling point 800 and the sampling point 811 that, in the two first characteristic sequences corresponding to the two adjacent sampling points, except for the last element in the first characteristic sequence corresponding to the latter sampling point, the remaining elements are all elements in the first characteristic sequence corresponding to the previous sampling point.

[0162] In this method, after the electronic device determines the first feature sequence corresponding to the target sampling point, it will determine a threshold value according to the first feature sequence corresponding to the target sampling point and the first feature sequences corresponding to the v sampling points before the target sampling point, that is, the cumulative variation threshold value corresponding to the target sampling point. This cumulative variation threshold value represents a distribution range of the values ​​of most elements in the sequence obtained by splicing the first feature sequence corresponding to the target sampling point and the v first feature sequences corresponding to the v sampling points before the target sampling point. When the value of an element in the sequence is greater than or equal to the cumulative variation threshold value, it means that the value of the element is significantly greater than the values ​​of other elements in the sequence, that is, the element is an element that has undergone a mutation, which coincides with the mutation of the QRS wave group in the electrocardiogram signal. Therefore, in this method, if the values ​​of the elements in the first characteristic sequence corresponding to the target sampling point are all less than the cumulative variation threshold corresponding to the target sampling point, it means that the target sampling point is likely to be a sampling point located in the stationary segment signal in the above-mentioned signal to be de-noised, and the electronic device can use the average filtering method to average the amplitude of the target sampling point and the amplitude of the m sampling points around the target sampling point to obtain the target value, and update the amplitude of the target sampling point to the target value, so as to achieve the denoising effect of the target sampling point. Correspondingly, if there is an element in the values ​​of the first characteristic sequence corresponding to the target sampling point whose value is greater than or equal to the cumulative variation threshold corresponding to the target sampling point, it means that the target sampling point is likely to be a sampling point located in the QRS wave group in the above-mentioned signal to be de-noised, and in order to protect the characteristics of the QRS wave group, the above-mentioned electronic device does not change the amplitude of the above-mentioned target sampling point.

[0163] The process of the electronic device averaging the amplitudes of m sampling points can be summarized by the formula:

[0164] in, The electronic device is the target sampling point x t After noise reduction, the target sampling point x t The new amplitude m set can be equal to thirty percent of the sampling frequency of the above-mentioned signal to be denoised.

[0165] Specifically, the electronic device may concatenate the first feature sequence corresponding to the target sampling point with the v first feature sequences corresponding to the v sampling points to obtain a second sequence. The outlier corresponding to the second sequence is determined using the quartile method, and the outlier corresponding to the second sequence is determined as the cumulative variation threshold corresponding to the target sampling point. Optionally, the outlier corresponding to the second sequence is an extreme outlier corresponding to the second sequence. The above process of determining the outlier corresponding to the second sequence using the quartile method can be summarized as follows:

[0166] Among them, "*" represents the product operation, C B This is the cumulative mutation threshold mentioned above, M B is the first feature sequence corresponding to the above target sampling point, M B-1 is the first feature sequence corresponding to the sampling point before the target sampling point, and so on; For M B-v , M B-v+1 , …, M B The sequence obtained by expanding and splicing multiple sequences is the second sequence mentioned above. express The 75th percentile number (upper quartile) of the sequence, express The 25th percentile number (lower quartile) of the sequence. The values ​​of k1 and k2 are k1 = 4, k2 = 3, or k1 = 2.5, k2 = 1.5. When k1 = 4, k2 = 3, C B is the extreme outlier corresponding to the second sequence; when k1=2.5, k2=1.5, C B is the moderate outlier corresponding to the second sequence. It is not difficult to see that, with the change of the target sampling point, the electronic device adaptively updates the above-mentioned cumulative variation threshold.

[0167] Similarly, the first characteristic sequence corresponding to the sampling point 800 and the first characteristic sequence corresponding to the sampling point 801 in the above description are used as examples for description. For the sake of convenience, it is assumed here that the value of v is 1. Combined with the above description, it can be seen that the first characteristic sequence corresponding to the sampling point 800 is [4, 0, 1, 3, 6, 0, 5, 7, 0], and the first characteristic sequence corresponding to the sampling point 801 is [0, 1, 3, 6, 0, 5, 7, 0, 7], that is, M B =[0,1,3,6,0,5,7,0,7],M B-1 =[4,0,1,3,6,0,5,7,0]. Take k1 = 4, k2 = 3, then Since 25 is greater than If the value of any element in , the electronic device determines the target sampling point 801 as a sampling point on the stable segment, then the electronic device updates the amplitude of the target sampling point 801, and updates the amplitude of the target sampling point 801 to the average value of the sum of the amplitudes of the m sampling points around the sampling point 801.

[0168] Combined with the above description, it can be seen that since the amplitude of the sampling points in the QRS complex has continuous mutation (or there is a sufficiently large number of continuous sampling points, the amplitude of these sampling points keeps rising or falling sharply), it can be understood that for the sampling points on the QRS complex, the first feature sequence corresponding to these sampling points is likely to produce elements with larger values ​​due to the cumulative variation of the sampling point amplitude, so the first feature sequence corresponding to these sampling points is likely to have elements with values ​​greater than the cumulative variation threshold corresponding to these sampling points. Correspondingly, for the sampling points in the stationary signal, the first feature sequence corresponding to these sampling points is likely to be difficult to produce elements with larger values ​​due to the non-accumulative nature of the sampling point amplitude and the small variation between the amplitudes, so the first feature sequence corresponding to these sampling points is basically unlikely to have elements with values ​​greater than the cumulative variation threshold corresponding to these sampling points.

[0169] FIG9 shows an image of an initial signal without denoising and an image of a sequence obtained by splicing the first feature sequences corresponding to each sampling point in the initial signal. FIG9 (B) shows an image of an initial signal without denoising, which can be the image of the initial signal in the above description, and FIG9 (A) shows an image of the first feature sequence corresponding to each sampling point in the initial signal. Combined with the above description, it can be seen that in the two first feature sequences corresponding to two adjacent sampling points, except for the last element in the first feature sequence corresponding to the latter sampling point, the remaining elements are all elements in the first feature sequence corresponding to the previous sampling point. Therefore, multiple first feature sequences corresponding to multiple sampling points can be spliced ​​to obtain a sequence (the sampling point corresponding to each element in this sequence can be the sampling point corresponding to the first feature sequence ending with the element), and the image corresponding to this sequence is the image shown in FIG9 (A). It can be seen that, corresponding to the positions where the Q wave, R wave and S wave appear in the initial signal, the image shown in (A) in FIG9 also has obvious and sharp waves at these positions, which further verifies that the sampling points on the Q wave, R wave and S wave in the initial signal, and the corresponding first feature sequence are very likely to have elements with values ​​greater than the cumulative variation threshold corresponding to these sampling points. The electronic device can identify these sampling points more accurately without changing their amplitudes, and specifically denoise the noise of the sampling points in the stable segment signal, which can retain the original characteristics of the QRS complex in the ECG signal, and effectively denoise the ECG signal while ensuring the reference value of the ECG signal.

[0170] Based on the denoising method shown in FIG6 , the present application also provides another signal denoising method. This method not only refers to the continuous mutation of the peaks of reference significance, but also refers to the average variation degree of the peaks of reference significance in the ECG signal. When denoising, it identifies the sampling points on the waves of reference significance in the ECG signal, especially the sampling points on the R wave, so as to effectively avoid the suppression of the sampling points on these waves when denoising the signal. By implementing this method, the ECG signal can be effectively denoised while further ensuring the reference value of the ECG signal.

[0171] During denoising, it is determined whether the signal point is a point on the signal wave with reference significance, so as to determine whether to perform denoising on the signal point. By implementing this method, the ECG signal can be denoised without affecting the waves with reference significance in the ECG signal, that is, the ECG signal can be effectively denoised while ensuring the reference value of the ECG signal. As shown in FIG10 , the method provided in the embodiment of the present application may include but is not limited to the following steps:

[0172] S1001: The electronic device determines a first feature sequence corresponding to a target sampling point.

[0173] The electronic device may be the electronic device shown in FIG. 4 , or may be the electronic device 100 in the foregoing description.

[0174] The target sampling point is a sampling point in the signal to be de-noised. The signal to be de-noised may be a signal directly collected by the electronic device, or may be a signal collected by other devices and sent to the electronic device.

[0175] Specifically, the signal to be denoised may be an electrocardiogram signal, which may be a bioelectric signal of a biological body surface extracted by the electronic device through electrodes. The collected electrocardiogram signal is composed of multiple sampling points sorted according to sampling time. In the electrocardiogram signal, the value of the sampling point is the intensity or energy value of the bioelectric signal of the body surface during collection. The multiple sampling points are arranged in the order of sampling time to form an electrocardiogram with a certain degree of fluctuation.

[0176] The details of step S1001 can refer to the above description of step S601 in Figure 6, which will not be repeated here. It should be noted that in the embodiment of the present application, the electronic device can execute step S1001 and step S1002 in any order, that is, the electronic device can execute step S1001 first, and then execute step S1002; or the electronic device can execute step S1002 first, and then execute step S1001; or in some scenarios, the electronic device can execute step S1002 and step S1001 at the same time, and the present application does not limit this.

[0177] S1002: The electronic device determines a first eigenvalue corresponding to the target sampling point.

[0178] The first eigenvalue corresponding to the target sampling point represents the average of the absolute values ​​of the amplitude differences between every two adjacent sampling points in a time window including the target sampling point and containing (k+1) sampling points.

[0179] Combined with the above description, it can be seen that the QRS wave in the ECG signal is often the largest, most obvious, and sharpest. Mathematically, it is called the "singularity" or "mutation" of the QRS wave, which is manifested as a sudden change in slope. This mutation is more obvious in the R wave of the QRS wave group. Therefore, in order to enable the electronic device to better determine whether the above-mentioned target sampling point is a point in the above-mentioned QRS wave group, the electronic device can use the above-mentioned target sampling point as a base point to determine a time window containing (k+1) sampling points, and average the absolute value of the amplitude difference between each two adjacent sampling points in this time window to obtain the first eigenvalue corresponding to the above-mentioned target sampling point.

[0180] It should be understood that, unlike the cumulative variation degree of the sampling points characterized by the first characteristic sequence in a single change trend, since the first characteristic value corresponding to the target sampling point is based on the absolute value of the amplitude difference between the two sampling points, no matter how the change trend of the (k+1) sampling points changes, the change amplitude between the two sampling points is a number greater than 0. In other words, no matter whether the amplitude of the sampling points in the time window containing the (k+1) sampling points is continuously rising, continuously falling, or alternatingly rising and falling, the first characteristic value corresponding to the target sampling point is the average value of the total slope between each adjacent two sampling points in the (k+1) sampling points. Then for the sampling points on the QRS wave group, especially the sampling points on the R wave, the slope (i.e., the degree of mutation) between each point around these sampling points and the previous sampling point and the next sampling point is very large, which means that the electronic device can easily determine whether the target sampling point is a QRS wave, especially a point on the R wave, based on the first characteristic value corresponding to the target sampling point, so as to determine whether the target sampling point needs to be denoised.

[0181] Optionally, in the time window including the target sampling point and containing (k+1) sampling points, the target sampling point may be the last sampling point in the time window including the (k+1) sampling points; or, in the time window including the target sampling point and containing (k+1) sampling points, there is at least one sampling point before and after the target sampling point.

[0182] That is to say, after the electronic device currently obtains the latest sampling point signal, the electronic device can obtain k sampling points before the sampling point, and calculate the average of the absolute values ​​of the amplitude differences between each two adjacent sampling points among the (k+1) sampling points ending with the sampling point as the first eigenvalue corresponding to the sampling point. In this way, the electronic device can process the newly obtained sampling point with zero delay, and can complete the processing process of the target sampling point more efficiently. Alternatively, after the electronic device currently obtains the signal of the latest sampling point, the electronic device may not process the sampling point immediately, but continue to obtain signals of several sampling points after the sampling point, and then use the sampling point as a base point to obtain at least one sampling point before the sampling point and at least one sampling point before the sampling point, a total of k sampling points, which are determined together with the sampling point as the (k+1) sampling points, and the average of the absolute values ​​of the amplitude differences between each two adjacent sampling points in the (k+1) sampling points is calculated as the first eigenvalue corresponding to the sampling point. In this way, although the electronic device cannot process the sampling point just obtained immediately, the target sampling point is used as the sampling point in the middle of the (k+1) sampling points, so that the calculated first eigenvalue corresponding to the target sampling point can more truly reflect the change trend of the target sampling point, and can accurately judge whether the target sampling point is a point on the QRS complex.

[0183] Specifically, in an optional implementation manner, the electronic device may determine the first eigenvalue corresponding to the target sampling point from the target sampling point in the following manner:

[0184] 1) Assume x t is the target sampling point, the time window is k+1, and the amplitude of each sampling point in the window is obtained to obtain the sequence X A , then X A =[x t-a ,……,x t-1 ,x t ,x t+1 ,……,x t+b ], k = a + b;

[0185] 2) Calculate the sequence X A Difference absolute value mean m A , m A The target sampling point x t The corresponding first eigenvalue;

[0186] That is, the electronic device can determine a second time window containing (k+1) sampling points; in the second time window, there are n sampling points before the target sampling point, and there are (kn) sampling points after the target sampling point; then the electronic device can sequentially calculate the absolute value of the difference between each sampling point in the second time window and the previous sampling point, obtain k absolute values ​​of the difference, and take the average value of the absolute values ​​of the k differences as the first eigenvalue corresponding to the target sampling point.

[0187] S1003: When the values ​​in the first feature sequence corresponding to the target sampling point are all smaller than the cumulative variation threshold corresponding to the target sampling point, and the first feature value corresponding to the target sampling point is smaller than the average variation threshold, the electronic device averages the amplitude of the target sampling point and the amplitudes of m sampling points around the target sampling point to obtain a target value, and updates the amplitude of the target sampling point to the target value.

[0188] The cumulative variation threshold corresponding to the target sampling point is determined by the first feature sequence corresponding to the target sampling point and v first feature sequences corresponding to v sampling points before the target sampling point.

[0189] Specifically, the details of "the values ​​in the first feature sequence corresponding to the above-mentioned target sampling point are all less than the cumulative variation threshold corresponding to the target sampling point" and "the electronic device averages the amplitude of the target sampling point and the amplitudes of m sampling points around the target sampling point to obtain the target value, and updates the amplitude of the target sampling point to the target value" in step S1003 can be referred to the aforementioned description of step S602 in Figure 6, which will not be repeated here.

[0190] The average variation threshold corresponding to the target sampling point is determined by the first eigenvalue corresponding to the target sampling point and i first feature sequences corresponding to i sampling points before the target sampling point. Specifically, the specific role and determination method of the first eigenvalue corresponding to any sampling point among the i sampling points can refer to the above description of the first eigenvalue corresponding to the target sampling point, which will not be repeated here.

[0191] Similarly, in the process of the electronic device denoising the signal to be denoised, the electronic device first determines a sampling point in the signal to be denoised as a target sampling point, and then determines the first eigenvalue corresponding to the target sampling point in the manner described above. After processing the amplitude of the target sampling point, the electronic device uses the next sampling point of the target sampling point as a new target sampling point, and obtains the first eigenvalue corresponding to the new target sampling point in the same manner. It is not difficult to understand that when the target sampling point changes, the second time window corresponding to the target sampling point will also move backward accordingly (generally by the position of one sampling point). Taking FIG. 8 as an example, if there is a sampling point 800 with an amplitude of 100 before the sampling point 801, then before the electronic device aligns the sampling point 801 as the target sampling point for denoising, the sampling point 800 is the historical target sampling point, and the first eigenvalue corresponding to the sampling point 801 is (5+1+2+3+4+5+2+7+7) / 10=3.6; and the first eigenvalue corresponding to the sampling point 800 is (4+5+1+2+3+4+5+2+7) / 10=3.3.

[0192] That is to say, the electronic device has used each sampling point before the target sampling point as the target sampling point, and obtained the first eigenvalues ​​corresponding to these sampling points. In this method, after the electronic device determines the first eigenvalue corresponding to the target sampling point, the electronic device will determine a threshold value according to the first eigenvalue corresponding to the target sampling point and the first eigenvalues ​​corresponding to the i sampling points before the target sampling point, that is, the average variation threshold value corresponding to the target sampling point. This cumulative variation threshold represents a distribution range of the values ​​of most elements in the sequence after the sequence obtained by splicing the first eigenvalue corresponding to the target sampling point and the v first eigenvalues ​​corresponding to the i sampling points before the target sampling point. When the value of an element in the sequence is greater than or equal to the average variation threshold, it means that the value of the element is significantly greater than the values ​​of other elements in the sequence, that is, the element is an element that has undergone a mutation, which coincides with the mutation of the QRS wave group in the electrocardiogram signal, especially the mutation of the slope of the sampling point on the R wave. Therefore, in this method, if the first eigenvalue corresponding to the target sampling point is less than the average variation threshold corresponding to the target sampling point, it means that the target sampling point is likely to be a sampling point located in the stationary segment signal in the signal to be de-noised, and the electronic device can use the average filtering method to average the amplitude of the target sampling point and the amplitude of the m sampling points around the target sampling point to obtain a target value, and update the amplitude of the target sampling point to the target value, so as to achieve the denoising effect of the target sampling point. Correspondingly, if the first eigenvalue corresponding to the target sampling point is greater than or equal to the average variation threshold corresponding to the target sampling point, it means that the target sampling point is likely to be a sampling point located in the QRS complex in the signal to be de-noised, and in order to protect the characteristics of the QRS complex, the electronic device does not change the amplitude of the target sampling point.

[0193] Specifically, the electronic device may concatenate the first characteristic sequence value corresponding to the target sampling point with the i first characteristic values ​​corresponding to the i sampling points to obtain a third sequence. The quartile method is used to determine the abnormal value corresponding to the third sequence, and the abnormal value corresponding to the third sequence is determined as the cumulative variation threshold corresponding to the target sampling point. Optionally, the abnormal value corresponding to the third sequence is the extreme abnormal value corresponding to the second sequence. The above process of determining the abnormal value corresponding to the third sequence using the quartile method can be summarized as follows:

[0194] Among them, "*" represents the product operation, C A This is the cumulative mutation threshold mentioned above, M A is the first eigenvalue corresponding to the above target sampling point, M A-1is the first eigenvalue corresponding to the sampling point before the target sampling point, and so on; This is the third sequence mentioned above. express The 75th percentile number (upper quartile) of the sequence, express The 25th percentile number (lower quartile) of the sequence. The values ​​of k1 and k2 are k1=4, k2=3, or k1=2.5, k2=1.5. When k1=4, k2=3, C A is the extreme outlier corresponding to the third sequence; when k1=2.5, k2=1.5, C A is the moderate outlier corresponding to the third sequence. It is not difficult to see that with the change of the target sampling point, the electronic device will also adaptively update the above average variation threshold.

[0195] Similarly, the first characteristic sequence corresponding to the sampling point 800 and the first characteristic sequence corresponding to the sampling point 801 in the above description are used as examples for description. For the sake of convenience, it is assumed that the value of v is 1, i is 7, and the sampling point 801 is the target sampling point. The third sequence constructed based on the sampling point 801 is [6, 2.7, 4, 3.5, 5, 3.3, 3.6]. Combined with the above description, it can be seen that the first characteristic sequence corresponding to the sampling point 801 is [4, 0, 1, 3, 6, 0, 5, 7, 0], and the C sequence corresponding to the sampling point 801 is [4, 0, 1, 3, 6, 0, 5, 7, 0]. B =28; C corresponding to sampling point 801 A =4*5-3*3.3=10.1, m A =3.6;

[0196] The first characteristic sequence corresponding to the sampling point 801 is [4, 0, 1, 3, 6, 0, 5, 7, 0], and the values ​​of the elements are all less than 25, and the electronic device sets the first characteristic value m corresponding to the target sampling point 801 to A Less than C A , the electronic device will determine that the target sampling point 801 is a sampling point in the Q stationary segment signal, and the electronic device will update the amplitude of the target sampling point 801 to the average value of the sum of the amplitudes of the m sampling points around the sampling point 801.

[0197] It should be understood that for some abnormal ECG signals, the direction of the R wave in the QRS complex in the signal may be reversed. For example, for some people with heart disease, the R wave in the QRS complex in their ECG signal may be inverted due to myocardial ischemia. In this case, the rising and falling trends of the sampling points in the R wave are reversed, and the changing trends between the peaks and troughs of the R wave and the PR and ST segments are also reversed. In this case, if the position of the target sampling point is analyzed only by constructing the first feature sequence corresponding to the target sampling point, it is likely that an erroneous conclusion will be drawn, and the amplitude of the target sampling point may be processed in an inappropriate manner during the denoising process. However, the first eigenvalue corresponding to the target sampling point only focuses on the amplitude change of the sampling point, not the change trend of the sampling point amplitude. If the first eigenvalue corresponding to the target sampling point and the first feature sequence corresponding to the target sampling point are used together to judge the area where the target sampling point is located, the probability of judging the sampling point position on the abnormal ECG signal can be greatly reduced, and it can be determined whether the target signal point is located on the QRS wave group, and the noise of the stable segment signal in the signal can be denoised under the premise of retaining the characteristics of the Q wave and the S wave. In addition, even for normal ECG signals, the first eigenvalue corresponding to the target sampling point is also conducive to electronic equipment to more quickly and accurately identify whether it is a sampling point on the R wave.

[0198] In an optional embodiment, the first feature sequence and the first feature value corresponding to the target sampling point may correspond to the two data features FB and FA of the target sampling point respectively. A The average variation threshold C corresponding to the sampling point greater than or equal to the target A , then the characteristic F of the target sampling point A =1, otherwise F A =0; the first characteristic sequence M corresponding to the above target sampling point B There is at least one element greater than or equal to the cumulative variation threshold C corresponding to the target sampling point B , then the data F of the above target sampling point B =1, otherwise F B =0. Combined with the above description, it can be seen that for the amplitude corresponding to the target sampling point, if F A = 0 and F B =0, it means that the target sampling point is a sampling point in the stationary segment signal (suppression area), then the amplitude of the target sampling point is updated to the average value of the sum of the amplitudes of the m sampling points around the target sampling point; if F A With F BIf at least one of the data features has a value of 1, it means that the target sampling point is a sampling point in the QRS complex (non-inhibition area), and the amplitude of the target sampling point remains unchanged. The details are shown in Table 1 below:

[0199] Table 1

[0200] Similarly, since the amplitude of the sampling points in the QRS complex has continuous mutation, especially the sampling points on the R wave, the amplitude mutation is very obvious. It can be understood that for the sampling points on the QRS complex, the first characteristic sequence values ​​corresponding to these sampling points are likely to be greater than the average variation threshold corresponding to these sampling points due to the drastic change in the amplitude of the sampling points. Correspondingly, for the sampling points in the stationary signal, the first eigenvalues ​​corresponding to these sampling points are likely to be large values ​​due to the small variation between the amplitudes of the sampling points. Therefore, the first eigenvalues ​​corresponding to these sampling points are basically unlikely to be greater than the average variation threshold corresponding to these sampling points.

[0201] FIG11 shows an image of an initial signal without denoising and an image of the first characteristic sequence value corresponding to each sampling point in the initial signal. FIG11 (B) shows an image of an initial signal without denoising, which can be the image of the initial signal in the aforementioned description, and FIG11 (A) shows an image of the first characteristic value corresponding to each sampling point in the initial signal. It can be seen that, corresponding to the position where the R wave appears in the initial signal, the image shown in FIG11 (A) also has an obvious wave with a large amplitude at the corresponding position, which further verifies that the sampling point of the R wave in the initial signal, its corresponding first characteristic value is very likely to be greater than the average variation threshold corresponding to these sampling points, and the electronic device can more accurately identify these sampling points without changing their amplitude, and specifically denoise the noise of the sampling points in the stationary segment signal, which can retain the original characteristics of the R wave of the QRS complex in the electrocardiogram signal, and effectively denoise the electrocardiogram signal while ensuring the reference value of the electrocardiogram signal.

[0202] An embodiment of the present application also provides an electronic device, which includes: one or more processors and a memory; wherein the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute the method shown in the aforementioned embodiment.

[0203] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.

[0204] 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 program 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 can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can 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 can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.

[0205] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

Claims

A signal denoising method, characterized in that: include: Determine a first feature sequence corresponding to a target sampling point, the first feature sequence corresponding to the target sampling point includes j elements, the j elements correspond one-to-one to the j sampling points in the signal to be denoised, the element corresponding to any one of the j sampling points represents the sum of the rising or falling amplitudes of the sampling points between the any one sampling point and the first sampling point, the falling or rising amplitude of any one of the j sampling points is the difference between the amplitude of the any one sampling point and the amplitude of a sampling point after the any one sampling point, the first sampling point is a sampling point that is located before the any one sampling point, presents an opposite change trend with the any one sampling point, and is closest to the any one sampling point; When the values ​​in the first feature sequence corresponding to the target sampling point are all smaller than the cumulative variation threshold corresponding to the target sampling point, the amplitude of the target sampling point and the amplitudes of m sampling points around the target sampling point are averaged to obtain a target value, and the amplitude of the target sampling point is updated to the target value. The cumulative variation threshold corresponding to the target sampling point is determined by the first feature sequence corresponding to the target sampling point and v first feature sequences corresponding to v sampling points before the target sampling point. The method according to claim 1, characterized in that Before averaging the amplitude of the target sampling point and the amplitudes of m sampling points around the target sampling point to obtain the target value, the method further includes: determining a first eigenvalue corresponding to the target sampling point, the first eigenvalue corresponding to the target sampling point representing the average of the absolute values ​​of the amplitude differences between each two adjacent sampling points in a time window including the target sampling point and (k+1) sampling points; averaging the amplitude of the target sampling point and the amplitudes of m sampling points around the target sampling point to obtain the target value, including: averaging the amplitude of the target sampling point and the amplitudes of m sampling points around the target sampling point to obtain the target value when all values ​​in the first feature sequence corresponding to the target sampling point are less than the cumulative variation threshold corresponding to the target sampling point and the first eigenvalue corresponding to the target sampling point is less than the average variation threshold; the average variation threshold corresponding to the target sampling point is determined by the first eigenvalue corresponding to the target sampling point and the first eigenvalues ​​corresponding to i sampling points; in the signal to be denoised, the i sampling points are i sampling points before the target sampling point. The method according to claim 1 or 2, characterized in that The method further includes: when there is at least one value in the first feature sequence corresponding to the target sampling point that is greater than or equal to the cumulative variation threshold corresponding to the target sampling point, keeping the amplitude of the target sampling point unchanged; and / or when the first feature value corresponding to the target sampling point is greater than or equal to the average variation threshold, keeping the amplitude of the target sampling point unchanged. The method according to any one of claims 1 to 3, characterized in that Before determining the first characteristic sequence corresponding to the target sampling point, the method further includes: performing high-pass filtering and low-pass filtering on the initial signal to obtain the signal to be denoised, wherein the initial signal is an electrical signal representing the user's heart rhythm collected by the electronic device. The method according to any one of claims 2 to 4, characterized in that In the time window including the target sampling point and containing (k+1) sampling points, the target sampling point is the last sampling point in the time window including the (k+1) sampling points; or, in the time window including the target sampling point and containing (k+1) sampling points, there is at least one sampling point before and after the target sampling point. The method according to any one of claims 1 to 5, characterized in that The determining of the first characteristic sequence corresponding to the target sampling point includes: taking the target sampling point as a starting point, determining a first time window including (j+1) sampling points; sequentially calculating the amplitude difference between each sampling point and the next sampling point except the last sampling point in the first time window to obtain j difference values; resetting the numbers less than 0 in the j difference values ​​to 0 to obtain the first sequence corresponding to the target sampling point; sequentially performing a forward accumulation reconstruction operation on the elements in the first sequence corresponding to the target sampling point to obtain the j elements, and using the j elements as the first characteristic sequence corresponding to the target sampling point; wherein the accumulation reconstruction operation includes: when the value of the element is 0, keeping the value of the element unchanged; when the value of the element is not zero, accumulating the value of the element with the value of the previous element until an element with a value of 0 is encountered, and using the value obtained by the forward accumulation as the reconstructed value of the element. The method according to any one of claims 2 to 6, characterized in that The determining of the first eigenvalue corresponding to the target sampling point includes: determining a second time window including (k+1) sampling points; in the second time window, there are n sampling points before the target sampling point, and there are (kn) sampling points after the target sampling point; sequentially calculating the absolute value of the difference between each sampling point and the previous sampling point in the second time window to obtain k absolute values ​​of the difference, and taking the average value of the k absolute values ​​of the difference as the first eigenvalue corresponding to the target sampling point. The method according to any one of claims 1 to 7, characterized in that After determining the first feature sequence corresponding to the target sampling point, the method further includes: splicing the first feature sequence corresponding to the target sampling point with the v first feature sequences corresponding to the v sampling points to obtain a second sequence, determining an outlier corresponding to the second sequence using the quartile method, and determining the outlier corresponding to the second sequence as the cumulative variation threshold corresponding to the target sampling point. The method according to any one of claims 2 to 8, characterized in that After determining the first eigenvalue corresponding to the target sampling point, the method further includes: constructing a third sequence using the first eigenvalue corresponding to the target sampling point and the i first eigenvalues ​​corresponding to the i sampling points; determining an outlier corresponding to the third sequence using the quartile method, and determining the outlier corresponding to the third sequence as the average variation threshold corresponding to the target sampling point. The method according to any one of claims 8 or 9, characterized in that The cumulative variation threshold corresponding to the target sampling point is an extreme outlier corresponding to the second sequence determined by the quartile method, and / or the average variation threshold corresponding to the target sampling point is an extreme outlier corresponding to the third sequence determined by the quartile method. An electronic device, characterized in that: The electronic device comprises: one or more processors, a memory and a display screen; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code comprises computer instructions, and the one or more processors call the computer instructions so that the electronic device executes the method as described in any one of claims 1-10. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the method as described in any one of claims 1-10. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 10.