Method for stabilizing digital signal data
By setting boundaries and adjusting coefficients, the optical signals of the ambient light sensor and adjacent sensor are stabilized, and the problem of light signal jumping is solved, thereby achieving stable signal output and noise reduction.
Patent Information
- Application Number
- CN202111194135.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-09-27
- Filing Date
- 2021-10-13
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-10-13
AI Technical Summary
In the case of weak ambient light, the intensity of the light signal sensed by the ambient light sensor and the proximity sensor will jump over time, resulting in poor noise removal ability of the sensor.
By setting the positive limit range coefficient, the negative limit range coefficient, the stage adjustment coefficient and the trend adjustment coefficient, the digital input data are read and the difference calculation and trend judgment are performed, and the coefficient is dynamically adjusted to stabilize the signal output.
Effectively reduce signal noise, stabilize digital signal output, reduce buffer space and computing time occupancy, and is suitable for digital signal processors and hardware circuits.
Smart Images

Figure CN115878852B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to digital signals, and particularly to a method for stabilizing digital signal data. Background Art
[0002] In the case of weak ambient light, the intensity of the light signals sensed by sensors such as an Ambient Light Sensor (ALS) and a Proximity Sensor (PS) will fluctuate slightly over time. When the user reads a constantly fluctuating light intensity value from the sensor, the user may mistakenly think that the fluctuating value is caused by noise and misjudge that the noise removal ability of the sensor is poor. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a method for stabilizing digital signal data in view of the deficiencies of the prior art, which includes the following steps: (a) setting a positive limit range coefficient, a negative limit range coefficient, a phase adjustment coefficient, and a trend adjustment coefficient; (b) reading a digital input data; (c) outputting the value equal to the current read digital input data as the output value of this digital input data; (d) reading the next digital input data; (e) subtracting the output value of the previous digital input data from the value of the current read next digital input data to calculate the difference value; (f) determining whether the difference value is greater than the positive limit range coefficient. If so, subtracting the phase adjustment coefficient from the value of the current read next digital input data to output the output value of this next digital input data, defining the trend value equal to zero, and then executing step (j). If not, execute step (g); (g) determining whether the difference value is less than the negative limit range coefficient. If so, adding the phase adjustment coefficient to the value of the current read next digital input data to output the output value of this next digital input data, defining the trend value equal to zero, and then executing step (j). If not, execute step (h); (h) determining whether the value of the current read next digital input data is greater than the output value of the previous digital input data. If so, adding a base value to the trend value, and then executing step (j). If not, execute step (i); (i) determining whether the value of the current read next digital input data is less than the output value of the previous digital input data. If so, subtracting the base value from the trend value, executing step (j). If not, execute step (j); (j) determining whether the trend value is greater than the positive trend threshold value. If so, subtracting the trend adjustment coefficient from the output value of the previous digital input data to output the output value of this next digital input data, and then returning to step (d) to read the next digital input data. If not, execute step (k); (k) determining whether the trend value is less than the negative trend threshold value. If so, adding the trend adjustment coefficient to the output value of the previous digital input data to output the output value of this next digital input data, and then returning to step (d) to read the next digital input data. If not, execute step (l); and (l) outputting the output value equal to the output value of the previous digital input data as the output value of the current read next digital input data, and then returning to step (d) to read the next digital input data.
[0004] In this embodiment, the method for stabilizing digital signal data further includes the following step: (m) defining the value of the first read digital input data as a central value.
[0005] In this embodiment, the method for stabilizing digital signal data further includes the following steps: (n) Determine whether the difference is greater than the positive limit range coefficient. If so, subtract the stage adjustment coefficient from the value of the next digital input data currently read to calculate a first central value, update the central value to be equal to the first central value, output the value equal to the first central value as the output value of the next digital input data, and then execute step (j). If not, execute step (o); and (o) Determine whether the difference is less than the negative limit range coefficient. If so, add the stage adjustment coefficient to the value of the next digital input data currently read to calculate a second central value, update the central value to be equal to the second central value, output the value equal to the second central value as the output value of the next digital input data, and then execute step (j). If not, execute step (h).
[0006] In this embodiment, the method for stabilizing digital signal data further includes the following steps: (p) Calculate the change amplitude of the central value; and (q) Dynamically adjust one or more of the positive limit range coefficient, negative limit range coefficient, stage adjustment coefficient, and trend adjustment coefficient according to the change amplitude of the central value.
[0007] In this embodiment, the method for stabilizing digital signal data further includes the following steps: (r) Set the absolute value of the negative limit range coefficient to be equal to the positive limit range coefficient.
[0008] In this embodiment, the method for stabilizing digital signal data further includes the following steps: (s) Set the trend adjustment coefficient to be less than any one or more of the positive limit range coefficient, the absolute value of the negative limit range coefficient, and the stage adjustment coefficient.
[0009] In this embodiment, the method for stabilizing digital signal data further includes the following steps: (t) Set the trend adjustment coefficient so that the ratio of the trend adjustment coefficient to the positive limit range coefficient or the negative limit range coefficient conforms to a preset trend limit ratio.
[0010] In this embodiment, the method for stabilizing digital signal data further includes the following steps: (u) Set the trend adjustment coefficient so that the ratio of the trend adjustment coefficient to the stage adjustment coefficient conforms to a preset trend stage ratio.
[0011] In this embodiment, the method for stabilizing digital signal data further includes the following steps: (v) Before adding or subtracting the trend value from the base value, set the trend value to zero.
[0012] In this embodiment, the method for stabilizing digital signal data further includes the following steps: (w) Automatically adjust the base value according to the value of each digital input data so that the ratio of the value of the digital input data to the base value conforms to a preset ratio.
[0013] As described above, the present invention provides a method for stabilizing digital signal data, characterized in that:
[0014] 1. By setting the boundary range coefficient, stage adjustment coefficient, and trend adjustment coefficient, the digital signal is corrected through an algorithm to reduce signal noise, thereby achieving the effect of stabilizing the digital signal output;
[0015] 2. The boundary range coefficient, stage adjustment coefficient, and trend adjustment coefficient can be set according to the user's needs, or automatically adjusted after adopting other automatic judgment mechanisms (such as according to the change range of the input or output value);
[0016] 3. The value of the current digital input data read can be compared with the output value of the previous digital input data in real time, without occupying too much buffer space and computing time;
[0017] 4. It can be processed in cooperation with other digital signal processors, such as digital filters, averagers, etc.;
[0018] 5. It can be implemented by digital hardware circuits or software.
[0019] To further understand the features and technical content of the present invention, please refer to the following detailed description and diagrams of the present invention. However, the provided diagrams are only for reference and illustration, and are not used to limit the present invention. Brief Description of the Drawings
[0020] Figure 1 It is the first step flowchart of the method for stabilizing digital signal data according to the embodiment of the present invention.
[0021] Figure 2 It is the second step flowchart of the method for stabilizing digital signal data according to the embodiment of the present invention.
[0022] Figure 3 It is the third step flowchart of the method for stabilizing digital signal data according to the embodiment of the present invention.
[0023] Figure 4 It is the fourth step flowchart of the method for stabilizing digital signal data according to the embodiment of the present invention.
[0024] Figure 5 It is the fifth step flowchart of the method for stabilizing digital signal data according to the embodiment of the present invention.
[0025] Figure 6 It is the schematic diagram of the operation architecture of the method for stabilizing digital signal data according to the embodiment of the present invention.
[0026] Figure 7The first schematic diagram of the numerical values of multiple digital input data when the boundary range coefficient and the stage adjustment coefficient for the digital signal data stabilization method according to the embodiments of the present invention are both 2, but the trend adjustment coefficient is 0.
[0027] Figure 8 The first tabular schematic diagram of the numerical values of multiple digital input data when the boundary range coefficient and the stage adjustment coefficient for the digital signal data stabilization method according to the embodiments of the present invention are both 2, but the trend adjustment coefficient is 0.
[0028] Figure 9 The second schematic diagram of the numerical values of multiple digital input data when the boundary range coefficient and the stage adjustment coefficient for the digital signal data stabilization method according to the embodiments of the present invention are both 2, but the trend adjustment coefficient is 1.
[0029] Figure 10 The second tabular schematic diagram of the numerical values of multiple digital input data when the boundary range coefficient and the stage adjustment coefficient for the digital signal data stabilization method according to the embodiments of the present invention are both 2, but the trend adjustment coefficient is 1. Detailed implementation manners
[0030] The following are specific embodiments to illustrate the implementation manners of the present invention. Those skilled in the art can understand the advantages and effects of the present invention from the content disclosed in this specification. The present invention can be implemented or applied through other different specific embodiments, and various details in this specification can also be modified and changed based on different viewpoints and applications without departing from the concept of the present invention. Additionally, the drawings of the present invention are only for simple schematic illustration and are not drawn according to actual dimensions, stated in advance. The following implementation manners will further detail the related technical content of the present invention, but the disclosed content is not used to limit the protection scope of the present invention. In addition, the term "or" used herein should, depending on the actual situation, possibly include any one or a combination of more of the associated listed items.
[0031] Please refer to Figure 1 and Figure 6 where Figure 1 is the first step flowchart of the digital signal data stabilization method according to the embodiments of the present invention; Figure 6 is the schematic diagram of the operation architecture of the digital signal data stabilization system according to the embodiments of the present invention.
[0032] The digital signal data stabilization method according to the embodiments of the present invention may include steps S101 to S111 as shown in Figure 1 , and is applicable to the operation architecture as shown in Figure 6 . It should be understood that the execution order and content of the steps described herein can be appropriately adjusted according to actual needs, or certain steps can be appropriately omitted.
[0033] In step S101, read the first digital input data.
[0034] In step S103, define the center value equal to the value of the first digital input data.
[0035] In step S105, output the value of the first digital input data. That is, output the value equal to the center value.
[0036] In step S107, read the next digital input data.
[0037] In step S109, subtract the output value of the previous digital input data from the value of the currently read next digital input data to calculate a difference value in step S111. It should be understood that if the currently read next digital input data is the second digital input data, then the previous digital input data is the first digital input data described in step S101.
[0038] As Figure 6 shown, in stage P1 (through the subtractor), subtract the value of the previous digital input data obtained in stage P12 from the value of the currently read digital input data.
[0039] Please refer to Figure 2 and Figure 6 where Figure 2 is the second step flowchart of the method for stabilizing digital signal data according to an embodiment of the present invention; Figure 6 is a schematic diagram of the operation architecture of the method for stabilizing digital signal data according to an embodiment of the present invention.
[0040] The method for stabilizing digital signal data according to an embodiment of the present invention may include steps S201 to S223 as Figure 2 shown, which is applicable to the operation architecture as Figure 6 shown.
[0041] In step S201, set the positive value limit range coefficient.
[0042] In step S203, set the negative value limit range coefficient. For example, the value of the negative value limit range coefficient can be set equal to the value of the positive value limit range coefficient, that is, the absolute value of the negative value limit range coefficient is equal to the positive value limit range coefficient. [[ID=**42**]] [[ID=**43**]]
[0043] [[ID=**44**]]In step S205, set the stage adjustment coefficient. [[ID=**45**]] [[ID=**46**]]
[0044] [[ID=**47**]]In step S207, set the trend adjustment coefficient. [[ID=**48**]] [[ID=**49**]]
[0045] In addition, the trend value can be initially set to zero. For example, a trend adjustment coefficient can be set such that the ratio of the trend adjustment coefficient to the stage adjustment coefficient conforms to a preset trend stage ratio. For example, but not limited to, the trend adjustment coefficient is 1 / 2 of the stage adjustment coefficient. In addition, a trend adjustment coefficient can be set such that the ratio of the trend adjustment coefficient to the positive limit range coefficient or the negative limit range coefficient conforms to a preset trend limit ratio. For example, but not limited to, the trend adjustment coefficient is 1 / 2 of the positive limit range coefficient.
[0046] In step S209, it is judged whether the difference calculated in step S109 is greater than the positive limit range coefficient. As Figure 6 shown, in stage P2, it is judged whether the difference calculated by subtracting the output value of the previous digital input data from the value of the current next digital input data read is greater than the positive limit range coefficient Cb.
[0047] If the difference calculated in step S109 is greater than the positive limit range coefficient, that is, when the following formula is met, steps S211 to S215 are sequentially executed, and then step S401 is executed:
[0048] Din(n) - Dout(n - 1)>Cb(n - 1),
[0049] where Din(n) represents the input value of the nth digital input data, n is any appropriate integer value, Dout(n - 1) represents the output value of the (n - 1)th digital input data, and Cb(n - 1) represents the positive limit range coefficient of the (n - 1)th.
[0050] On the contrary, if the difference calculated in step S109 is not greater than the positive limit range coefficient, step S217 is executed.
[0051] In step S211, the value of the current next digital input data read is subtracted by the stage adjustment coefficient to calculate the output value of the next digital input data, which is represented by the following formula:
[0052] Dout(n) = Din(n) - Cs(n - 1);
[0053] where Dout(n) represents the output value of the nth digital input data, that is, the output value of the next digital input data, n is any appropriate integer value, Din(n) represents the input value of the nth digital input data, and Cs(n - 1) represents the stage adjustment coefficient of the (n - 1)th.
[0054] As Figure 6As shown, when it is determined in stage P2 that the difference calculated by subtracting the output value of the previous digital input data from the value of the current next digital input data read is greater than the positive limit range coefficient Cb, the data multiplexer in stage P6 selects stage P5. Then, subtract the positive stage adjustment coefficient Cs of stage P5 from the value of the current next digital input data read, or add the negative stage adjustment coefficient -Cs to the value of the current next digital input data read.
[0055] In step S213, the updated center value is equal to the output value of the next digital input data calculated in step S211.
[0056] In step S215, output the value calculated in step S211 as the output value of the current next digital input data read, that is, output a value equal to the center value updated in step S213. At this time, define the trend value to be equal to the zero value.
[0057] In step S217, determine whether the difference is less than the negative limit range coefficient. As Figure 6 shown, in stage P3, determine whether the difference calculated by subtracting the output value of the previous digital input data from the value of the current next digital input data read is less than the negative limit range coefficient -Cb.
[0058] If the difference between the value of the current next digital input data read and the value of the previous digital input data is not greater than the positive limit range coefficient but less than the negative limit range coefficient, sequentially execute steps S219 to S223, that is, when the following formula is met, then execute step S401:
[0059] Din(n) - Dout(n - 1) < -Cb(n - 1),
[0060] where Din(n) represents the input value of the nth digital input data, n is any appropriate integer value, Dout(n - 1) represents the output value of the (n - 1)th digital input data, and -Cb(n - 1) represents the negative limit range coefficient of the (n - 1)th.
[0061] Conversely, if the difference between the value of the current next digital input data read and the value of the previous digital output data is not greater than the positive limit range coefficient and not less than the negative limit range coefficient, determine that the output value of the current next digital input data is equal to the value of the previous digital output data, and execute step S301.
[0062] In step S219, add the stage adjustment coefficient to the value of the current next digital input data read, which is represented by the following formula:
[0063] Dout(n) = Din(n) + Cs(n - 1);
[0064] Where Dout(n) represents the output value of the nth digital input data, that is, the output value of the next digital input data, n is any appropriate integer value, Din(n) represents the input value of the nth digital input data, and Cs(n - 1) represents the stage adjustment coefficient of the (n - 1)th stage.
[0065] As Figure 6 shown, when it is determined in stage P2 that the difference calculated by subtracting the output value of the previous digital input data from the value of the next digital input data currently read is less than the positive limit range coefficient Cb, the data multiplexer in stage P6 selects stage P4. Then, the value of the next digital input data currently read is added to the positive stage adjustment coefficient Cs of stage P4.
[0066] In step S221, the updated center value is equal to the output value of the next digital input data calculated in step S219.
[0067] In step S223, the value calculated in step S219 is output as the output value of the next digital input data currently read, that is, the value equal to the center value updated in step S221 is output. At this time, the trend value is defined as zero.
[0068] Please refer to Figure 3 and Figure 6 , where Figure 3 is the flowchart of the third step of the method for stabilizing digital signal data according to an embodiment of the present invention; Figure 6 is a schematic diagram of the operation architecture of the digital signal data stabilization system according to an embodiment of the present invention.
[0069] The method for stabilizing digital signal data according to an embodiment of the present invention may include steps S301 to S309 as Figure 2 shown, and is applicable to the operation architecture as Figure 6 shown.
[0070] In step S301, it is determined whether the value of the next digital input data currently read is greater than the output value of the previous digital input data, that is, it is determined whether the following formula is satisfied:
[0071] Din(n) > Dout(n - 1),
[0072] where Din(n) represents the input value of the nth digital input data, and Dout(n - 1) represents the output value of the (n - 1)th digital input data.
[0073] If the value of the next digital input data read currently is greater than the output value of the previous digital input data, steps S303 and S401 are executed in sequence. Conversely, if the value of the next digital input data read currently is not greater than the output value of the previous digital input data, step S305 is executed.
[0074] In step S303, add a base value to the trend value, which is represented by the following formula:
[0075] T(n) = T(n - 1) + B,
[0076] where T(n) represents the trend value of the nth digital input data, T(n - 1) represents the trend value of the (n - 1)th digital input data, B represents the base value, and the base value B is, for example, 1. In actual operation, the user can set the base value B by themselves, or automatically adjust the base value B according to the value of each digital input data, so that the ratio of the value of each digital input data to the base value B conforms to a preset ratio, and the size of this preset ratio can depend on actual needs.
[0077] As Figure 6 shown, in stage P81, it is determined that the difference between the value of the next digital input data read currently and the output value of the previous digital input data is greater than 0. During the running time P82, add "1" to a trend value T (i.e., the base value is equal to 1).
[0078] In step S305, determine whether the value of the next digital input data read currently is less than the output value of the previous digital input data, that is, determine whether it conforms to the following formula:
[0079] Din(n) < Dout(n - 1),
[0080] where Din(n) represents the input value of the nth digital input data, and Dout(n - 1) represents the output value of the (n - 1)th digital input data.
[0081] If the value of the next digital input data read currently is less than the output value of the previous digital input data, steps S307 and S401 are executed in sequence.
[0082] As Figure 6 shown, in stage P91, it is determined that the difference between the value of the next digital input data read currently and the output value of the previous digital input data is less than 0. During the running time P92, subtract "1" from the current trend value T (i.e., the base value is equal to 1).
[0083] On the contrary, if the value of the next digital input data read currently is not less than and not greater than the output value of the previous digital input data, that is, when the value of the next digital input data read currently is equal to the output value of the previous digital input data, steps S309 and S401 are sequentially executed.
[0084] In step S307, subtract the base value from the trend value, which is expressed by the following formula:
[0085] T(n) = T(n - 1) – B,
[0086] where T(n) represents the trend value of the nth digital input data, T(n - 1) represents the trend value of the (n - 1)th digital input data, and B represents the base value.
[0087] In step S309, maintain the original trend value, that is, the trend value of this digital input data is equal to the trend value of the previous digital input data.
[0088] Please refer to Figure 4 and Figure 6 , where Figure 4 is the flowchart of the fourth step of the method for stabilizing digital signal data according to an embodiment of the present invention; Figure 6 is a schematic diagram of the operation architecture of the digital signal data stabilization system according to an embodiment of the present invention.
[0089] The method for stabilizing digital signal data according to an embodiment of the present invention may include steps S401 to S419 as shown in Figure 4 , and is applicable to the operation architecture as shown in Figure 6 .
[0090] In step S401, determine whether the trend value is greater than a positive trend threshold value, that is, determine whether the following condition is met:
[0091] T(n) > Tth,
[0092] where T(n) represents the trend value of the nth digital input data, and Tth represents the positive trend threshold value.
[0093] If the trend value is greater than the positive trend threshold value, steps S403 to S407 are sequentially executed, and then step S107 is executed to read the next digital input data. On the contrary, if the trend value is not greater than the positive trend threshold value, step S409 is executed.
[0094] In step S403, subtract the trend adjustment coefficient from the output value of the previous digital input data to calculate a value, which can be used as the first central value, as shown in the following formula:
[0095] Dout(n) = Dout(n - 1) - Ct,
[0096] Where Dout(n) represents the output value of the digital input data for the nth pen, Dout(n - 1) represents the output value of the digital input data for the (n - 1)th pen, and Ct represents the trend adjustment coefficient.
[0097] As Figure 6 shown, if it is determined in stage P83 that the trend value T is greater than the positive trend threshold Tth, the data multiplexer in stage P85 selects stage P842. In stage P842, subtract the positive trend adjustment coefficient Ct from the output value of the previous pen of digital input data obtained in stage P12, or add the negative trend adjustment coefficient -Ct to the output value of the previous pen of digital input data.
[0098] In step S405, the updated center value is equal to the first center value calculated in step S403.
[0099] In step S407, output, as the output value of the next pen of digital input data, the value equal to that calculated in step S403.
[0100] In step S409, determine whether the trend value is less than a negative trend threshold, that is, determine whether the following condition is met:
[0101] T(n) < -Tth,
[0102] where T(n) represents the trend value of the nth pen of digital input data, and -Tth represents the negative trend threshold.
[0103] If the trend value is less than the negative trend threshold, sequentially execute steps S411 to S415, and then execute step S107 to read the next pen of digital input data. Conversely, if the trend value is not greater than the positive trend threshold and not less than the negative trend threshold, sequentially execute steps S417 to S419, and then return to step S107 to read the next pen of digital input data.
[0104] In step S411, calculate a value by adding the trend adjustment coefficient to the output value of the previous pen of digital input data, and this value can be used as the second center value, as shown in the following formula:
[0105] Dout(n) = Dout(n - 1) + Ct,
[0106] where Dout(n) represents the output value of the nth pen of digital input data, Dout(n - 1) represents the output value of the (n - 1)th pen of digital input data, and Ct represents the trend adjustment coefficient.
[0107] As Figure 6As shown, when it is determined in stage P93 that the trend value T is less than the negative trend threshold -Tth, the data multiplexer is used in stage P95 to select stage P942. In stage P942, the output value of the previous digital input data obtained in stage P12 is added with the positive trend adjustment coefficient Ct.
[0108] In step S413, the updated center value is equal to the second center value calculated in step S411.
[0109] In step S415, the value equal to the value calculated in step S411 is output as the output value of the next digital input data.
[0110] In step S417, the value equal to the output value of the previous digital input data is used as the output value of the next digital input data currently read, which is represented by the following formula:
[0111] Dout(n) = Dout(n - 1),
[0112] where Dout(n) represents the output value of the nth digital input data, and Dout(n - 1) represents the output value of the (n - 1)th digital input data.
[0113] In step S419, the output value of the next digital input data currently read is output.
[0114] Please refer to Figure 5 and Figure 6 , where Figure 5 is the flowchart of the fifth step of the method for stabilizing digital signal data according to an embodiment of the present invention; Figure 6 is a schematic diagram of the operation architecture of the digital signal data stabilization system according to an embodiment of the present invention.
[0115] The method for stabilizing digital signal data according to an embodiment of the present invention may include steps S501 to S509 as shown in Figure 5 , and is applicable to the operation architecture as shown in Figure 6 . It should be understood that steps S503 to S509 can be selectively executed, either one or more of them.
[0116] In step S501, after reading multiple sequential digital input data as described above, the change amplitude of the center value is calculated.
[0117] In step S503, the positive limit range coefficient is dynamically adjusted according to the change amplitude of the center value.
[0118] In step S505, the negative limit range coefficient is dynamically adjusted according to the change amplitude of the center value.
[0119] In step S507, the stage adjustment coefficient is dynamically adjusted according to the change amplitude of the center value.
[0120] In step S509, the trend adjustment coefficient is dynamically adjusted according to the change range of the central value.
[0121] Please refer to Figure 7 and Figure 8 , where Figure 7 is the first schematic diagram of the values of multiple digital input data when the boundary range coefficient and the stage adjustment coefficient for the digital signal data stabilization method according to the embodiment of the present invention are both 2 but the trend adjustment coefficient is 0; Figure 8 is the first table schematic diagram of the values of multiple digital input data when the boundary range coefficient and the stage adjustment coefficient for the digital signal data stabilization method according to the embodiment of the present invention are both 2 but the trend adjustment coefficient is 0.
[0122] In Figure 7 and Figure 8 's embodiment, the positive boundary range coefficient is set to "2", the negative boundary range coefficient is set to "-2", the stage adjustment coefficient is set to "2", and the trend adjustment coefficient is set to "0".
[0123] The value of the digital input data read at time point T5 is "-3", subtracting the output value at time point T4 which is +0, to calculate the difference "-3". In step S217 as shown in Figure 2 , it is determined that this difference "-3" is less than the negative boundary range coefficient "-2", so step S219 as shown in Figure 2 is executed, adding the stage adjustment coefficient "2" to the value of the digital input data "-3" read at time point T5, to calculate the output value "-1" at time point T5.
[0124] The value of the digital input data read at time point T10 is "-1", subtracting the output value at time point T9 which is -1, to calculate the difference "0".
[0125] If the trend adjustment coefficient is set to "0", regardless of the magnitude of the base value, the output value at time point T10 is equal to the output value at time point T9, which is "-1".
[0126] The output values from time point T5 to time point T15 are all equal, and the output value remains constant. Obviously, there is a gap in the actual output value.
[0127] Please refer to Figure 9 and Figure 10 , where Figure 9 is the second schematic diagram of the values of multiple digital input data when the boundary range coefficient and the stage adjustment coefficient for the digital signal data stabilization method according to the embodiment of the present invention are both 2 but the trend adjustment coefficient is 1; Figure 10The second schematic table of the numerical values of multiple digital input data when the boundary range coefficient and the stage adjustment coefficient for the digital signal data stabilization method according to the embodiments of the present invention are both 2, but the trend adjustment coefficient is 1.
[0128] In Figure 9 and Figure 10 In the embodiment, the positive boundary range coefficient is set to "2", the negative boundary range coefficient is set to "-2", the stage adjustment coefficient is set to "2", and the trend adjustment coefficient is set to "1".
[0129] The numerical value of the digital input data read at time point T10 is "-1", subtracting the output value at time point T9 which is "-1" to calculate the difference value "0". If this difference value "0" is greater than the positive trend threshold, subtract the trend adjustment coefficient set to "1" from the output value "-1" at time point T9 to calculate the output value "-2" at time point T10.
[0130] Obviously, if a trend adjustment coefficient is set and the trend adjustment coefficient is not equal to zero, the output value is corrected according to the set trend adjustment coefficient, so that the output value has a stable output numerical value and at the same time has a trend change, and can be closer to the actual numerical value.
[0131] In summary, the present invention provides a method for stabilizing digital signal data, which is characterized in that:
[0132] 1. By setting the boundary range coefficient, the stage adjustment coefficient and the trend adjustment coefficient, the digital signal is corrected through an algorithm to reduce signal noise, and thus the effect of stabilizing the digital signal output is achieved;
[0133] 2. The boundary range coefficient, the stage adjustment coefficient and the trend adjustment coefficient can be set according to the needs of the user, or automatically adjusted after adopting other automatic judgment mechanisms (such as according to the change range of the input or output value);
[0134] 3. The numerical value of the current read digital input data can be compared with the output value of the previous digital input data in real time, without occupying too much buffer space and operation time;
[0135] 4. It can be processed in cooperation with other digital signal processors, such as digital filters, averagers, etc.;
[0136] 5. It can be implemented by digital hardware circuits or software.
[0137] The content disclosed above is only the preferred feasible embodiment of the present invention, and does not limit the scope of the claims of the present invention. Therefore, all equivalent technical changes made by using the content of the specification and drawings of the present invention are included in the claims of the present invention.
Claims
1. A method for stabilizing digital signal data, characterized in that, The method for stabilizing digital signal data includes the following steps: (a) Set a positive limit range coefficient, a negative limit range coefficient, a phase adjustment coefficient, and a trend adjustment coefficient; (b) Read a digital input data; (c) Output the value equal to the current read digital input data as the output value of the digital input data; (d) Read the next digital input data; (e) Subtract the output value of the previous digital input data from the value of the current read next digital input data to calculate a difference; (f) Determine whether the difference is greater than the positive limit range coefficient. If so, subtract the phase adjustment coefficient from the value of the current read next digital input data to output the output value of the next digital input data, define a trend value equal to zero, and then execute step (j). If not, execute step (g); (g) Determine whether the difference is less than the negative limit range coefficient. If so, add the phase adjustment coefficient to the value of the current read next digital input data to output the output value of the next digital input data, define the trend value equal to zero, and then execute step (j). If not, execute step (h); (h) Determine whether the value of the current read next digital input data is greater than the output value of the previous digital input data. If so, add a base value to the trend value, then execute step (j). If not, execute step (i); (i) Determine whether the value of the current read next digital input data is less than the output value of the previous digital input data. If so, subtract the base value from the trend value, execute step (j). If not, execute step (j); (j) Determine whether the trend value is greater than the positive trend threshold. If so, subtract the trend adjustment coefficient from the output value of the previous digital input data to output the output value of the next digital input data, and then return to step (d) to read the next digital input data. If not, execute step (k); (k) Determine whether the trend value is less than the negative trend threshold. If so, add the trend adjustment coefficient to the output value of the previous digital input data to output the output value of the next digital input data, and then return to step (d) to read the next digital input data. If not, execute step (l); and (l) Output the value equal to the output value of the previous digital input data as the output value of the current read next digital input data, and then return to step (d) to read the next digital input data.
2. The stable method for digital signal data according to claim 1, wherein The method for stabilizing digital signal data further includes the following steps: (m) Define the value of the first read digital input data as the central value.
3. The method for stabilizing digital signal data according to claim 2, wherein The method for stabilizing digital signal data further includes the following steps: (n) Determine whether the difference is greater than the positive limit range coefficient. If so, subtract the stage adjustment coefficient from the value of the currently read next digital input data to calculate a first central value, update the central value to be equal to the first central value, output the value equal to the first central value as the output value of the next digital input data, and then execute step (j). If not, execute step (o); and (o) Determine whether the difference is less than the negative limit range coefficient. If so, add the stage adjustment coefficient to the value of the currently read next digital input data to calculate a second central value, update the central value to be equal to the second central value, output the value equal to the second central value as the output value of the next digital input data, and then execute step (j). If not, execute step (h).
4. The method for stabilizing digital signal data according to claim 3, characterized in that, The method for stabilizing the digital signal data further includes the following steps: (p) Calculate the change amplitude of the central value; and (q) Dynamically adjust one or more of the positive limit range coefficient, the negative limit range coefficient, the stage adjustment coefficient, and the trend adjustment coefficient according to the change amplitude of the central value.
5. The method for stabilizing digital signal data according to claim 1, wherein The method for stabilizing the digital signal data further includes the following steps: (r) Set the absolute value of the negative limit range coefficient to be equal to the positive limit range coefficient.
6. The method for stabilizing digital signal data according to claim 1, wherein The method for stabilizing the digital signal data further includes the following steps: (s) Set the trend adjustment coefficient to be less than any one or more of the positive limit range coefficient, the absolute value of the negative limit range coefficient, and the stage adjustment coefficient.
7. The method for stabilizing digital signal data according to claim 1, characterized in that The method for stabilizing the digital signal data further includes the following steps: (t) Set the trend adjustment coefficient so that the ratio of the trend adjustment coefficient to the positive limit range coefficient or the negative limit range coefficient conforms to a preset trend limit ratio.
8. The method for stabilizing digital signal data according to claim 1, characterized in that, The method for stabilizing the digital signal data further includes the following steps: (u) Set the trend adjustment coefficient so that the ratio of the trend adjustment coefficient to the stage adjustment coefficient conforms to a preset trend stage ratio.
9. The method for stabilizing digital signal data according to claim 1, characterized in that, The method for stabilizing the digital signal data further includes the following steps: (v) Before adding or subtracting the trend value from the base value, set the trend value to zero.
10. The method for stabilizing digital signal data according to claim 1, characterized in that, The method for stabilizing the digital signal data further includes the following steps: (w) Automatically adjust the base value according to the value of each digital input data so that the ratio of the value of the digital input data to the base value conforms to a preset ratio.
Citation Information
Patent Citations
Systems and methods to monitor an asset in an operating process unit
CN103576641A
Method for adjusting offset of analog image signal
JP2007158663A