Human motion state detection method and device based on three-axis accelerometer

文档序号:944517 发布日期:2020-10-30 浏览:12次 中文

阅读说明:本技术 一种基于三轴加速度计的人体运动状态检测方法及装置 (Human motion state detection method and device based on three-axis accelerometer ) 是由 骆昭阳 于 2020-06-22 设计创作,主要内容包括:本发明公开了一种基于三轴加速度计的人体运动状态检测方法及装置,所述方法包括:在预设采样时间周期内,根据采样频率采集三轴加速度计的三个轴向的加速度值,计算三个轴向的合加速度值,得到合加速度值的采样数据曲线;对所述合加速度值的采样数据曲线先后进行一阶低通滤波处理和若干次滑动平均滤波处理;采用峰值检测法确定所述合加速度值的采样数据曲线中的计步波峰后进行数据分析,判断是否符合预设的状态条件,从而判定当前用户的运动状态。本发明通过取三个轴向的矢量和进行滤波处理,使得检测数据更连续平滑,并基于一段时间内的历史数据对数据进行分析,降低运动状态的误判率,提高自动检测人体运动状态的准确性和可靠性。(The invention discloses a human motion state detection method and a human motion state detection device based on a triaxial accelerometer, wherein the method comprises the following steps: acquiring acceleration values of three axial directions of a three-axis accelerometer according to sampling frequency in a preset sampling time period, and calculating the total acceleration values of the three axial directions to obtain a sampling data curve of the total acceleration values; sequentially performing first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the sampled data curve of the combined acceleration value; and determining the step-counting peak in the sampled data curve of the combined acceleration value by adopting a peak value detection method, then carrying out data analysis, and judging whether the preset state condition is met or not, thereby judging the motion state of the current user. According to the invention, the three axial vectors are taken and filtered, so that the detected data are more continuous and smooth, and the data are analyzed based on the historical data in a period of time, thereby reducing the misjudgment rate of the motion state and improving the accuracy and reliability of automatically detecting the motion state of the human body.)

1. A human motion state detection method based on a three-axis accelerometer is characterized by at least comprising the following steps:

acquiring acceleration values of three axial directions of a three-axis accelerometer according to a first sampling frequency in a preset sampling time period, and calculating a combined acceleration value of the three axial directions to obtain a first sampling data curve of the combined acceleration value;

sequentially performing first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the first sampling data curve of the combined acceleration value;

after the filtering processing is finished, determining a step-counting peak in a first sampling data curve of the combined acceleration value by adopting a peak detection method, and then performing data analysis;

and if the first sampling data curve of the combined acceleration value meets a first state condition, judging that the running state is currently in.

2. The method for detecting a moving state of a human body based on a tri-axial accelerometer according to claim 1, further comprising:

acquiring acceleration values of three axial directions of the three-axis accelerometer according to a second sampling frequency in a preset sampling time period, and calculating a combined acceleration value of the three axial directions to obtain a second sampling data curve of the combined acceleration value;

Then, carrying out first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the second sampling data curve of the combined acceleration value in sequence;

after the filtering processing is finished, determining a step-counting peak in a second sampling data curve of the combined acceleration value by adopting a peak detection method, and then performing data analysis;

and if the second sampling data curve of the combined acceleration value meets a second state condition, judging that the walking state is currently in the walking state.

3. The method for detecting a human motion state based on a three-axis accelerometer according to claim 1, wherein the first state condition is specifically:

the step-counting wave peak values in the first sampling data curve of the acceleration value are both larger than the peak values of the front and rear sampling points and larger than the set first peak value;

and the time difference between the step-counting peak point and the last peak point is smaller than a set first threshold value.

4. The method for detecting a human motion state based on a three-axis accelerometer according to claim 2, wherein the second state condition is specifically:

the step-counting wave peak values in the second sampling data curve of the acceleration value are both larger than the peak values of the front and rear sampling points and larger than the set second peak value;

And the time difference between the step-counting peak point and the last peak point is smaller than the set second threshold value and larger than the set first threshold value.

5. A human motion state detection device based on triaxial accelerometer, comprising:

the data sampling module is used for acquiring three axial acceleration values of the three-axis accelerometer according to a first sampling frequency in a preset sampling time period, and calculating a three axial combined acceleration value to obtain a first sampling data curve of the combined acceleration value;

the filtering processing module is used for sequentially carrying out first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the first sampling data curve of the combined acceleration value;

the data analysis module is used for determining a step-counting peak in a first sampling data curve of the resultant acceleration value by adopting a peak detection method and then carrying out data analysis after the filtering processing is finished;

and the running state judging module is used for judging that the running state is currently in if the first sampling data curve of the combined acceleration value meets a first state condition.

6. The device for detecting the motion state of the human body based on the tri-axial accelerometer according to claim 5, wherein the data sampling module is further configured to collect acceleration values of the tri-axial accelerometer in three axial directions according to a second sampling frequency within a preset sampling time period, and calculate a resultant acceleration value of the three axial directions to obtain a second sampling data curve of the resultant acceleration value.

7. The human motion state detection device based on the triaxial accelerometer of claim 5, wherein the filtering processing module is further configured to successively perform first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the second sampled data curve of the combined acceleration value;

and the data analysis module is also used for performing data analysis after determining the step-counting peak in the second sampling data curve of the combined acceleration value by adopting a peak value detection method.

8. The device of claim 5, further comprising:

and the walking state judging module is used for judging that the walking state is currently in if the second sampling data curve of the combined acceleration value meets a second state condition.

9. A terminal device for human motion state detection based on a three-axis accelerometer, comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the human motion state detection based on a three-axis accelerometer according to any one of claims 1 to 4.

10. A computer-readable storage medium, comprising a stored computer program, wherein when the computer program runs, the computer-readable storage medium is controlled by a device to execute the method for detecting the motion state of the human body based on the three-axis accelerometer according to any one of claims 1 to 4.

Technical Field

The invention relates to the technical field of human motion state detection, in particular to a human motion state detection method and device based on a three-axis accelerometer.

Background

At present, the rhythm of life is accelerated, and many people gradually neglect the health management of the people. In order to encourage people to walk more and more, a step counting function is supported on a plurality of electronic products, and people can conveniently monitor the daily exercise amount. Various techniques for counting the walking condition of the user appear at present, but the accuracy of the statistics is not satisfactory. In addition, while counting the walking condition of the user, some electronic products can also detect the motion state of the user at the same time, and detect that the user is currently walking or running normally, thereby further monitoring and analyzing the motion amount of the user.

However, in the course of research and practice on the prior art, the inventor of the present invention finds that the motion state of the user is mainly determined by acquiring the accelerations of the acceleration sensor in three axial directions, but the method has the following defects: under a plurality of different scenes, the obtained three axial acceleration values are greatly different and irregularly found, and the conditions of erroneous judgment and missing judgment are easy to occur; acceleration data are discrete and have more noises, so that subsequent judgment and calculation and accuracy are easily influenced; the judgment condition is too simple and one-sided, so that the problems of erroneous judgment and low accuracy are easily caused. Therefore, a method for detecting a motion state of a human body is needed to overcome the above-mentioned drawbacks.

Disclosure of Invention

The technical problem to be solved by the embodiments of the present invention is to provide a method and an apparatus for detecting a motion state of a human body based on a three-axis accelerometer, which can effectively identify a current motion state of a user.

In order to solve the above problem, an embodiment of the present invention provides a human motion state detection method based on a three-axis accelerometer, which at least includes the following steps:

acquiring acceleration values of three axial directions of a three-axis accelerometer according to a first sampling frequency in a preset sampling time period, and calculating a combined acceleration value of the three axial directions to obtain a first sampling data curve of the combined acceleration value;

sequentially performing first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the first sampling data curve of the combined acceleration value;

after the filtering processing is finished, determining a step-counting peak in a first sampling data curve of the combined acceleration value by adopting a peak detection method, and then performing data analysis;

and if the first sampling data curve of the combined acceleration value meets a first state condition, judging that the running state is currently in.

As a preferable scheme, the human motion state detection method based on the three-axis accelerometer further includes:

Acquiring acceleration values of three axial directions of the three-axis accelerometer according to a second sampling frequency in a preset sampling time period, and calculating a combined acceleration value of the three axial directions to obtain a second sampling data curve of the combined acceleration value;

then, carrying out first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the second sampling data curve of the combined acceleration value in sequence;

after the filtering processing is finished, determining a step-counting peak in a second sampling data curve of the combined acceleration value by adopting a peak detection method, and then performing data analysis;

and if the second sampling data curve of the combined acceleration value meets a second state condition, judging that the walking state is currently in the walking state.

As a preferred scheme, the first state condition specifically includes:

the step-counting wave peak values in the first sampling data curve of the acceleration value are both larger than the peak values of the front and rear sampling points and larger than the set first peak value;

and the time difference between the step-counting peak point and the last peak point is smaller than a set first threshold value.

Preferably, the second state condition is specifically:

the step-counting wave peak values in the second sampling data curve of the acceleration value are both larger than the peak values of the front and rear sampling points and larger than the set second peak value;

And the time difference between the step-counting peak point and the last peak point is smaller than the set second threshold value and larger than the set first threshold value.

An embodiment of the present invention further provides a human motion state detection apparatus based on a three-axis accelerometer, including:

the data sampling module is used for acquiring three axial acceleration values of the three-axis accelerometer according to a first sampling frequency in a preset sampling time period, and calculating a three axial combined acceleration value to obtain a first sampling data curve of the combined acceleration value;

the filtering processing module is used for sequentially carrying out first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the first sampling data curve of the combined acceleration value;

the data analysis module is used for determining a step-counting peak in a first sampling data curve of the resultant acceleration value by adopting a peak detection method and then carrying out data analysis after the filtering processing is finished;

and the running state judging module is used for judging that the running state is currently in if the first sampling data curve of the combined acceleration value meets a first state condition.

As a preferred scheme, the data sampling module is further configured to acquire three axial acceleration values of the three-axis accelerometer according to a second sampling frequency in a preset sampling time period, and calculate a resultant acceleration value of the three axial directions to obtain a second sampling data curve of the resultant acceleration value.

As a preferred scheme, the filtering processing module is further configured to successively perform first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the second sampled data curve of the combined acceleration value;

and the data analysis module is also used for performing data analysis after determining the step-counting peak in the second sampling data curve of the combined acceleration value by adopting a peak value detection method.

As a preferred scheme, the human motion state detection device based on the three-axis accelerometer further includes:

and the walking state judging module is used for judging that the walking state is currently in if the second sampling data curve of the combined acceleration value meets a second state condition.

One embodiment of the present invention provides a terminal device for human motion state detection based on a three-axis accelerometer, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the human motion state detection method based on a three-axis accelerometer.

One embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program runs, the apparatus on which the computer-readable storage medium is located is controlled to execute the human motion state detection method based on a three-axis accelerometer.

The embodiment of the invention has the following beneficial effects:

the embodiment of the invention provides a human motion state detection method and a human motion state detection device based on a triaxial accelerometer, wherein the method comprises the following steps: acquiring acceleration values of three axial directions of a three-axis accelerometer according to sampling frequency in a preset sampling time period, and calculating the total acceleration values of the three axial directions to obtain a sampling data curve of the total acceleration values; sequentially performing first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the sampled data curve of the combined acceleration value; and determining the step-counting peak in the sampled data curve of the combined acceleration value by adopting a peak value detection method, then carrying out data analysis, and judging whether the preset state condition is met or not, thereby judging the motion state of the current user.

Compared with the prior art, the embodiment of the invention directly reflects the motion state of the user in the motion direction by taking the three axial vector sums for data analysis, enables the detected data to be more continuous and smooth by taking the three axial vector sums for filtering processing, analyzes the data based on the historical data within a period of time, reduces the misjudgment rate of the motion state, and improves the accuracy and reliability of automatically detecting the motion state of the human body.

Drawings

Fig. 1 is a schematic flowchart of a human motion state detection method based on a three-axis accelerometer according to a first embodiment of the present invention;

fig. 2 is a schematic flowchart of another human motion state detection method based on a three-axis accelerometer according to a second embodiment of the present invention;

fig. 3 is a schematic structural diagram of a human motion state detection apparatus based on a three-axis accelerometer according to a third embodiment of the present invention;

fig. 4 is a schematic structural diagram of another human motion state detection apparatus based on a three-axis accelerometer according to a third embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

In the description of the present application, it is to be understood that the terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present application, "a plurality" means two or more unless otherwise specified.

First, an application scenario that can be provided by the present invention is described, such as detecting the current motion state of a user.

The first embodiment of the present invention:

please refer to fig. 1.

As shown in fig. 1, the present embodiment provides a method for detecting a human motion state based on a three-axis accelerometer, which at least includes the following steps:

s101, acquiring acceleration values of three axial directions of a three-axis accelerometer according to a first sampling frequency in a preset sampling time period, and calculating a combined acceleration value of the three axial directions to obtain a first sampling data curve of the combined acceleration value;

specifically, for step S101, when the device is placed in the hand, the accelerometer 3 coordinate axis directions x, y, z correspond to the right direction, the front direction, and the vertical direction, respectively. When the device is static, the gravity acceleration of the x, y and Z axial directions is 0.0m/s2,0.0m/m/s2,9.8m/m/s2. When a person walks, the acceleration change conditions in 3 directions are that the acceleration in the vertical direction of the Z axis fluctuates obviously. The acceleration fluctuation periods in the front-rear direction and the left-right direction are not significant in the fluctuation in the vertical direction.

In order to reduce the influence of the device placement position on the result, the combined acceleration of 3 axial accelerations is adopted, and the combined acceleration of the three-axis acceleration is solved:

Figure BDA0002550920220000061

Wherein A isx、Ay、AzThe acceleration values of the three axes of the mobile phone are respectively, and A is a resultant acceleration vector. When the human body walks slowly, the acceleration vector of the human body is small. When the human body runs at a fast pace, the acceleration vector of the human body is large. The state that the human body is walking or running can be judged by setting a threshold value. It should be noted that in the present embodiment, the sampling frequency of the accelerometer is set to 50 Hz.

S102, sequentially performing first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the first sampling data curve of the combined acceleration value;

specifically, for step S102, the original acceleration sample value is processed 2 times, including a first-order low-pass filtering process and a moving average filtering process.

z(n)=(1-a)z(n-1)+ax(n) (2)

Figure BDA0002550920220000062

Wherein, the formula (2) is a first-order low-pass filtering formula, a is a filtering coefficient, x (n) is a current sampling value, z (n-1) is a previous low-pass filtering output value, z (n) is a current low-pass filtering output value, y is a current low-pass filtering output value(n)For sliding filterThe wave output value. The first-order low-pass filtering method adopts the sampling value and the last filtering output value to carry out weighting to obtain an effective filtering value, so that the output has a feedback effect on the input.

Equation (3) is a moving average filter equation, and the expression of the equation is as follows: if the original data a1, a2 and a3 are compared and the data a4 is newly added, the a4 is (a2+ a3+ a 4)/3. If data a5 is added, a5 is (a3+ a4+ a5)/3, and so on. Where N in the formula represents the filter window length. The formula means that newly added data is averaged with previous historical data.

Specifically, in the embodiment, some interference generated by the acceleration sensor hardware itself is filtered by low-pass filtering, some pseudo peaks are filtered by moving average filtering, and an FIR filter can be selected. In this embodiment, the FIR filter is designed by using a window function method. The window function adopts a rectangular window, and the designed filter has a flat passband, a narrow transition band and good filtering performance. The sampling points in the walking stage are intercepted, and after low-pass filtering and secondary filtering, the waveform is smoother than the original waveform, and meanwhile, the false wave peak generated by body shaking is greatly reduced.

S103, after the filtering processing is finished, determining a step-counting peak in a first sampling data curve of the resultant acceleration value by adopting a peak value detection method, and then performing data analysis;

specifically, in step S103, the key point of the peak detection method is to accurately determine a step-counting peak, in this embodiment, the waveform becomes smoother through multiple filtering, and most of the larger pseudo peaks are filtered out. Further, a step count is determined by setting a peak threshold value and a time difference threshold value of adjacent peak values. The frequency of normal human running is about 50Hz, so the time difference threshold here takes 0.02 s.

And S104, if the first sampling data curve of the combined acceleration value meets a first state condition, judging that the running state is currently in the running state.

As a preferred scheme, the first state condition specifically includes:

the step-counting wave peak values in the first sampling data curve of the acceleration value are both larger than the peak values of the front and rear sampling points and larger than the set first peak value;

and the time difference between the step-counting peak point and the last peak point is smaller than a set first threshold value.

Specifically, for step S104, the first threshold t1< 0.02S; when the data satisfies the first state condition, it may be considered to be in a motion state. And when the size of the wave peak is larger than the threshold value and the period of the wave peak is within a certain range, the running state can be considered.

The final relation between the multi-time filtered output and the sampled input is obtained from equations (2) and (3):

y(n-1)-y(n-2)>0 (4)

y(n-1)-y(n)>0 (5)

T(n-1)-TL>Tm (6)

wherein x (n-i) is the sampled input value, y (n) is the output value of multiple filtering, aiFor the coefficients of the multiple filtering, y (n-2), y (n-1), y (n) are the consecutive 3 filtered outputs, T(n-1)Is the corresponding sampling time of y (n-1), TLFor the sampling time corresponding to the last peak, Tm is the minimum time difference between two peaks, i.e. the time difference threshold, which is taken here to be 20 ms. If equation (4-6) is satisfied and the acceleration vector is large, the running state is considered.

In equation (4), y (n-1) represents the amplitude of the last sample point, and y (n-2) represents the amplitude of the last sample point. The meaning of equation (4) is that the amplitude of the last sample point is greater than the amplitude of the last sample point.

In equation (5), y (n) represents the amplitude of the current sample point, and y (n-1) represents the amplitude of the last sample point. The meaning of equation (5) is that the magnitude of the last sample point is greater than the magnitude of the current sample point.

T in formula (6)(n-1)Is the corresponding sampling time of y (n-1), TLThe Tm is the minimum time difference between two peaks, i.e. the time difference threshold, for the sampling time corresponding to the last peak. The meaning of the expression, namely the last sampling point, is larger than the last sampling point confirmed by the formulas (4) and (5)And the next point, considered as a peak point. The time difference between the peak point and the previous peak point needs to be smaller than the set threshold, i.e. the frequency is high enough and the period is short enough, to be considered as running.

In a particular embodiment, when the device is placed in a pocket or worn on the waist, the person's walking or running center of gravity will move up and down regularly, reflecting a sine wave-like acceleration. When the equipment is held on the hand, a person walks or runs, the handle normally swings regularly and periodically, and the sine wave is similar to the sine wave reflected on the acceleration. Therefore, when the accelerated data meets the sine wave rule and the amplitude and the period are within a certain range, the running can be considered.

In this embodiment, the acceleration vector data needs to be processed by a filter algorithm before being actually used. After filtering, the variation range of the data is compressed, and different filtering algorithms are adopted, so that the data variation range is compressed to different degrees, and a fixed threshold range is not provided, and a relative threshold range is required to be set according to the used filtering algorithm.

The threshold of the peak period is related to the sampling frequency, and the sampling frequency of 50Hz is adopted in this embodiment, that is, 50 points are adopted per second, and the time interval of each point is 20 milliseconds. Therefore, the period is within 30 sampling points, that is, the period is within 600 ms, and the present embodiment determines that the current user is in the running state. Note that the period is not a fixed value, some sensors support a higher sampling frequency, more data points can be acquired per second, and the corresponding period range is also larger because the actual time represented by each point becomes smaller.

When the equipment is placed on the body, the wave crest is in positive correlation with the force exertion degree of the foot-stepping ground, and the wave crest value is larger when the equipment runs faster and the foot-stepping ground is more forcefully exerted. The period of the wave crest and the step frequency are in positive first closing, the faster the step frequency is, the faster the change frequency of the key point is, the direct reaction is on the acceleration value, namely the period of the wave crest is narrowed.

And when the equipment is held on the hand, the wave crest is in positive correlation with the force exertion degree of the swing arm, and the faster the swing arm runs, the more the force exertion is, the larger the wave crest value is. The wave crest period is positively correlated with the frequency of the swing arm, and the higher the swing arm frequency is, the narrower the wave crest period is.

It should be noted that occasional glitches may inevitably occur during the actual detection process. In order to avoid misjudgment, when the first points of the data are all in a rising state and the last points are all in a falling state, the data are regarded as wave peaks, otherwise, the wave peaks are ignored.

The threshold value of the peak and the period range of the peak are obtained by counting a large amount of data by different people, and are not described herein again.

The human motion state detection method based on the triaxial accelerometer provided by the embodiment at least comprises the following steps: acquiring acceleration values of three axial directions of a three-axis accelerometer according to a first sampling frequency in a preset sampling time period, and calculating a combined acceleration value of the three axial directions to obtain a first sampling data curve of the combined acceleration value; sequentially performing first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the first sampling data curve of the combined acceleration value; after the filtering processing is finished, determining a step-counting peak in a first sampling data curve of the combined acceleration value by adopting a peak detection method, and then performing data analysis; and if the first sampling data curve of the combined acceleration value meets a first state condition, judging that the running state is currently in.

Compared with the prior art, the embodiment has the following beneficial effects:

(1) by taking the three axial vectors and analyzing, the motion state in the motion direction is directly and regularly reflected, the current motion state is more intuitively detected, and the situations of erroneous judgment and missed judgment are avoided;

(2) by filtering the calculated vector sum, the detected data is more continuous and smooth, and the noise of discrete data is reduced, so that the subsequent judgment and the accuracy of the motion state are prevented from being influenced;

(3) the scheme focuses on historical data over a period of time and analyzes the data. When the historical data meets the running motion curve, the running event is considered, and the misjudgment rate is reduced.

Second embodiment of the invention:

please refer to fig. 2.

As shown in fig. 2, the present embodiment provides another human motion state detection method based on a three-axis accelerometer, including:

s201, acquiring three axial acceleration values of a three-axis accelerometer according to a second sampling frequency in a preset sampling time period, and calculating a three axial combined acceleration value to obtain a second sampling data curve of the combined acceleration value;

specifically, for step S201, in order to reduce the influence of the device placement position on the result, the resultant acceleration of 3 axial accelerations is adopted; when the human body walks slowly, the acceleration vector of the human body is small. When the human body runs at a fast pace, the acceleration vector of the human body is large. The state that the human body is walking or running can be judged by setting a threshold value. It should be noted that in this embodiment, the sampling frequency of the accelerometer is set to 20 Hz.

S202, sequentially performing first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the second sampling data curve of the combined acceleration value;

specifically, for step S202, the original acceleration sample value is processed 2 times, including a first-order low-pass filtering process and a moving average filtering process. Some interference generated by the acceleration sensor hardware is filtered through low-pass filtering, some pseudo peaks are filtered through moving average filtering, and an FIR filter can be selected. In this embodiment, the FIR filter is designed by using a window function method. The sampling points in the walking stage are intercepted, and after low-pass filtering and secondary filtering, the waveform is smoother than the original waveform, and meanwhile, the false wave peak generated by body shaking is greatly reduced.

S203, after the filtering processing is finished, determining a step-counting peak in a second sampling data curve of the resultant acceleration value by adopting a peak value detection method, and then performing data analysis;

specifically, in step S203, a step-counting peak is accurately determined by a peak detection method, and the text is filtered for multiple times, so that the waveform becomes smoother, and most of the larger pseudo peaks are filtered out. Further, a step count is determined by setting a peak threshold value and a time difference threshold value of adjacent peak values. The frequency of normal human walking is about 20Hz, so the time difference threshold in this embodiment is 0.05 s.

And S204, if the second sampling data curve of the combined acceleration value meets a second state condition, judging that the walking state is currently in the walking state.

Preferably, the second state condition is specifically:

the step-counting wave peak values in the second sampling data curve of the acceleration value are both larger than the peak values of the front and rear sampling points and larger than the set second peak value;

and the time difference between the step-counting peak point and the last peak point is smaller than the set second threshold value and larger than the set first threshold value.

Specifically, in step S204, the determination condition of the second threshold t2 is 0.02S < t2< 0.05S; and when the data meets the second state condition and the size of the wave peak is larger than the threshold value and the period of the wave peak is within a certain range, the walking state can be considered.

The final relation between the multi-time filtered output and the sampled input is obtained from equations (2) and (3):

y(n-1)-y(n-2)>0 (4)

y(n-1)-y(n)>0 (5)

T(n-1)-TL>Tm (6)

wherein x (n-i) is the sampled input value, y (n) is the output value of multiple filtering, aiFor the coefficients of the multiple filtering, y (n-2), y (n-1), y (n) are the consecutive 3 filtered outputs, T(n-1)Is the corresponding sampling time of y (n-1), TLFor the sampling time corresponding to the last peak, Tm is the minimum time difference between two peaks, i.e. the time difference threshold, which is taken here to be 20 ms. If the formula (4-6) is satisfied and the acceleration vector is large, the walking state is considered, and the number of wave crests is the number of steps of walking.

In this embodiment, the acceleration vector data needs to be processed by a filter algorithm before being actually used. After the filtering process, the amplitude of the data change is compressed. Different filtering algorithms are adopted, the degree of compression of the data change amplitude is different, so that a fixed threshold range is not provided, and a relative threshold range needs to be set according to the used filtering algorithm.

The threshold value of the peak period is related to the sampling frequency, and the sampling frequency of 20Hz is adopted in the embodiment, that is, 20 points are adopted in each second, and the time interval of each point is 50 milliseconds. Therefore, the period is within 6-16 sampling points, i.e. the period is within 300-. It should be noted that the period is not a fixed value, some sensors support a higher sampling frequency, more data points can be acquired per second, and the corresponding period range is larger because the actual time represented by each point is smaller.

When the equipment is placed on the body, the wave crest is in positive correlation with the force exertion degree of the foot on the ground, and the wave crest value is larger when the foot is exerted on the ground in a stepping mode faster. The period of the wave crest and the step frequency are in positive first closing, the faster the step frequency is, the faster the change frequency of the key point is, the direct reaction is on the acceleration value, namely the period of the wave crest is narrowed.

When the equipment is held on a hand, the wave crest is in positive correlation with the force exertion degree of the swing arm, and the faster the equipment is moved, the more forceful the swing arm is, the larger the wave crest value is. The wave crest period is positively correlated with the frequency of the swing arm, and the higher the swing arm frequency is, the narrower the wave crest period is.

It should be noted that occasional glitches may inevitably occur during the actual detection process. In order to avoid misjudgment, when the first points of the data are all in a rising state and the last points are all in a falling state, the data are regarded as wave peaks, otherwise, the wave peaks are ignored.

The threshold value of the peak and the period range of the peak are obtained by counting a large amount of data by different people, and are not described herein again.

Another human motion state detection method based on a three-axis accelerometer provided by this embodiment includes: acquiring acceleration values of three axial directions of the three-axis accelerometer according to a second sampling frequency in a preset sampling time period, and calculating a combined acceleration value of the three axial directions to obtain a second sampling data curve of the combined acceleration value; then, carrying out first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the second sampling data curve of the combined acceleration value in sequence; after the filtering processing is finished, determining a step-counting peak in a second sampling data curve of the combined acceleration value by adopting a peak detection method, and then performing data analysis; and if the second sampling data curve of the combined acceleration value meets a second state condition, judging that the walking state is currently in the walking state.

Compared with the prior art, the embodiment has the following beneficial effects:

(1) by taking the three axial vectors and analyzing, the motion state in the motion direction is directly and regularly reflected, the current motion state is more intuitively detected, and the situations of erroneous judgment and missed judgment are avoided;

(2) by filtering the calculated vector sum, the detected data is more continuous and smooth, and the noise of discrete data is reduced, so that the subsequent judgment and the accuracy of the motion state are prevented from being influenced;

(3) the scheme focuses on historical data over a period of time and analyzes the data. When the historical data meets the running motion curve, the event is considered as a walking event, and the misjudgment rate is reduced.

Third embodiment of the invention:

please refer to fig. 3-4.

As shown in fig. 3, the present embodiment provides a human motion state detection apparatus based on a three-axis accelerometer, including:

the data sampling module 100 is used for acquiring three axial acceleration values of the three-axis accelerometer according to a first sampling frequency in a preset sampling time period, and calculating a resultant acceleration value of the three axial acceleration values to obtain a first sampling data curve of the resultant acceleration value;

the filtering processing module 200 is configured to successively perform first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the first sampling data curve of the combined acceleration value;

The data analysis module 300 is configured to perform data analysis after determining a step-counting peak in a first sampling data curve of the combined acceleration value by using a peak detection method after the filtering processing is completed;

and the running state determining module 400 is configured to determine that the vehicle is currently in a running state if the first sampled data curve of the combined acceleration value meets a first state condition.

In a preferred embodiment, the data sampling module 100 is further configured to acquire acceleration values of three axes of the three-axis accelerometer according to a second sampling frequency in a preset sampling time period, and calculate a resultant acceleration value of the three axes to obtain a second sampling data curve of the resultant acceleration value.

In a preferred embodiment, the filtering processing module 200 is further configured to successively perform first-order low-pass filtering processing and a plurality of times of moving average filtering processing on the second sampled data curve of the combined acceleration value;

the data analysis module 300 is further configured to perform data analysis after determining a step-counting peak in the second sampled data curve of the combined acceleration value by using a peak detection method.

In a preferred embodiment, as shown in fig. 4, the human motion state detection apparatus based on a three-axis accelerometer further includes:

And a walking state determining module 500, configured to determine that the vehicle is currently in a walking state if the second sampled data curve of the combined acceleration value meets a second state condition.

One embodiment of the present invention provides a terminal device for human motion state detection based on a three-axis accelerometer, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the human motion state detection method based on a three-axis accelerometer.

One embodiment of the present invention provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program runs, the apparatus on which the computer-readable storage medium is located is controlled to execute the human motion state detection method based on a three-axis accelerometer.

In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.

In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the modules may be a logical division, and in actual implementation, there may be another division, for example, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.

The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.

In addition, functional modules in the embodiments of the present invention may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.

The foregoing is directed to the preferred embodiment of the present invention, and it is understood that various changes and modifications may be made by one skilled in the art without departing from the spirit of the invention, and it is intended that such changes and modifications be considered as within the scope of the invention.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种小体积高精度惯性测量单元

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!