Optimizing Stability of Ultrasonic Sensor Readings: Study on Moving Average Filter Parameter Selection
Abstract
Moving average filter is a signal processing method used to reduce fluctuations or noise in data by taking the average of the most recent values. This filter works by taking the n most recent values in the data and calculating the average. This research investigates the effect of the n parameter value in the moving average filter on the stability of ultrasonic sensor readings regarding object distance. It was found that the value of n had a significant impact on the stability of the results. Using n = 20 produces a stable graph of distance values with minimal fluctuations, while n = 10 reduces fluctuations but still shows slight fluctuations. n = 5 also improves stability, but quite significant fluctuations are still visible. Meanwhile, n = 3 produces an unstable graph with high fluctuations. In conclusion, the larger the n value, the more stable the distance value graph. However, it should be noted that a value of n that is too large can cause a delay in the system's response to changes in distance. Therefore, the selection of the n value must consider the balance between the stability of the results and the response of the system.
Copyright (c) 2025 zetroem

This work is licensed under a Creative Commons Attribution 4.0 International License.