Weinberg 非线性步长/步速估算模型

步频估计

首先,将步频估计出来,速度 = 步频*步长,距离=步数*步长

下面展示了如何识别出下肢的站立相和摆动相,并附上相关python代码,可用ChatGPT转成C代码。

如上图所示,要将上升沿与下降沿识别出来,上升沿中包含了一些低噪声,下降沿中包了部分 高噪声,代码如下,挺繁琐的,无语。。。。。。

def filter():
    T_detection = []
    peak = max(w_2)*1.3
    count_low =0
    count_high =0
    high_switch=0
    low_switch=1
    high_statrt =0
    low_statrt =0

    high_label = 0

    for i in range(len(w_2)):
        # 如果当前值小于11000
        if w_2[i] < 11000:
            if low_switch == 1:
                low_statrt = 1
                count_low += 1
                high_switch = 0
                high_label = 0   ###########################

            # 在low_statrt为1时,确保每轮都有数据
            if count_high < 15 and high_statrt == 1:
                high_label = 1  ###########################
                count_high += 1  # 计数器增加
            elif count_high >= 15 and high_statrt == 1:
                low_switch = 1
                high_statrt = 0
                count_high = 0

        # 如果当前值不小于11000
        else:
            if high_switch == 1:
                    high_statrt = 1
                high_label = 1   ###########################
                count_high += 1
                low_switch = 0

            # 在high_statrt为1时,确保每轮都有数据
            if count_low < 15 and low_statrt == 1:
                high_label = 0  ###########################
                count_low += 1  # 计数器增加
            elif count_low >= 15 and low_statrt == 1:
                high_switch = 1
                low_statrt = 0
                count_low = 0

        if high_label == 1:
            T_detection.append(peak)  # 添加0到列表
        else:
            T_detection.append(0)  # 添加0到列表

步长估计

根据“Using the ADXL202 in Pedometer and Personal Navigation Applications”文章提到的公式:

Distance = \sqrt[4]{Amax-Amin}*n*K

 where:
Amin is the minimum acceleration measured in the Zaxis in a single stride.
Amax is the maximum acceleration measured in the Zaxis in a single stride.

n is the number of steps walked

K is a constant for unit conversion (i.e., feet or meterstraveled).

讲一下标准的来源:

在行走时,只有当脚离开地面时,膝盖才会弯曲。因此,我们可以把腿看作是一个固定长度的杠杆,而脚是在地上的。图1说明了在行走时,臀部和上半身是如何垂直移动的。通过相似角度的几何形状,我们知道:

\beta =\vartheta

所以,可得:

Stride = \frac{2*Bounce}{\alpha }

其中,Bounce是臀部(或上半身)的垂直位移(Z轴)。 

弹跳(Z轴位移)可以计算为Z轴加速度的第二个积分。\alpha是一个小角度,很难测量,因为在行走时所有轴都有很多冲击。我们已经通过经验证明,我们可以简单地使用的一个常数,而没有一个很大的精度损失。实际上,我们可以通过:

Distance = \sqrt[4]{Amax-Amin}*n*K

 

实验结果

拟合的行走轨迹 (真实路线近似是矩形)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值