diff --git a/programs/dmatest_v2.py b/programs/dmatest_v2.py index 56d0afe2c9ea287f8396d4981e555c6146ff3d7c..410d54362d84801a879707deb7b2a8475b66b3d7 100644 --- a/programs/dmatest_v2.py +++ b/programs/dmatest_v2.py @@ -62,6 +62,7 @@ SAMPLING_RATE_HZ = 22000 SAMPLING_FREQ_TO_HIGH = -2 SAMPLING_FREQ_TO_LOW = -1 + class AdcDevice: def __init__(self, device_nr, rate=SAMPLING_RATE_HZ, samples=SAMPLES): self.__lock = asyncio.Lock() @@ -199,7 +200,7 @@ def calculate_frequency(voltages_centered, sampling_rate): count_mean = sum(counts) / len(counts) if count_mean < 5: return SAMPLING_FREQ_TO_LOW - f = sampling_rate / (2 * count_meant) + f = sampling_rate / (2 * count_mean) count = None return f