Filter circuit

By introducing a comparison and correction mechanism in the digital filter circuit, comparing the current input value with the previous output value, and correcting the output value based on the comparison results, the problems of increasing the calculation amount and increasing the memory size in the prior art are solved, and good attenuation characteristics and reduction of the calculation amount are achieved.

CN114747139BActive Publication Date: 2025-04-25ALPS ALPINE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202080083976.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-12-04
Filing Date
2020-11-12
Publication Date
2025-04-25
Estimated Expiration
2040-11-12

AI Technical Summary

Technical Problem

In order to obtain good cutoff frequency attenuation characteristics, the calculation amount of the existing digital filter increases, resulting in the need of a multi-stage addition mechanism and the memory size increases.

Method used

A filter circuit is designed, including an input unit, an output unit, a first storage unit, a comparison unit and a correction unit. By comparing the current input value with the previous output value and correcting the output value based on the comparison result, the calculation amount is reduced.

Benefits of technology

The calculation amount is reduced while obtaining good attenuation characteristics, avoiding the problem of memory size increase.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114747139B_ABST
    Figure CN114747139B_ABST
Patent Text Reader

Abstract

The present invention provides a filter circuit that can reduce the amount of calculation and obtain good attenuation characteristics. The filter circuit includes: an input part, which inputs a signal; an output part, which outputs an output value corresponding to the input value of the signal; a first storage part, which stores the input value and the output value; a comparison part, which compares the input value with the output value; and a correction part, which corrects the output value according to the output of the comparison part, wherein the comparison part compares the current input value with the previous output value, and the correction part adds the current input value and the previous output value to a first correction value when the comparison value of the current input value and the previous output value of the comparison part is greater than a specified value, and adds the current input value and the previous output value to a second correction value when the comparison value is less than the specified value, and the second correction value is less than the first correction value, and the output part calculates the current output value based on the current input value and the previous output value added with the first correction value or the second correction value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a filter circuit. Background Art

[0002] In the past, there was a digital filter having a multiplication element, wherein the digital filter is characterized in that it has: a multiplication mechanism for multiplying a filter constant of the multiplication element; an integration mechanism for integrating the value of the low-order byte corresponding to the decimal part of the multiplication result of the multiplication mechanism according to each multiplication; an overflow detection mechanism for detecting, through the calculation result of the integration mechanism, that a value overflows to or above ±1, and outputs ±1 only when an overflow occurs, and outputs 0 otherwise; and an addition mechanism for adding the value of the high-order byte corresponding to the integer part of the multiplication result to the output of the overflow detection mechanism (for example, refer to patent document 1).

[0003] Prior art literature

[0004] Patent Literature

[0005] Patent Document 1: Japanese Patent Application Laid-Open No. 07-030373 Summary of the invention

[0006] Problems that the invention will solve

[0007] However, in order to improve the attenuation characteristics of a signal at a cutoff frequency, the amount of computation required for the digital filter increases.

[0008] In conventional digital filters, in order to obtain good attenuation characteristics of the cutoff frequency and to cope with the increase in the amount of calculation, it is necessary to have multiple stages of buffers for holding the output of the adding mechanism, which increases the size of the memory (buffer).

[0009] Therefore, an object of the present invention is to provide a filter circuit that can reduce the amount of calculation and obtain good attenuation characteristics.

[0010] Means for solving problems

[0011] A filter circuit according to an embodiment of the present invention includes: an input unit, to which a signal is input; an output unit, to which an output value corresponding to the input value of the signal is output; a first storage unit, to store the input value and the output value; a comparison unit, to compare the input value with the output value; and a correction unit, to correct the output value according to the output of the comparison unit, wherein the comparison unit compares the current input value with the previous output value, and the correction unit adds the current input value and the previous output value to a first correction value when the comparison value of the current input value and the previous output value of the comparison unit is greater than a prescribed value, and adds the current input value and the previous output value to a second correction value when the comparison value is less than the prescribed value, and the second correction value is less than the first correction value, and the output unit calculates the current output value based on the current input value and the previous output value after adding the first correction value or the second correction value.

[0012] Effects of the Invention

[0013] The present invention can provide a filter circuit which can reduce the amount of calculation and obtain good attenuation characteristics. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 1 is a diagram showing a filter circuit 100 according to an embodiment.

[0015] Figure 2 2 is a flowchart showing the processing executed by the comparison calculation unit 150 .

[0016] Figure 3A is a graph showing the response of the low-pass filter.

[0017] Figure 3B is a graph showing the response of the low-pass filter.

[0018] Figure 4 2 is a diagram showing the frequency followability of the filter circuit 100 .

[0019] Figure 5 is a diagram showing an output waveform of a low-pass filter. DETAILED DESCRIPTION

[0020] Hereinafter, embodiments of a filter circuit to which the present invention is applied will be described.

[0021] <Implementation Method>

[0022] Figure 1 : is a diagram showing a filter circuit 100 according to an embodiment. The filter circuit 100 includes an input unit 110 , buffers 120 , 130 , and 140 , a comparison calculation unit 150 , an output calculation unit 160 , and an output unit 170 .

[0023] The filter circuit 100 is, for example, a digital filter implemented by an 8-bit or 16-bit microcomputer. Here, a mode in which the filter circuit 100 is connected to a predetermined sensor and a signal detected by the sensor is input is described. The signal detected by the sensor contains high-frequency noise.

[0024] The filter circuit 100 is a low-pass filter that cuts off components above a cutoff frequency in an input signal (input signal) and outputs only components below the cutoff frequency.

[0025] The input unit 110 is connected to the filter circuit 100 and is an input terminal to which an input signal Input detected by a sensor is input. The input unit 110 is connected to an input terminal of the buffer 120 inside the filter circuit 100. The input unit 110 is an input terminal of a microcomputer that realizes the filter circuit 100.

[0026] The buffer 120 has an input terminal connected to the input unit 110 and an output terminal connected to the buffer 140 and the comparison calculation unit 150 , and outputs the input signal Input input from the input unit 110 to the buffer 140 and the comparison calculation unit 150 .

[0027] The buffer 130 has an input terminal connected to the output calculation unit 160 and an output terminal connected to the comparison calculation unit 150. The buffer 130 holds the output value Output output from the output calculation unit 160, and outputs the output value Output as the previous output value (previous output value) preOutput to the comparison calculation unit 150 in the next control cycle.

[0028] Buffer 140 has an input terminal connected to buffer 120 and an output terminal connected to comparison calculation unit 150. Buffer 140 holds input signal Input input from buffer 120, and outputs the input signal Input as a previous input signal (previous input signal) preInput in the next control cycle.

[0029] The comparison calculation unit 150 includes a comparison unit 151 and a correction unit 152. The comparison calculation unit 150 includes an input terminal connected to the buffers 120, 130, and 140, and an output terminal connected to the output calculation unit 160.

[0030] The comparison unit 151 compares the input signal Input input from the buffer 120 with the previous output value preOutput input from the buffer 130. The correction unit 152 corrects the input signal Input input from the buffer 120, the previous output value preOutput output from the buffer 130, and the previous input signal preInput input from the buffer 140 according to the comparison result of the comparison unit 151, and outputs them to the output calculation unit 160.

[0031] The output calculation unit 160 has an input terminal connected to the comparison calculation unit 150, and an output terminal connected to the output unit 170 and the buffer 130. The output calculation unit 160 performs a calculation of adding a predetermined weight to the corrected input signal Input output from the comparison calculation unit 150, the previous output value preOutput, and the previous input signal preInput, and outputs an output value Output.

[0032] The output calculation unit 160 performs weighting and summing according to the following formula to calculate and output the output value Output.

[0033] Output=preOutput / 2+preOutput / 4+preOutput / 32+preOutput / 16+Input / 8+PreInput / 32

[0034] The output calculation unit 160 obtains integer values ​​​​after the decimal point for each term on the right side of the above formula (preOutput / 2, preOutput / 4, preOutput / 32, preOutput / 16, Input / 8, PreInput / 32), and calculates the sum of the integer values ​​of each term. The weights given to the six terms on the right side of the above formula are 1 / 2, 1 / 4, 1 / 32, 1 / 16, 1 / 8, and 1 / 32, respectively.

[0035] The signal level of high-frequency noise varies greatly. In order to realize a low-pass filter capable of removing high-frequency noise, the output calculation unit 160 increases the weight of the previous output value preOutput and decreases the weight of the input signal Input and the previous input signal preInput.

[0036] The weight of the previous output value preOutput is increased so that the output value Output does not change significantly from the previous output value preOutput. In addition, by setting the weight of the previous input signal preInput to 1 / 8, the signal level of the input signal Input is added to the output value Output and does not change significantly from the previous output value preOutput. In addition, by setting the weight of the previous input signal preInput to be less than the weight of the input signal Input, the signal level of the previous input signal preInput is added to the output value Output and the influence on the output value Output is minimized.

[0037] The output calculation unit 160 implements a low-pass filter by performing such weighting.

[0038] The output unit 170 outputs the output value Output of the output calculation unit 160. The output unit 170 is connected to, for example, a device that uses a detection result of a predetermined sensor to which the filter circuit 100 is connected.

[0039] The filter circuit 100 as described above repeatedly executes the process of outputting the output value Output obtained by cutting off the components of the input signal Input having a cutoff frequency or higher in a predetermined control cycle.

[0040] Figure 2 1 is a flowchart showing the processing executed by the comparison calculation unit 150. The comparison calculation unit 150 repeatedly executes the processing in a predetermined control cycle. Figure 2 The process from start to finish is shown.

[0041] The comparison unit 151 obtains the absolute value (Abs(preOutput−Input)) of the difference between the input signal Input input from the buffer 120 and the previous output value preOutput input from the buffer 130 , and determines whether the absolute value is 4 or more (step S1 ).

[0042] The process of step S1 is a process in which the comparison unit 151 compares the input signal Input input from the buffer 120 with the previous output value preOutput input from the buffer 130 .

[0043] If the comparison unit 151 determines that the absolute value of the difference is greater than or equal to 4 (S1: Yes), the correction unit 152 corrects the input signal Input, the previous output value preOutput, and the previous input signal preInput using a large correction value (step S2). Specifically, the correction unit 152 performs correction by adding 4 to the input signal Input, the previous output value preOutput, and the previous input signal preInput.

[0044] If it is determined by the comparison unit 151 that the absolute value of the difference is not 4 or more (S1: No), the correction unit 152 corrects the input signal Input, the previous output value preOutput, and the previous input signal preInput using a small correction value (step S3). Specifically, the correction unit 152 performs correction by adding 2 to the input signal Input, the previous output value preOutput, and the previous input signal preInput.

[0045] The case where the absolute value of the difference obtained by the comparison unit 151 is 4 or more is a case where the difference between the input signal Input and the previous output value preOutput is large, and is a case where the input signal Input changes greatly with respect to the previous output value preOutput.

[0046] When the output calculation unit 160 calculates the output value Output, since the decimal part of each term given a weight is discarded, a rounding error (Japanese: 丸め誤差) due to the discard is generated. In order to reduce such a rounding error, when the change in the input signal Input is large in the correction unit 152, since it is set to a larger value and is likely to be cut off, a large value is added, and when the change in the input signal Input is small, since it is difficult to be cut off, a small value is added.

[0047] In addition, the correction value in step S2 is not limited to 4, as long as it is greater than the correction value in step S3. Further, the correction in step S3 is not limited to 2, as long as it is less than the correction value in step S2.

[0048] Figure 3A And Figure 3B is a diagram showing the response of the low-pass filter. In Figure 3A shows the response of the filter circuit 100 (characteristic of the dotted line), and in Figure 3B is used for comparison and shows the response of the low-pass filter obtained by removing the comparison calculation unit 150 from the filter circuit 100 (characteristic of the dotted line). In Figure 3A 、 Figure 3B the horizontal axis is time (milliseconds (ms)), and the vertical axis is the signal level (unitless).

[0049] In Figure 3A 、 Figure 3B the solid line represents the waveform of the step input, the dotted line represents the response of the output value Output of the low-pass filter, and the dash-dotted line represents the response of the output value obtained by also considering the decimal part in the conventional low-pass filter having a multi-stage buffer. Figure 3A 、 Figure 3B The waveform of the step input of the solid line shown in

[0050] like Figure 3A As shown, the output value Output of the filter circuit 100 rises at about 10 ms relative to the waveform of the step input, and a signal level of about 97 is obtained relative to the input 100. It can be seen that the response is faster than that of the conventional low-pass filter (single-dot chain line).

[0051] In addition, if Figure 3B As shown, the output value Output of the comparative filter circuit 100 rises at about 15 ms relative to the waveform of the step input, and the signal level is about 78 relative to the input 100. It can be seen that the response is faster than that of the conventional low-pass filter (single-dot chain line), but the response is slower than that of the filter circuit 100, and the signal level is small.

[0052] In this way, it can be confirmed that the filter circuit 100 has a fast response and good input followability.

[0053] Figure 4 2 is a diagram showing the frequency followability of the filter circuit 100 . Figure 4 The characteristics shown are those obtained by simulation. Figure 4 In , the horizontal axis is time (milliseconds) and the vertical axis is signal level (no unit). In addition, the characteristics shown by the dark line are the characteristics of the input signal, and the characteristics shown by the light line are the characteristics of the output value Output. Figure 4 In the example, the frequency of the input signal is gradually increased over time, specifically, continuously increased from 10 Hz to 10 kHz.

[0054] The output value Output is slightly smaller (smaller in amplitude) than the signal level of the input signal when the frequency of the input signal is low, but when the frequency of the input signal increases, the amplitude is attenuated to about 1 / 10. In addition, it can be seen that it smoothly follows the increase in frequency.

[0055] As described above, it can be seen that since the attenuation rate increases on the high-frequency side, a low-pass filter capable of removing high-frequency noise can be obtained.

[0056] Figure 5 is a diagram showing an output waveform of a low-pass filter. Figure 5 The characteristics shown are those obtained experimentally. Figure 5 , the horizontal axis represents time (milliseconds) and the vertical axis represents signal level (no unit).

[0057] exist Figure 5 Among them, the characteristic of the darkest color is the input signal Input, the characteristic of the middle depth is the output value Output of the filter circuit 100, and the characteristic of the lightest color is the output value obtained by considering the decimal point in the conventional low-pass filter having 8 multi-level buffers.

[0058] exist Figure 5 In, with Figure 4 Likewise, the frequency of the input signal is gradually increased over time, specifically, continuously increased from 10 Hz to 10 kHz.

[0059] It can be seen that the outputs of the filter circuit 100 and the conventional low-pass filter attenuate with respect to the input signal Input, and the attenuation rate of the output value Output of the filter circuit 100 is greater than the attenuation rate of the output value of the conventional low-pass filter (it has a smaller amplitude).

[0060] As described above, the filter circuit 100 has a fast response and can obtain an attenuation rate greater than that of a conventional low-pass filter having a multi-stage buffer. The number of buffers (120, 130, 140) of the filter circuit 100 is three, and the output value Output can be obtained only by the difference calculation of the comparison unit 151 of the comparison calculation unit 150, the addition calculation of the correction value of the correction unit 152, and the weighted sum calculation of the output calculation unit 160.

[0061] Therefore, the present invention can provide a filter circuit 100 that can reduce the amount of calculation and obtain good attenuation characteristics. The filter circuit 100 can be implemented by a microcomputer of about 8 bits or 16 bits.

[0062] In addition, the filter circuit 100 includes the buffer 140, but may not include the buffer 140. In this case, the output of the output calculation unit 150 does not include the corrected previous input signal preInput, and the output calculation unit 160 calculates the output value Output without including the previous input signal preInput.

[0063] As mentioned above, the filter circuit according to the exemplary embodiment of the present invention has been described, but the present invention is not limited to the specifically disclosed embodiment, and various modifications and changes can be made without departing from the scope of the claims.

[0064] In addition, the present international application claims priority based on Japanese Patent Application No. 2019-219817 filed on December 4, 2019, the entire contents of which are incorporated herein by reference.

[0065] Description of Reference Numerals

[0066] 100 Filter Circuit

[0067] 110 Input section

[0068] 120, 130, 140 Buffer

[0069] 150 Comparative Calculation Department

[0070] 151 Comparative Department

[0071] 152 Correction Department

[0072] 160 Output calculation unit

[0073] 170 Output

Claims

1. A filter circuit, comprising: Input part, input signal; An output unit, outputting an output value corresponding to the input value of the signal; A first storage unit, storing the input value and the output value; a comparing unit that compares an absolute value of a difference between the input value and the output value with a predetermined value; as well as a correction unit that corrects the output value according to the output of the comparison unit, The comparison unit compares the absolute value of the difference between the current input value and the previous output value with a predetermined value. The correction unit adds the input value of this time and the output value of the previous time to a first correction value when the absolute value of the difference between the input value of this time and the output value of the previous time is greater than a prescribed value, and adds the input value of this time and the output value of the previous time to a second correction value when the absolute value of the difference between the input value of this time and the output value of the previous time is less than the prescribed value, wherein the second correction value is smaller than the first correction value. The output unit calculates a current output value based on a current input value added to the first correction value or the second correction value and a previous output value.

2. The filter circuit according to claim 1, wherein: further comprising a second storage unit for storing a previous input value, The output unit calculates a current output value based on the current input value and the previous output value added to the first correction value or the second correction value, and the previous input value stored in the second storage unit.

3. The filter circuit according to claim 1 or 2, wherein: When calculating the output value, the output unit sets a weight of the previous output value to be larger than a weight of the current input value.

Citation Information

Patent Citations

  • Digital filter

    JP1995030373A

  • Event participant mediation program and event participant mediation system and server device and event information output program and event participant mediation method and event participant mediation system construction method

    JP2019219817A

  • Method and device for optimized time synchronization correction

    CN101478358A

  • Digital filter and vehicle driving force control apparatus

    CN106505972A