Skip to content
Snippets Groups Projects
Commit dc83ef34 authored by fleur's avatar fleur
Browse files

hpf only on for finger mode

parent 3cc52e92
Branches
Tags
No related merge requests found
......@@ -62,8 +62,11 @@ def update_history(datasets):
global history, moving_average, alpha, beta, last_sample_count
last_sample_count = len(datasets)
for val in datasets:
history.append(val - moving_average)
moving_average = (alpha * moving_average + beta * val) / (alpha + beta)
if current_mode == MODE_FINGER:
history.append(val - moving_average)
moving_average = (alpha * moving_average + beta * val) / (alpha + beta)
else:
history.append(val)
# trim old elements
history = history[-HISTORY_MAX:]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment