An embedded pulse signal peak value detection method based on normal distribution statistical characteristics

CN122594801APending Publication Date: 2026-08-18BEIJING DAHUA RADIO INSTR FACTORY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610658838.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-13
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0005]复杂的检测算法虽然精度高(如小波分析,神经网络),但计算量大,不适合在STM32等资源受限的嵌入式平台上运行;

Benefits of technology

[0015] Compared with the prior art, the embedded pulse signal peak detection method based on normal distribution statistical characteristics provided by the present invention balances detection accuracy and computational efficiency, and is suitable for pulse signal peak detection on embedded platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122594801A_ABST
    Figure CN122594801A_ABST
Patent Text Reader

Abstract

The application discloses an embedded pulse signal peak value detection method based on normal distribution statistical characteristics, which comprises the following steps: signal smoothing processing: 3-point sliding average filtering is adopted to pre-process an original signal, and high-frequency noise interference is eliminated, and a calculation formula is as follows: wherein x is the original signal, and y is the filtered signal; dynamic threshold screening: the mean value mu and the standard deviation sigma of the smoothed signal y[i] are calculated, and N is the signal length; neighborhood extreme verification, pulse width verification and embedded adaptive optimization: through a three-stage detection system of multi-condition joint decision, accurate identification of the pulse signal is realized, the method is simple in calculation, occupies few resources, and is very suitable for an embedded platform with limited resources such as STM32.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to embedded signal processing technology, and more particularly to an embedded pulse signal peak detection method based on the statistical characteristics of normal distribution. It is applicable to pulse signal peak detection on resource-constrained embedded platforms such as STM32, and can be applied to fields such as digital power supply and sensor signal processing. Background Technology

[0002] In embedded system applications, accurate detection of pulse signals is crucial for device control and protection. For example, in switching power supplies, it is necessary to detect the switching pulses of power devices to determine their operating status; in current monitoring, it is necessary to capture overcurrent pulses to trigger protection mechanisms to prevent damage to power devices.

[0003] Traditional pulse detection methods have the following main shortcomings:

[0004] The method uses a fixed threshold for detection, but when there is baseline drift in the local signal, the false detection rate and false negative rate are high.

[0005] While complex detection algorithms (such as wavelet analysis and neural networks) have high accuracy, they are computationally intensive and not suitable for running on resource-constrained embedded platforms such as STM32.

[0006] The lack of verification of features such as pulse width makes it easy to misjudge random interference as valid signals.

[0007] In view of this, the present invention is hereby proposed. Summary of the Invention

[0008] The purpose of this invention is to provide an embedded pulse signal peak detection method based on the statistical characteristics of normal distribution, so as to solve the above-mentioned technical problems existing in the prior art.

[0009] The objective of this invention is achieved through the following technical solution:

[0010] An embedded pulse signal peak detection method based on the statistical properties of normal distribution includes the following steps:

[0011] A. Signal Smoothing Processing: A 3-point moving average filter is used to preprocess the original signal to eliminate high-frequency noise interference. The calculation formula is as follows: Where x is the original signal and y is the filtered signal;

[0012] B. Dynamic threshold screening: Calculate the mean μ and standard deviation σ of the smoothed signal y[i]: , where N is the signal length;

[0013] C. Neighborhood Extremum Verification: Verifying candidate peak points A 5-point neighborhood comparison is performed, where the 5 points include the current point and 2 points before and after it. Only when the current point is a local maximum value is the verification passed, ensuring the peak characteristics of the pulse and avoiding misjudging non-peak points.

[0014] D. Pulse Width Verification: Statistical analysis is performed based on local extreme points, where the signal value consistently exceeds the mean. The number of sampling points W, if W satisfies If the signal is too narrow or too wide, it is considered a valid pulse, thus eliminating signals that are too narrow or too wide and further improving detection accuracy.

[0015] Compared with the prior art, the embedded pulse signal peak detection method based on normal distribution statistical characteristics provided by the present invention balances detection accuracy and computational efficiency, and is suitable for pulse signal peak detection on embedded platforms. Detailed Implementation

[0016] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them, and do not constitute a limitation on the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the protection scope of the present invention.

[0017] First, the following explanations are provided for the terms that may be used in this article:

[0018] The terms “including,” “contains,” “comprising,” “having,” or other similar semantic descriptions shall be interpreted as non-exclusive inclusion.

[0019] The term "composed of" excludes any technical features not expressly listed. When used in a claim, it closes the claim to exclude all technical features other than those expressly listed, except for associated conventional impurities. If the term appears only in a clause of a claim, it limits the claim to the elements expressly listed in that clause; elements recited in other clauses are not excluded from the overall claim.

[0020] The technical solution provided by this invention will be described in detail below. Contents not described in detail in the embodiments of this invention are prior art known to those skilled in the art. Where specific conditions are not specified in the embodiments of this invention, they shall be performed according to conventional conditions in the art or conditions recommended by the manufacturer. Reagents or instruments used in the embodiments of this invention whose manufacturers are not specified are all conventional products that can be purchased commercially.

[0021] An embedded pulse signal peak detection method based on the statistical properties of normal distribution includes the following steps:

[0022] A. Signal Smoothing Processing: A 3-point moving average filter is used to preprocess the original signal to eliminate high-frequency noise interference. The calculation formula is as follows: Where x is the original signal and y is the filtered signal;

[0023] B. Dynamic threshold screening: Calculate the mean μ and standard deviation σ of the smoothed signal y[i]: , where N is the signal length;

[0024] C. Neighborhood Extremum Verification: Verifying candidate peak points A 5-point neighborhood comparison is performed, where the 5 points include the current point and 2 points before and after it. Only when the current point is a local maximum value is the verification passed, ensuring the peak characteristics of the pulse and avoiding misjudging non-peak points.

[0025] D. Pulse Width Verification: Statistical analysis is performed based on local extreme points, where the signal value consistently exceeds the mean. The number of sampling points W, if W satisfies If the signal is too narrow or too wide, it is considered a valid pulse, thus eliminating signals that are too narrow or too wide and further improving detection accuracy.

[0026] In step A, for boundary points (i=0 or i=N-1), the original signal value is directly used. To avoid distortion of boundary data.

[0027] In step B, a dynamic detection threshold is set based on the normal distribution characteristics. This threshold covers 95.4% of normal signal data, and the smoothed signal value of the candidate peak point is within ( The signal points in the interval are used to effectively eliminate baseline noise and abnormally large value interference, and solve the problem of poor adaptability of fixed threshold.

[0028] Embedded adaptation optimization:

[0029] A fixed-size array is used to store the original signal, smoothed signal, and peak marking results, avoiding dynamic memory allocation and reducing memory fragmentation and access latency on the STM32 platform;

[0030] The filter window size and pulse width range are configured through macro definitions, improving the flexibility and reusability of the method.

[0031] In summary, the embedded pulse signal peak detection method based on the statistical characteristics of normal distribution in this invention achieves accurate pulse signal identification through a three-level detection system with multi-condition joint decision. This method is simple to calculate and consumes few resources, making it very suitable for embedded platforms with limited resources, such as STM32.

[0032] To more clearly demonstrate the technical solution and its effects provided by the present invention, the embedded pulse signal peak detection method based on normal distribution statistical characteristics provided by the present invention will be described in detail below with specific embodiments.

[0033] An embedded pulse signal peak detection method based on the statistical properties of normal distribution includes the following steps:

[0034] Signal smoothing: A 3-point moving average filter is used to preprocess the original signal to eliminate high-frequency noise interference. The calculation formula is as follows: Where x is the original signal and y is the filtered signal. For boundary points (i=0 or i=N-1), the original signal value is used directly. To avoid distortion of boundary data.

[0035] Dynamic threshold filtering: Calculate the mean μ and standard deviation σ of the smoothed signal y[i]: Where N is the signal length. A dynamic detection threshold is set based on the normal distribution characteristics. This threshold covers approximately 95.4% of normal signal data, and the smoothed signal value of the candidate peak point is within ( The signal points in the interval can effectively eliminate baseline noise and abnormal large value interference, solving the problem of poor adaptability of fixed threshold.

[0036] Neighborhood extremum verification: for candidate peak points Perform a 5-point neighborhood comparison (the current point and 2 points before and after it). Only when the current point is a local maximum will the verification pass, ensuring the peak characteristics of the pulse and avoiding misjudging non-peak points.

[0037] Pulse width verification: Statistical analysis is performed starting from local extreme points, where the signal value consistently exceeds the mean. The number of sampling points W, if W satisfies (Configurable via macro definition), then it is determined to be a valid pulse, excluding signals that are too narrow or too wide, further improving detection accuracy.

[0038] Embedded adaptation optimization

[0039] A fixed-size array is used to store the original signal, smoothed signal, and peak marker results, avoiding dynamic memory allocation and reducing memory fragmentation and access latency on the STM32 platform. The filter window size and pulse width range can be configured through macro definitions, improving the flexibility and reusability of the method.

[0040] Example 1

[0041] This paper provides a detailed explanation of the technical feasibility and implementation logic of the present invention, taking into account the potential application scenarios of STM32F407 embedded platform and digital power supply overcurrent detection.

[0042] Hardware environment compatibility analysis

[0043] The main controller is an STM32F407VET6 with a 168MHz clock frequency and a built-in 12-bit ADC module. Its computing power can support the linear complexity operation of this method. The internal 64KB SRAM is sufficient to store signal data and intermediate results, without the need for additional storage expansion resources.

[0044] Signal acquisition: The power supply current signal is acquired using a Hall current sensor, and after being conditioned by an operational amplifier, it is input into the ADC channel of the STM32.

[0045] Storage module: Utilizes the STM32's internal 64KB SRAM to store signal data and intermediate results.

[0046] Output module: Outputs protection control signals via STM32's GPIO and outputs detection results via USART serial port.

[0047] Software implementation logic and feasibility verification:

[0048] System Initialization

[0049] After the system is powered on, the STM32 initializes the internal ADC module and configures it to 12-bit resolution and 100kHz sampling rate.

[0050] The DMA controller is activated to continuously acquire current signals, and the data is directly stored in a fixed array of length 1024. middle;

[0051] Configure the GPIO port to push-pull output mode to trigger overcurrent protection;

[0052] Configure the baud rate to 115200bps for the USART serial port to output the detection results.

[0053] Signal preprocessing stage:

[0054] Define storage smooth signal traverse the array ;

[0055] Starting from the second data point of the signal and ending at the second-to-last data point, perform smoothing calculations for each data point one by one:

[0056] 1. Take the current data point x[i], its previous neighbor x[i-1] and its next neighbor x[i+1], for a total of 3 consecutive data points;

[0057] 2. Sum the three data points and then take the arithmetic mean;

[0058] 3. Use the calculated average value as the value of the corresponding position y[i] of the smoothed signal.

[0059] The first data point of the signal (starting point): without any filtering calculation, the original signal value is directly retained and assigned to y[0]. The last data point of the signal (ending point): similarly without filtering calculation, the original signal value is directly retained and assigned to y[N-1]. The final array y[N] is the noise-reduced signal after smoothing preprocessing.

[0060] To reduce the load of floating-point operations, integer operations are used in the actual implementation: the sampled value is multiplied by 1000 and converted to an integer, filtered and then reduced by 1000. Division is achieved by right shifting by 2 bits (approximately dividing by 4) combined with error correction, which ensures calculation accuracy while improving efficiency.

[0061] Dynamic threshold calculation and candidate point selection:

[0062] Calculate the mean of the filtered signal. ) and standard deviation ( );

[0063] Define two double-precision floating-point variables: μ, These are used to store the mean and standard deviation of the filtered signal, respectively.

[0064] By iterating through all the filtered signal points y[N], the average value of the entire filtered signal, i.e., the mean μ, is obtained.

[0065] Iterate through all the filtered signal points y[N] again, calculate the square of the difference between the value of each point and the mean, sum all the squared values ​​and divide by the signal length N to get the variance, take the square root of the variance to get the standard deviation of the filtered signal. ;

[0066] The dynamic upper boundary threshold is calculated based on the statistical results: upper threshold = mean + 2 standard deviations. This threshold is an adaptive, dynamic judgment standard that changes with the signal.

[0067] Define a binary marker array candidate[N] of the same length as the filtered signal, specifically used to mark which points are candidate peak points:

[0068] Marked as 1: Candidate peak points that meet the conditions;

[0069] Marked as 0: Non-candidate point.

[0070] Each data point of the filtered signal y[N] is iterated through one by one and marked according to the following rules:

[0071] 1. If the current signal point is greater than the mean and less than or equal to the dynamic upper threshold (μ+2σ):

[0072] Assign the value 1 to candidate[i] to mark it as a valid candidate peak point;

[0073] 2. Points that do not meet the above conditions:

[0074] Assigning candidate[i] the value 0 indicates that it is not a candidate point.

[0075] Pulse verification phase:

[0076] For each candidate point, perform a 5-point neighborhood extreme value verification (compare the current point with the two points before and after it).

[0077] Define an array peak[N] to mark valid pulses, initialized to 0, peak[i] = 1 = valid pulse, peak[i] = 0 = invalid point / interference point;

[0078] Traverse from the 3rd point of the signal (i=2) to the 3rd point from the end (i=N-2);

[0079] Only the positions marked as candidate points (candidate[i] == 1) are validated; non-candidate points are skipped.

[0080] The default assumption is that the current point is an extreme point (is_extreme = 1);

[0081] Take out the two points before and after the current point, plus the current point itself, for a total of 5 consecutive points for comparison;

[0082] Inspection rules:

[0083] If the current point is less than or equal to any other point within the neighborhood of 5 points, it is determined not to be a peak value.

[0084] An extreme point is retained only when the current point is strictly greater than the four adjacent points before and after it.

[0085] After verifying the extreme values, we continue to verify the pulse width:

[0086] Starting from the current point, traverse to the right and count the number of points that are consecutively greater than the signal mean; this is the pulse width.

[0087] Check if the width is within the set range:

[0088] Valid if the pulse width is greater than or equal to the minimum pulse width (MIN_PULSE_WIDTH) and less than or equal to the maximum pulse width (MAX_PULSE_WIDTH);

[0089] Out of range → Determined as interference, discarded.

[0090] Width verification passed → peak[i] = 1, marking it as a valid pulse peak value;

[0091] Perform hardware actions immediately:

[0092] Control the PA5 pin to output a high level, triggering overcurrent protection (cut-off risk / alarm).

[0093] Protection and Output Phase:

[0094] Traverse the entire signal array one by one;

[0095] Check the peak[i] flag:

[0096] If peak[i] == 1, it is determined to be a valid pulse;

[0097] Print out the output according to the specified format:

[0098] Valid pulse position (array index i)

[0099] Pulse amplitude (filtered signal value y[i], rounded to 2 decimal places);

[0100] Used for system logs, host computer display, or subsequent data analysis.

[0101] Technical feasibility and performance expectations

[0102] Based on the hardware parameters of the STM32F407 platform and the algorithm complexity calculation of this method, the following performance expectations can be derived:

[0103] Real-time performance expectation: At a sampling rate of 100kHz, the acquisition time of 1024 points of signal is about 10ms, and the signal processing (filtering, threshold calculation, verification) time can be controlled within 1ms. The overall process time is far lower than the real-time requirements of most embedded scenarios.

[0104] Expected resource usage: The 1024-point signal array (double type) occupies approximately 8KB of memory, and the total memory usage of arrays such as smoothing signals and candidate point markers does not exceed 20KB, accounting for less than 30% of the internal SRAM of the STM32F407, indicating sufficient memory resources;

[0105] Detection accuracy expectation: based on normal distribution The threshold can filter out about 4.6% of abnormal signals (potential pulses) and exclude 95.4% of normal baseline signals, which greatly narrows the scope of subsequent verification and improves detection efficiency.

[0106] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims. The information disclosed in the background section is intended only to enhance the understanding of the overall background technology of the present invention and should not be construed as an admission or implication in any way that such information constitutes prior art known to those skilled in the art.

Claims

1. A method for detecting the peak value of an embedded pulse signal based on the statistical characteristics of normal distribution, characterized in that, Including the following steps: A, signal smoothing processing: using 3-point moving average filter to preprocess the original signal, eliminate high-frequency noise interference, the calculation formula is: Wherein, x is the original signal, y is the filtered signal; B. Dynamic threshold screening: Calculate the mean μ and standard deviation σ of the smoothed signal y[i]: where N is the signal length. C. Neighborhood Extremum Verification: Verifying candidate peak points A 5-point neighborhood comparison is performed, where the 5 points include the current point and 2 points before and after it. Only when the current point is a local maximum value is the verification passed, ensuring the peak characteristics of the pulse and avoiding misjudging non-peak points. D. Pulse Width Verification: Statistical analysis is performed based on local extreme points, where the signal value consistently exceeds the mean. The number of sampling points W, if W satisfies If the signal is too narrow or too wide, it is considered a valid pulse, thus eliminating signals that are too narrow or too wide and further improving detection accuracy.

2. The embedded pulse signal peak detection method based on normal distribution statistical characteristics according to claim 1, characterized in that: In step A, for boundary points (i=0 or i=N-1), the original signal value is directly used. To avoid distortion of boundary data.

3. The embedded pulse signal peak detection method based on normal distribution statistical characteristics according to claim 2, characterized in that: In step B, a dynamic detection threshold is set based on the normal distribution characteristics. This threshold covers 95.4% of normal signal data, and the smoothed signal value of the candidate peak point is within ( The signal points in the interval are used to effectively eliminate baseline noise and abnormally large value interference, and solve the problem of poor adaptability of fixed threshold.

4. The embedded pulse signal peak detection method based on normal distribution statistical characteristics according to claim 1, 2, or 3, characterized in that, Embedded adaptation optimization: A fixed-size array is used to store the original signal, smoothed signal, and peak marking results, avoiding dynamic memory allocation and reducing memory fragmentation and access latency on the STM32 platform; The filter window size and pulse width range are configured through macro definitions, improving the flexibility and reusability of the method.