Commit b3d6d203 authored by fleur's avatar fleur
Browse files

i'll make my own code style it'll be terrible

parent 8f78143e
......@@ -57,7 +57,8 @@ COLORS = [((23 + (15 * i)) % 360, 1.0, 1.0) for i in range(11)]
moving_average = 0
alpha = 2
beta = 3
betadash = beta/(alpha+beta)
betadash = beta / (alpha + beta)
def update_history(datasets):
global history, moving_average, alpha, beta, last_sample_count
......@@ -65,7 +66,7 @@ def update_history(datasets):
for val in datasets:
if current_mode == MODE_FINGER:
history.append(val - moving_average)
moving_average += betadash*(val-moving_average)
moving_average += betadash * (val - moving_average)
# identical to: moving_average = (alpha * moving_average + beta * val) / (alpha + beta)
else:
history.append(val)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment