找传奇、传世资源到传世资源站!

python 时域特征提取

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

仅一个方法

import cmathdef psfeatureTime(data, p1, p2): df_min = data[p1:p2].min() # 最小值 df_max = data[p1:p2].max() # 幅值 df_mean = data[p1:p2].mean() # 均值 df_var = data[p1:p2].var() # 方差 df_std = data[p1:p2].std() # 标准差 df_rms = cmath.sqrt(pow(df_mean, 2) pow(df_std, 2)) # 均方根 # df_rms = cmath.sqrt(np.sum([x ** 2 for x in data[p1:p2]]) / len(data[p1:p2])) df_skew = Series(data[p1:p2]).skew() # 偏度 df_kurt = Series(data[p1:p2]).kurt() # 峭度 sum = 0 for i in range(p1, p2): sum = cmath.sqrt(abs(data[i])) df_s = df_rms / (abs(data[p1:p2]).mean()) # 波形因子 df_c = (max(data[p1:p2])) / df_rms # 峰值因子 df_i = (max(data[p1:p2])) / (abs(data[p1:p2]).mean()) # 脉冲因子 df_l = (max(data[p1:p2])) / pow((sum / (p2 - p1)), 2) # 裕度因子 timefeature_list = [df_min, df_max, df_mean, df_std, df_rms, df_skew, df_kurt, df_s, df_c, df_i, df_l] self.timeFeatureList = timefeature_list return timefeature_list

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复