Search

CN-122001196-A - Filtering method of voltage ripple and electronic equipment

CN122001196ACN 122001196 ACN122001196 ACN 122001196ACN-122001196-A

Abstract

The embodiment of the invention relates to the technical field of communication and discloses a voltage ripple filtering method and electronic equipment, which comprise the steps of sampling voltage ripple to obtain N original voltage values, sequentially selecting one original voltage value ai from the N original voltage values according to the sequence, judging whether the original voltage value ai is an interference value, modifying the original voltage value ai according to a first modification strategy if the original voltage value ai is the interference value, judging whether the original voltage value ai+1 is the interference value according to the modified original voltage value ai, and modifying the original voltage value ai and the original voltage value ai+1 according to a second modification strategy if the original voltage value ai+1 is the interference value so as to filter the voltage ripple. The peak value or the valley value is prevented from being filtered, the accuracy of ripple value calculation is improved, erroneous judgment is prevented, and the accuracy of testing is improved.

Inventors

  • Hong Wentu

Assignees

  • 广州视源睿创电子科技有限公司
  • 广州视源电子科技股份有限公司

Dates

Publication Date
20260508
Application Date
20241107

Claims (11)

  1. 1. A method of filtering voltage ripple, comprising: Sampling the voltage ripple to obtain N original voltage values, and sequentially selecting one original voltage value a [ i ] from the N original voltage values according to the sequence, wherein i is a positive integer, and i is more than or equal to 3 and less than or equal to N-2; judging whether the original voltage value ai is an interference value or not; if the original voltage value ai is an interference value, modifying the original voltage value ai according to a first modification strategy, and judging whether the original voltage value ai+1 is the interference value according to the modified original voltage value ai; And if the original voltage value a [ i+1] is also an interference value, modifying the original voltage value a [ i ] and the original voltage value a [ i+1] according to a second modification strategy so as to filter voltage ripples.
  2. 2. The method according to claim 1, wherein determining whether the original voltage value a [ i ] is an interference value comprises: Constructing a target voltage value corresponding to the original voltage value a [ i ] according to the original voltage value a [ i ], the original voltage value a [ i-1] and the original voltage value a [ i-2 ]; if the target voltage value is larger than the reference value, the original voltage value ai is an interference value; And if the target voltage value is smaller than or equal to the reference value, the original voltage value ai is a normal value, i=i+1 is set, and the next original voltage value ai is selected from the N original voltage values.
  3. 3. The method of filtering voltage ripple according to claim 2, wherein constructing a target voltage value corresponding to the original voltage value a [ i ] according to the original voltage value a [ i ], the original voltage value a [ i-1] and the original voltage value a [ i-2] comprises: Acquiring a first difference value between the original voltage value a [ i ] and the original voltage value a [ i-1], and taking the absolute value of the first difference value as a first intermediate voltage value; acquiring a second difference value between the original voltage value a [ i-1] and the original voltage value a [ i-2], and taking the absolute value of the second difference value as a second intermediate voltage value; And acquiring a third difference value between the first intermediate voltage value and the second intermediate voltage value, and taking the absolute value of the third difference value as a target voltage value corresponding to the original voltage value ai.
  4. 4. The method of claim 1, wherein if the original voltage value a [ i ] is an interference value, modifying the original voltage value a [ i ] according to a first modification policy, and determining whether the original voltage value a [ i+1] is the interference value according to the modified original voltage value a [ i ] comprises: If the original voltage value ai is an interference value, acquiring an average value of the original voltage value ai-1 and the original voltage value ai+1, and modifying the original voltage value ai to be the average value; Re-calculating a target voltage value according to the modified original voltage value ai; If the recalculated target voltage value is greater than the reference value, the original voltage value a [ i+1] is the interference value.
  5. 5. The method according to claim 1, wherein modifying the original voltage value a [ i ] and the original voltage value a [ i+1] according to a second modification strategy if the original voltage value a [ i+1] is also an interference value comprises: If the original voltage value a [ i+1] is also an interference value, determining a change value according to a preset proportion condition, the original voltage value a [ i-1], the original voltage value a [ i+2] and the reference value; Comparing the magnitude relation between the original voltage value a [ i-1] and the original voltage value a [ i+2] to determine a data trend from the original voltage value a [ i-1] to the original voltage value a [ i+2 ]; And modifying the original voltage value ai and the original voltage value ai+1 according to the data trend, the preset proportion condition, the change value and the original voltage value ai+2 so as to filter interference, and selecting the next original voltage value ai from the N original voltage values.
  6. 6. The method of claim 5, wherein said comparing the magnitude relation between the original voltage value a [ i-1] and the original voltage value a [ i+2] to determine the trend of data from the original voltage value a [ i-1] to the original voltage value a [ i+2] comprises: if the original voltage value a [ i-1] is smaller than the original voltage value a [ i+2], the data trend from the original voltage value a [ i-1] to the original voltage value a [ i+2] is an ascending trend; If the original voltage value a [ i-1] is greater than or equal to the original voltage value a [ i+2], the trend of the data from the original voltage value a [ i-1] to the original voltage value a [ i+2] is a decreasing trend.
  7. 7. The method of claim 5, wherein the predetermined ratio condition is b [ i ]: b [ i+1]: b [ i+2] = 1:t:t+1, wherein t is greater than or equal to 2, b [ i ] = abs (a [ i ] -a [ i-1 ]), b [ i+1] = abs (a [ i+1] -a [ i ]), b [ i+2] = abs (a [ i+2] -a [ i+1 ]), and wherein abs () represents an absolute value taking operation.
  8. 8. The method of claim 7, wherein the trend of data from the original voltage value a [ i-1] to the original voltage value a [ i+2] is an upward trend or a downward trend; the modifying the original voltage value a [ i ] and the original voltage value a [ i+1] according to the data trend, the preset proportion condition, the variation value and the original voltage value a [ i+2] to filter interference comprises: if the data trend is an ascending trend, the modified original voltage value a [ i+1] =a [ i+2] -m× (t+1), and the modified original voltage value a [ i ] =a [ i+2] -m× (2t+1); if the data trend is a downward trend, the modified original voltage value a [ i+1] =a [ i+2] +m× (t+1), the modified original voltage value a [ i ] =a [ i+2] +m× (2t+1); Wherein m is a variation value.
  9. 9. The method of claim 7, wherein determining the change value according to the preset ratio condition, the original voltage value a [ i-1], the original voltage value a [ i+2] and the reference value if the original voltage value a [ i+1] is also an interference value comprises: If the original voltage value a [ i+1] is also an interference value, a fourth difference value between the original voltage value a [ i-1] and the original voltage value a [ i+2] is obtained, and the absolute value of the fourth difference value is divided by 2t+2 to obtain an intermediate value; Dividing the reference value by 2t+2 to obtain a reference value; if the intermediate value is greater than the reference value, taking the reference value as the change value; And if the intermediate value is smaller than or equal to the reference value, taking the intermediate value as the change value.
  10. 10. The method for filtering voltage ripple according to any one of claims 1 to 9, wherein the reference value is determined by: And obtaining an average value of the N original voltage values, and multiplying the average value by a preset coefficient to obtain the reference value.
  11. 11. An electronic device, comprising: At least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of filtering voltage ripple as claimed in any one of claims 1 to 10.

Description

Filtering method of voltage ripple and electronic equipment Technical Field The embodiment of the invention relates to the technical field of filtering, in particular to a voltage ripple filtering method and electronic equipment. Background The voltage fluctuation of the direct current power supply can cause ripple, when the ripple is large, the efficiency of the direct current power supply can be reduced, and when the ripple is serious, surge voltage or current can be generated, so that electric equipment is burnt. It is therefore necessary to ripple test the voltage output by the product to determine whether the product meets the design specification requirements. In the existing ripple test scheme, a single chip microcomputer is generally adopted to sample voltage ripple data within a certain time in real time so as to obtain a ripple value. Due to the interference of the sampling circuit, wiring and external environment, the sampled voltage ripple data can have some pulse interference, the voltage ripple data needs to be filtered to remove the pulse interference, and finally the ripple value is obtained through calculation, so that whether the product is qualified or not is judged according to the ripple value. In the process of filtering the voltage ripple data, when the interference value is filtered, part of wave crests and wave troughs are also filtered, so that the maximum value and the minimum value of the ripple may be changed, the calculated ripple value is inaccurate, and a bad product may be judged to be a qualified product, so that the test is abnormal. Disclosure of Invention The embodiment of the invention provides a filtering method of voltage ripples and electronic equipment, which are used for solving the problems that partial wave crests and wave troughs in the ripples are filtered, calculated ripple values are inaccurate, bad products can be judged to be qualified products, and testing is abnormal. The aim of the embodiment of the invention is realized by the following technical scheme: In order to solve the above technical problems, in a first aspect, an embodiment of the present invention provides a filtering method for voltage ripple, including: Sampling the voltage ripple to obtain N original voltage values, and sequentially selecting one original voltage value a [ i ] from the N original voltage values according to the sequence, wherein i is a positive integer, and i is more than or equal to 3 and less than or equal to N-2; judging whether the original voltage value ai is an interference value or not; if the original voltage value ai is an interference value, modifying the original voltage value ai according to a first modification strategy, and judging whether the original voltage value ai+1 is the interference value according to the modified original voltage value ai; And if the original voltage value a [ i+1] is also an interference value, modifying the original voltage value a [ i ] and the original voltage value a [ i+1] according to a second modification strategy so as to filter voltage ripples. In one embodiment, the determining whether the raw voltage value a [ i ] is an interference value comprises: Constructing a target voltage value corresponding to the original voltage value a [ i ] according to the original voltage value a [ i ], the original voltage value a [ i-1] and the original voltage value a [ i-2 ]; if the target voltage value is larger than the reference value, the original voltage value ai is an interference value; And if the target voltage value is smaller than or equal to the reference value, the original voltage value ai is a normal value, i=i+1 is set, and the next original voltage value ai is selected from the N original voltage values. In one embodiment, the constructing the target voltage value corresponding to the original voltage value a [ i ] according to the original voltage value a [ i ], the original voltage value a [ i-1] and the original voltage value a [ i-2] includes: Acquiring a first difference value between the original voltage value a [ i ] and the original voltage value a [ i-1], and taking the absolute value of the first difference value as a first intermediate voltage value; acquiring a second difference value between the original voltage value a [ i-1] and the original voltage value a [ i-2], and taking the absolute value of the second difference value as a second intermediate voltage value; And acquiring a third difference value between the first intermediate voltage value and the second intermediate voltage value, and taking the absolute value of the third difference value as a target voltage value corresponding to the original voltage value ai. In one embodiment, if the original voltage value a [ i ] is an interference value, modifying the original voltage value a [ i ] according to a first modification policy, and determining whether the original voltage value a [ i+1] is an interference value according to the modified original vo