new ema function

This commit is contained in:
Ryan Voots 2025-05-09 21:05:52 -04:00
parent ae32fe61ac
commit 05de094429

View file

@ -27,5 +27,7 @@ FROM generate_series($__timeFrom(), $__timeTo(), '1 minute'::interval) AS ts
) AS gi_next ON true ) AS gi_next ON true
WHERE gi_prev.time IS NOT NULL and gi_next.time IS NOT NULL AND gi_next.time <> gi_prev.time WHERE gi_prev.time IS NOT NULL and gi_next.time IS NOT NULL AND gi_next.time <> gi_prev.time
) )
SELECT ts as time, samp_value as value SELECT ts as time,
public.ema(samp_value ::real, 0.33) over (order by ts asc) as smoothval,
samp_value as absvalue
FROM coallated; FROM coallated;