极大值检测函数用于在指定窗口中寻找序列的局部极大值。

ts_find_peaks

函数格式:
select ts_find_peaks(x, y, winSize)
参数说明如下:
参数 说明 取值
x 时间列,从小到大排列。 格式为Unixtime时间戳,单位为秒。
y 数值列,对应某时刻的数据。 -
winSize 指定最小的检测窗口长度。 long类型,取值范围为大于等于1,小于等于数值的实际长度。建议指定该参数的值为数据实际长度的十分之一。
示例:
  • 查询分析:
    * and h : nu2h05202.nu8 and m: NET |  select ts_find_peaks(stamp, value, 30) from (select __time__ - __time__ % 10 as stamp, avg(v) as value from log GROUP  BY  stamp order by stamp)
  • 输出结果:输出结果
显示项如下:
显示项 说明
横轴 unixtime 数据的时间戳,单位为秒,例如1537071480。
纵轴 src 未滤波前的数据,例如1956092.7647745228。
peak_flag 该点是否为极大值,其中:
  • 1.0:表示该点为极大值。
  • 0.0:表示该点不是极大值。