Exponential moving average filter for mems sensors

CN224875042UActive Publication Date: 2026-10-20MEMSIC SEMICON WUXI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202522525795.4
Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
Filing Date
2025-11-27
Publication Date
2026-10-20
Estimated Expiration
2035-11-27

AI Technical Summary

Technical Problem

尽管该方法能够实现对多轴数据的并行滤波,但该方案存在明显的硬件资源开销大、成本高的问题

Benefits of technology

[0007]与现有技术相比,本实用新型中所述指数移动平均滤波器的输入端分时复用的接收MEMS传感器的X轴的传感数据、Y轴的传感数据和Z轴的传感数据,第一级滤波单元分时复用的对MEMS传感器的X轴的传感数据、Y轴的传感数据和Z轴的传感数据进行一级滤波,第二级滤波单元分时复用的对MEMS传感器的X轴的传感数据、Y轴的传感数据和Z轴的传感数据进行二级滤波,这样只需要为X轴的传感数据、Y轴的传感数据和Z轴的传感数据配置一个第一级滤波单元和一个第二级滤波单元就可以,显著降低了硬件成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN224875042U_ABST
    Figure CN224875042U_ABST
Patent Text Reader

Abstract

The utility model provides a kind of exponential moving average filter of MEMS sensor, it includes: first stage filter unit, it includes: first subtracter, first programmable shifter, first adder, first intermediate buffer, first delay register, second programmable shifter, first limiter and first stage output buffer;Second stage filter unit, it includes: second subtracter, third programmable shifter, second adder, second intermediate buffer, second delay register, fourth programmable shifter, second limiter and second stage output buffer.The X axis of MEMS sensor's sensing data, Y axis's sensing data and Z axis's sensing data are filtered by the time multiplexing of first stage filter unit and second stage filter unit.This way, it is not necessary to build a corresponding exponential moving average filter for each axis, reduce the number of filter, thereby reduce hardware cost.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This invention relates to the field of sensors, and more particularly to an exponential moving average filter for MEMS (Micro-Electro-Mechanical Systems) sensors. [Background Technology]

[0002] MEMS sensors are widely used in modern electronic devices, especially in motion sensing, attitude detection, and navigation systems. They typically require the simultaneous acquisition and processing of sensing data along multiple axes (such as X, Y, and Z axes). To suppress noise and improve signal quality, an exponential moving average (EMA) filter is often used to smooth the raw data.

[0003] In existing technologies, filtering of multi-axis MEMS sensor data typically employs a separate exponential moving average filter for each axis. This involves designing and implementing three separate hardware structures for the X, Y, and Z axes. While this method enables parallel filtering of multi-axis data, it suffers from significant hardware resource overhead and high cost.

[0004] Therefore, an improved exponential moving average filter for MEMS sensors is needed to address the aforementioned issues. [Utility Model Content]

[0005] To solve the above-mentioned technical problems, or at least partially solve them, embodiments of the present invention provide an exponential moving average filter for MEMS sensors.

[0006] According to one aspect of the present invention, an embodiment of the present invention provides an exponential moving average filter for a MEMS sensor, comprising: a first-stage filtering unit, comprising: a first subtractor, a first programmable shifter, a first adder, a first intermediate buffer, a first delay register, a second programmable shifter, a first limiter, and a first-stage output buffer, wherein one input terminal of the first subtractor is the input terminal of the exponential moving average filter, and the other input terminal of the first subtractor is connected to the output terminal of the first-stage output buffer; a second-stage filtering unit, comprising: a second subtractor, a third programmable shifter, a second adder, a second intermediate buffer, a second delay register, and a fourth programmable shifter. The system includes a programmable shifter, a second limiter, and a second-stage output buffer. One input of the second subtractor is connected to the output of the first-stage output buffer, and the other input of the second subtractor is connected to the output of the second-stage output buffer. The input of the exponential moving average filter is time-division multiplexed to receive X-axis, Y-axis, and Z-axis sensing data from the MEMS sensor. The first-stage filtering unit performs first-level filtering on the X-axis, Y-axis, and Z-axis sensing data from the MEMS sensor using time-division multiplexing. The second-stage filtering unit performs second-level filtering on the X-axis, Y-axis, and Z-axis sensing data from the MEMS sensor using time-division multiplexing.

[0007] Compared with existing technologies, the exponential moving average filter described in this invention uses time-division multiplexing of the X-axis, Y-axis, and Z-axis sensing data from the MEMS sensor at its input end. The first-stage filtering unit performs first-level filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor using time-division multiplexing, and the second-stage filtering unit performs second-level filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor using time-division multiplexing. In this way, only one first-stage filtering unit and one second-stage filtering unit need to be configured for the X-axis, Y-axis, and Z-axis sensing data, which significantly reduces hardware costs. [Attached Image Description]

[0008] To more clearly illustrate the technical solutions of the embodiments of this utility model, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this utility model. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Among them:

[0009] Figure 1 A block diagram of the exponential moving average filter for a MEMS sensor provided in an embodiment of this utility model.

Detailed Implementation Methods

[0010] To make the above-mentioned objectives, features and advantages of this utility model more apparent and understandable, the utility model will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0011] The term "an embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0012] This invention provides an exponential moving average filter for MEMS sensors. The exponential moving average filter can process the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor in a time-division multiplexing manner. Only one exponential moving average filter needs to be configured for the X-axis, Y-axis, and Z-axis sensing data, which significantly reduces hardware costs.

[0013] Figure 1 This is a structural block diagram of an exponential moving average filter 100 for a MEMS sensor provided in an embodiment of the present invention. The MEMS sensor can output sensing data along the X-axis, Y-axis, and Z-axis.

[0014] like Figure 1 As shown, the exponential moving average filter 100 includes: a first-stage filtering unit 110 and a second-stage filtering unit.

[0015] The first-stage filtering unit 110 includes: a first subtractor 111, a first programmable shifter 112, a first adder 113, a first intermediate buffer 114, a first delay register 115, a second programmable shifter 116, a first limiter 117, and a first-stage output buffer 118. One input of the first subtractor 111 is the input of the exponential moving average filter, and the other input of the first subtractor 111 is connected to the output of the first-stage output buffer 118.

[0016] The second-stage filtering unit 120 includes: a second subtractor 121, a third programmable shifter 122, a second adder 123, a second intermediate buffer 124, a second delay register 125, a fourth programmable shifter 126, a second limiter 127, and a second-stage output buffer 128. One input terminal of the second subtractor 121 is connected to the output terminal of the first-stage output buffer 118, and the other input terminal of the second subtractor 121 is connected to the output terminal of the second-stage output buffer 128.

[0017] The input of the exponential moving average filter 100 is time-division multiplexed with the X-axis, Y-axis and Z-axis sensing data of the MEMS sensor within the same period. The first-stage filtering unit 110 and the second-stage filtering unit 120 respectively time-division multiplex the X-axis, Y-axis and Z-axis sensing data of the MEMS sensor within the same period.

[0018] Specifically, the first-stage filtering unit 110 and the second-stage filtering unit 120 can perform first-stage filtering and second-stage filtering on the X-axis sensing data within the same period. Then, the first-stage filtering unit 110 and the second-stage filtering unit 120 perform first-stage filtering and second-stage filtering on the Y-axis sensing data within the same period. Subsequently, the first-stage filtering unit 110 and the second-stage filtering unit 120 perform first-stage filtering and second-stage filtering on the Z-axis sensing data within the same period. That is, the X-axis sensing data, Y-axis sensing data, and Z-axis sensing data within the same period can be filtered sequentially.

[0019] In one embodiment, after processing the triaxial sensing data for one cycle, the exponential moving average filter 100 then filters the triaxial (X, Y, Z) sensing data for the next cycle.

[0020] In another specific embodiment, within one cycle, the MEMS sensor outputs sensing data for one X-axis, one Y-axis, and two Z-axis axes. At this point, the sensing data for one X-axis, one Y-axis, and two Z-axis axes within the same cycle needs to be processed sequentially, and then the sensing data for the next cycle is processed again.

[0021] Of course, the above example uses the case of processing the X-axis sensor data first, then the Y-axis sensor data, and finally the Z-axis sensor data. In reality, the processing order of the sensor data on the three axes can be changed. For example, the Y-axis can be processed first, followed by the X and Z axes; or the Z-axis can be processed first, followed by the X and Y axes, and so on.

[0022] like Figure 1As shown, the input of the first programmable shifter 112 is connected to the output of the first subtractor 111. The first programmable shifter 112 is used to shift the input data left by N1 bits. The input of the second programmable shifter 116 is connected to the output of the first intermediate buffer 114. The second programmable shifter 116 is used to shift the input data right by N bits. The input of the third programmable shifter 122 is connected to the output of the second subtractor 121. The third programmable shifter 122 is used to shift the input data left by N2 bits. The input of the fourth programmable shifter 126 is connected to the output of the second intermediate buffer 124. The fourth programmable shifter 126 is used to shift the input data right by N bits.

[0023] When the first-stage filtering unit performs first-stage filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor using time-division multiplexing, the value of N1 is configured as N in the time-division multiplexing configuration. 1X N 1Y N 1Z The value of N is configured for time-division multiplexing. X N Y N Z When the second-stage filtering unit performs second-level filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor using time-division multiplexing, the value of N2 is configured as N in the time-division multiplexing configuration. 2X N 2Y N 2Z The value of N is configured for time-division multiplexing. X N Y N Z , where N X Greater than or equal to N 1X And N X Greater than or equal to N 2X N Y Greater than or equal to N 1Y And N Y Greater than or equal to N 2Y N Z Greater than or equal to N 1z And N z Greater than or equal to N 2z N X N Y N Z It can be set as needed, for example, it can be set to the maximum value supported by programmable shifter 116 and programmable shifter 126.

[0024] N 1X N 1Y N 1Z N represents the coefficients of the first-stage filter unit 110.2X N 2Y N 2Z The coefficients of the second-stage filter unit 120. N 1X N 1Y N 1Z N 2X N 2Y N 2Z It can be configured within the range supported by the programmable shifter (e.g., the range can be 0-7).

[0025] like Figure 1 As shown, the first input of the first adder 113 is connected to the output of the first programmable shifter 113, the second input of the first adder 113 is connected to the output of the first delay register 115, and the input of the first delay register 115 is connected to the output of the first intermediate buffer 114. The first delay register 115 is used to buffer the first intermediate accumulated value S1 from the previous time step. n-1 The first intermediate buffer 114 is used to cache the first intermediate accumulated value S1 at the current time. n n is the nth time, n-1 is the (n-1)th time, and if n is the current time, n-1 is the previous time.

[0026] The first input of the second adder 123 is connected to the output of the third programmable shifter 122. The second input of the second adder 123 is connected to the output of the second delay register 125. The input of the second delay register 125 is connected to the output of the second intermediate buffer 124. The second delay register 125 is used to buffer the second intermediate accumulated value S2 from the previous time step. n-1 The second intermediate buffer 124 is used to cache the second intermediate accumulated value S2 at the current time. n .

[0027] like Figure 1 As shown, the first intermediate buffer 114 includes a first intermediate buffer unit, a second intermediate buffer unit, and a third intermediate buffer unit. The first intermediate buffer unit is used to buffer the first intermediate accumulated value S of the X-axis. 1x n The second intermediate cache unit is used to cache the first intermediate accumulated value S of the Y-axis. 1y n The third intermediate cache unit is used to cache the first intermediate accumulated value S of the Z-axis. 1z nWhen the first-stage filtering unit performs first-level filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor using time-division multiplexing, the first, second, and third intermediate buffer units are activated in a time-division multiplexing manner, meaning that only one intermediate buffer unit is activated at any given time. The data input to the first intermediate buffer 114 is fed into the activated intermediate buffer unit, and the data output by the activated intermediate buffer unit is used as the output data of the first intermediate buffer 114.

[0028] The second intermediate buffer 124 includes a fourth intermediate buffer unit, a fifth intermediate buffer unit, and a sixth intermediate buffer unit. The fourth intermediate buffer unit is used to buffer the second intermediate accumulated value S of the X-axis. 2x n The fifth intermediate cache unit is used to cache the second intermediate accumulated value S of the Y-axis. 2y n The sixth intermediate cache unit is used to cache the second intermediate accumulated value S of the Z-axis. 2z n During the second-stage filtering unit's time-division multiplexing of the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor for secondary filtering, the fourth, fifth, and sixth intermediate buffer units are time-division multiplexed and activated, meaning only one intermediate buffer unit is activated at a time. Data input to the second intermediate buffer 124 is fed into the activated intermediate buffer unit, and the data output by the activated intermediate buffer unit becomes the output data of the second intermediate buffer 124.

[0029] The input terminal of the first limiter 117 is connected to the output terminal of the second programmable shifter 116, and the output terminal of the first limiter 117 is connected to the input terminal of the first-stage output buffer 118. The first limiter 117 is used to limit the input data so that the output data is between the minimum value min and the maximum value max. The input terminal of the second limiter 127 is connected to the output terminal of the fourth programmable shifter 126, and the output terminal of the second limiter 127 is connected to the input terminal of the second-stage output buffer 128. The second limiter 127 is used to limit the input data so that the output data is between the minimum value min and the maximum value max.

[0030] The first-level output buffer 118 includes a first-level X-axis output buffer unit, a first-level Y-axis output buffer unit, and a first-level Y-axis output buffer unit.

[0031] The first-level X-axis output buffer unit is used to buffer the first-level X-axis output value X. o1 The first-level Y-axis output buffer unit is used to buffer the first-level Y-axis output value Y. o1The first-level Z-axis output buffer unit is used to buffer the first-level Z-axis output value Z. o1 When the first-stage filtering unit performs first-level filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor using time-division multiplexing, the first-stage X-axis output buffer unit, the first-stage Y-axis output buffer unit, and the first-stage Z-axis output buffer unit are activated in a time-division multiplexing manner. That is, only one output buffer unit (one of the first-stage X-axis output buffer unit, the first-stage Y-axis output buffer unit, and the first-stage Z-axis output buffer unit) is activated at any given time. The data input to the first-stage output buffer 118 is input to the activated output buffer unit, and the data output by the activated output buffer unit is used as the output data of the first-stage output buffer 118.

[0032] The second-level output buffer 128 includes a second-level X-axis output buffer unit, a second-level Y-axis output buffer unit, and a second-level Y-axis output buffer unit.

[0033] The second-level X-axis output buffer unit is used to buffer the second-level X-axis output value X. o2 The second-level Y-axis output buffer unit is used to buffer the second-level Y-axis output value Y. o2 The second-level Z-axis output buffer unit is used to buffer the second-level Z-axis output value Z. o2 When the second-stage filtering unit performs secondary filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor using time-division multiplexing, the second-stage X-axis output buffer unit, the second-stage Y-axis output buffer unit, and the second-stage Y-axis output buffer unit are activated in a time-division multiplexing manner. That is, only one output buffer unit (one of the second-stage X-axis output buffer unit, the second-stage Y-axis output buffer unit, and the second-stage Y-axis output buffer unit) is activated at any given time. The data input to the second-stage output buffer 128 is input to the activated output buffer unit, and the data output by the activated output buffer unit is used as the output data of the second-stage output buffer 128.

[0034] In one specific embodiment

[0035] When the first-stage filtering unit and the second-stage filtering unit filter the X-axis sensing data of the MEMS sensor:

[0036] The first subtractor 111, first programmable shifter 112, first adder 113, first intermediate buffer 114, first delay register 115, and first-stage output buffer 118 in the first-stage filtering unit 110 execute the following formula:

[0037] S 1X n ={(x n -xo1 n-1 )< <N 1X}+S 1X n-1

[0038] At this point, the first intermediate cache unit is activated, providing the first intermediate accumulated value S from the previous time step. 1x n-1 The input of the first delay register 115 and the first subtractor 111 receives the current sensing data x along the X-axis. n The first-level X-axis output buffer unit is enabled, which provides the first-level X-axis output value X from the previous moment. o1 N1 in the first programmable shifter 112 is configured as N 1X .

[0039] The second programmable shifter 116, the first limiter 117, and the first-stage output buffer 118 in the first-stage filter unit 110 execute the following formula:

[0040] x o1 n =clip(S 1x n >>N X (min, max)

[0041] At this point, min and max are the lowest and highest values, min and max, of the first limiter 117, respectively. X For N 1X and N 2X The largest of them, x o1 n It is cached in the first-level X-axis output cache unit.

[0042] The second subtractor 121, the third programmable shifter 122, the second adder 123, the second intermediate buffer 124, the second delay register 125, and the second-stage output buffer 128 in the second-stage filtering unit 120 execute the following formula:

[0043] S 2X n ={(x o1 n -x o2 n-1 )< <N 2X}+S 2X n-1

[0044] At this point, the fourth intermediate cache is activated, providing the second intermediate accumulated value S from the previous time step. 2x n-1The second delay register 125 and the input of the second subtractor 121 receive x, which is the output of the first-stage filter unit 110. o1 n The second-level X-axis output buffer unit is enabled, which provides the second-level X-axis output value X from the previous moment. o2 N2 in the third programmable shifter 122 is configured as N 2X .

[0045] The fourth programmable shifter 126, the second limiter 127, and the second-stage output buffer 128 in the second-stage filter unit 120 execute the following formula:

[0046] x o2 n =clip(S 2x n >>N X (min, max)

[0047] At this point, min and max are the lowest and highest values ​​of the output data of the second limiter 127, respectively. X For N 1X and N 2X The largest of them, x o2 n It is cached in the second-level X-axis output cache unit and used as the output of the exponential moving average filter 100.

[0048] Preferably, the minimum value min and the maximum value max of the first limiter 117 are the same as the minimum value min and the maximum value max of the second limiter 127.

[0049] When the first-stage filtering unit and the second-stage filtering unit filter the Y-axis sensing data of the MEMS sensor:

[0050] The first subtractor 111, first programmable shifter 112, first adder 113, first intermediate buffer 114, first delay register 115, and first-stage output buffer 118 in the first-stage filtering unit 110 execute the following formula:

[0051] S 1Y n ={(y n –y o1 n-1 )< <N 1X}+S 1y n-1

[0052] At this point, the second intermediate cache unit is activated, providing the first intermediate accumulated value S from the previous time step. 1y n-1The first delay register 115 and the input of the first subtractor 111 receive the current Y-axis sensing data y. n The first-level Y-axis output buffer unit is enabled, which provides the first-level Y-axis output value y from the previous time step. o1 N1 in the first programmable shifter 112 is configured as N 1y .

[0053] The second programmable shifter 116, the first limiter 117, and the first-stage output buffer 118 in the first-stage filter unit 110 execute the following formula:

[0054] y o1 n =clip(S 1y n >>N y (min, max)

[0055] At this point, min and max are the lowest and highest values, min and max, of the first limiter 117, respectively. y For N 1y and N 2y The largest of them, y o1 n It is cached in the first-level Y-axis output cache unit.

[0056] The second subtractor 121, the third programmable shifter 122, the second adder 123, the second intermediate buffer 124, the second delay register 125, and the second-stage output buffer 128 in the second-stage filtering unit 120 execute the following formula:

[0057] S 2y n ={(y o1 n –y o2 n-1 )< <N 2y}+S 2y n-1

[0058] At this point, the fifth intermediate cache is activated, providing the second intermediate accumulated value S from the previous time step. 2y n-1 The second delay register 125 and the input of the second subtractor 121 receive the y output from the first-stage filter unit 110. o1 n The second-level Y-axis output buffer unit is enabled, which provides the second-level Y-axis output value y from the previous time step. o2 N2 in the third programmable shifter 122 is configured as N 2y .

[0059] The fourth programmable shifter 126, the second limiter 127, and the second-stage output buffer 128 in the second-stage filter unit 120 execute the following formula:

[0060] y o2 n =clip(S 2y n >>N y (min, max)

[0061] At this point, min and max are the lowest and highest values ​​of the output data of the second limiter 127, respectively. y For N 1y and N 2y The largest of them, y o2 n It is cached in the second-level Y-axis output cache unit and used as the output of the exponential moving average filter 100.

[0062] When the first-stage filtering unit and the second-stage filtering unit filter the Z-axis sensing data of the MEMS sensor:

[0063] The first subtractor 111, first programmable shifter 112, first adder 113, first intermediate buffer 114, first delay register 115, and first-stage output buffer 118 in the first-stage filtering unit 110 execute the following formula:

[0064] S 1z n ={(z n –z o1 n-1 )< <N 1z}+S 1z n-1

[0065] At this point, the third intermediate cache unit is activated, providing the first intermediate accumulated value S from the previous time step. 1z n-1 The input of the first delay register 115 and the first subtractor 111 receives the current sensing data z along the Z-axis. n The first-level Z-axis output buffer unit is enabled, which provides the first-level Z-axis output value z from the previous time step. o1 N1 in the first programmable shifter 112 is configured as N 1z .

[0066] The second programmable shifter 116, the first limiter 117, and the first-stage output buffer 118 in the first-stage filter unit 110 execute the following formula:

[0067] z o1 n=clip(S 1z n >>N z (min, max)

[0068] At this point, min and max are the lowest and highest values, min and max, of the first limiter 117, respectively. z For N 1z and N 2z The largest of them, z o1 n It is cached in the first-level Z-axis output cache unit.

[0069] The second subtractor 121, the third programmable shifter 122, the second adder 123, the second intermediate buffer 124, the second delay register 125, and the second-stage output buffer 128 in the second-stage filtering unit 120 execute the following formula:

[0070] S 2z n ={(z o1 n –z o2 n-1 )< <N 2z}+S 2z n-1

[0071] At this point, the sixth intermediate cache is activated, providing the second intermediate accumulated value S from the previous time step. 2z n-1 The second delay register 125 and the input of the second subtractor 121 receive the z output from the first-stage filter unit 110. o1 n The second-level Z-axis output buffer unit is enabled, which provides the second-level Z-axis output value z from the previous time step. o2 N2 in the third programmable shifter 122 is configured as N 2z .

[0072] The fourth programmable shifter 126, the second limiter 127, and the second-stage output buffer 128 in the second-stage filter unit 120 execute the following formula:

[0073] z o2 n =clip(S 2z n >>N z (min, max)

[0074] At this point, min and max are the lowest and highest values ​​of the output data of the second limiter 127, respectively. z For N 1z and N 2zThe largest of them, z o2 n It is cached in the second-level Y-axis output cache unit and used as the output of the exponential moving average filter 100.

[0075] In this way, it is not necessary to build a corresponding exponential moving average filter for each axis. The three axes share a single exponential moving average filter, which reduces the number of filters and thus reduces hardware costs.

[0076] It should be noted that the terms "connection" and "linked" used in this text include both direct connections between two or more objects without any intervening objects and indirect connections between two or more objects achieved through one or more intervening objects. For example, the connection between the output of A and the input of B includes both direct connections between the output of A and the input of B, and connections between the output of A and the input of B via C.

[0077] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. In addition, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.

[0078] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications and variations to the above embodiments within the scope of the present invention.

Claims

1. An exponential moving average filter for a MEMS sensor, characterized in that, It includes: The first-stage filtering unit includes: a first subtractor, a first programmable shifter, a first adder, a first intermediate buffer, a first delay register, a second programmable shifter, a first limiter, and a first-stage output buffer, wherein one input of the first subtractor is the input of the exponential moving average filter, and the other input of the first subtractor is connected to the output of the first-stage output buffer. The second-stage filtering unit includes: a second subtractor, a third programmable shifter, a second adder, a second intermediate buffer, a second delay register, a fourth programmable shifter, a second limiter, and a second-stage output buffer. One input of the second subtractor is connected to the output of the first-stage output buffer, and the other input of the second subtractor is connected to the output of the second-stage output buffer. The input of the exponential moving average filter is time-division multiplexed with the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor. The first-stage filtering unit performs first-level filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor in a time-division multiplexed manner. The second-stage filtering unit performs second-level filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor in a time-division multiplexed manner.

2. The exponential moving average filter according to claim 1, characterized in that, The input of the first programmable shifter is connected to the output of the first subtractor. The first programmable shifter is used to perform a left shift operation on the input data by N1 bits. The input of the second programmable shifter is connected to the output of the first intermediate buffer. The second programmable shifter is used to perform a right shift operation of N bits on the input data. The input of the third programmable shifter is connected to the output of the second subtractor. The third programmable shifter is used to shift the input data left by N2 bits. The input of the fourth programmable shifter is connected to the output of the second intermediate buffer. The fourth programmable shifter is used to shift the input data right by N bits. When the first-stage filtering unit performs first-stage filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor using time-division multiplexing, the value of N1 is configured as N in the time-division multiplexing configuration. 1X N 1Y N 1Z The value of N is configured for time-division multiplexing. X N Y N Z , When the second-stage filtering unit performs second-level filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor using time-division multiplexing, the value of N2 is configured as N in the time-division multiplexing configuration. 2X N 2Y N 2Z The value of N is configured for time-division multiplexing. X N Y N Z , Where N X Greater than or equal to N 1X And N X Greater than or equal to N 2X N Y Greater than or equal to N 1Y And N Y Greater than or equal to N 2Y N Z Greater than or equal to N 1z And N z Greater than or equal to N 2z .

3. The exponential moving average filter according to claim 1, characterized in that, The first input of the first adder is connected to the output of the first programmable shifter. The second input of the first adder is connected to the output of the first delay register. The input of the first delay register is connected to the output of the first intermediate buffer. The first delay register is used to buffer the first intermediate accumulated value from the previous time step, and the first intermediate buffer is used to buffer the first intermediate accumulated value from the current time step. The first input of the second adder is connected to the output of the third programmable shifter. The second input of the second adder is connected to the output of the second delay register. The input of the second delay register is connected to the output of the second intermediate buffer. The second delay register is used to buffer the second intermediate accumulated value of the previous time step. The second intermediate buffer is used to buffer the second intermediate accumulated value of the current time step.

4. The exponential moving average filter according to claim 1, characterized in that, The first intermediate buffer includes a first intermediate buffer unit, a second intermediate buffer unit, and a third intermediate buffer unit. The first intermediate buffer unit is used to buffer the first intermediate accumulated value of the X-axis, the second intermediate buffer unit is used to buffer the first intermediate accumulated value of the Y-axis, and the third intermediate buffer unit is used to buffer the first intermediate accumulated value of the Z-axis. When the first-stage filtering unit performs first-stage filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor in a time-division multiplexing manner, the first intermediate buffer unit, the second intermediate buffer unit, and the third intermediate buffer unit are activated in a time-division multiplexing manner. The second intermediate buffer includes a fourth intermediate buffer unit, a fifth intermediate buffer unit, and a sixth intermediate buffer unit. The fourth intermediate buffer unit is used to buffer the second intermediate accumulated value of the X-axis, the fifth intermediate buffer unit is used to buffer the second intermediate accumulated value of the Y-axis, and the sixth intermediate buffer unit is used to buffer the second intermediate accumulated value of the Z-axis. When the second-stage filtering unit performs second-stage filtering on the X-axis sensing data, Y-axis sensing data, and Z-axis sensing data of the MEMS sensor in a time-division multiplexing manner, the fourth intermediate buffer unit, the fifth intermediate buffer unit, and the sixth intermediate buffer unit are activated in a time-division multiplexing manner.

5. The exponential moving average filter according to claim 1, characterized in that, The input of the first limiter is connected to the output of the second programmable shifter, and the output of the first limiter is connected to the input of the first-stage output buffer. The first limiter is used to limit the input data so that the output data is between the minimum and maximum values. The input of the second limiter is connected to the output of the fourth programmable shifter, and the output of the second limiter is connected to the input of the second-stage output buffer. The second limiter is used to limit the input data so that the output data is between the minimum and maximum values.

6. The exponential moving average filter according to claim 1, characterized in that, The first-stage output buffer includes a first-stage X-axis output buffer unit, a first-stage Y-axis output buffer unit, and a first-stage Y-axis output buffer unit. The first-stage X-axis output buffer unit is used to buffer the first-stage X-axis output value, the first-stage Y-axis output buffer unit is used to buffer the first-stage Y-axis output value, and the first-stage Z-axis output buffer unit is used to buffer the first-stage Z-axis output value. When the first-stage filtering unit performs first-stage filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor using time-division multiplexing, the first-stage X-axis output buffer unit, the first-stage Y-axis output buffer unit, and the first-stage Z-axis output buffer unit are activated in a time-division multiplexing manner. The second-stage output buffer includes a second-stage X-axis output buffer unit, a second-stage Y-axis output buffer unit, and a second-stage Y-axis output buffer unit. The second-level X-axis output buffer unit is used to buffer the second-level X-axis output value, the second-level Y-axis output buffer unit is used to buffer the second-level Y-axis output value, and the second-level Z-axis output buffer unit is used to buffer the second-level Z-axis output value. When the second-level filtering unit performs secondary filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor in a time-division multiplexing manner, the second-level X-axis output buffer unit, the second-level Y-axis output buffer unit, and the second-level Z-axis output buffer unit are activated in a time-division multiplexing manner.

7. The exponential moving average filter according to claim 1, characterized in that, The input of the exponential moving average filter is time-division multiplexed with the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor within the same week. The first-stage filtering unit performs first-level filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor within the same week using time-division multiplexing. The second-stage filtering unit performs second-level filtering on the X-axis, Y-axis, and Z-axis sensing data of the MEMS sensor within the same week using time-division multiplexing.