Digital Moving Average Filter Application for Echo Signals and Temperature

In this work, we propose a digital filter design, namely moving average filter (MAF) to be implemented on echo signal and temperature data. The echo signal data is obtained from the ultrasonic transducer, while the temperature data is obtained from the PI controller. The implementation of the moving average filter on the echo signal data will compare the second-order MAF and the fourth-order MAF. The results of the test show that the use of a digital filter makes the data smoother when compared to unfiltered data. Furthermore, the comparison of orders on the MAF filter has an impact on the filter response getting closer to the ideal characteristics if using a higher order.


Introduction
In the current era of globalization, technological developments are very rapid. It is characterized by the presence of tools or features that can facilitate human activities. The communication sector is no exception. Now humans can easily communicate remotely. Signal communication plays an important role as a medium for transmitting the information. However, the signal is never free from interference or noise experienced in the process of sending information. Noise can cause the information received does not to match what was sent. For the signal to match the needs and desires, it requires a filter to sort out the signal from noise. The filter is a design to pass or filter the input signal so that the incoming signal matches the desired frequency. Then there are two types of filters, namely, Digital Filters and Analog Filters. Each of these filters has its advantages and disadvantages. In this work, we will discuss the implementation of Digital Filters.
Digital filters have a discrete signal input. The advantages of Digital Filters compared to Analog Filters are, Digital Filters are easier to change and programmable because Digital Filters have memory and processors while Analog Filters are only a circuit which means if you want to change the filter you have to change the circuit. Digital filters are easier to implement and interface with a computer. Then the characteristics of the Digital Filter are more stable than the Analog Filter, depending on the computer that is connected. There are two types of Digital Filters, namely, FIR (Finite Impulse Response) and IIR (Infinite Impulse Response). The advantage of the FIR filter compared to * Corresponding author : dian.neipa@trunojoyo.ac.id the IIR filter is that it is stable and has a linear phase, which means that in the equalization process there is a delay that aims to make the frequency acceptable at the same time. Several studies that discuss digital filters are [1][2][3][4][5][6][7][8][9][10][11][12][13][14][15][16][17][18][19][20].
This work will be developed by designing a digital filter that is implemented on the Arduino microcontroller device. The purpose of this research is to be able to design a filter to reduce noise and be able to design a moving average filter for processing echo signal data and temperature data. The echo signal is obtained from the ultrasonic transducer, while the temperature data is obtained from the results of the PI controller. The result of designing a filter is in the form of a coefficient value which will later be entered into the FIR filter program on the Arduino. Then the results of the FIR filter program on the Arduino will be displayed on the Arduino serial plotter. The results of the design and implementation in this study will be able to find out the comparison of the input signal before and after undergoing the filter process by Arduino with the filter process on the Matlab software and the comparison of memory usage used by Arduino in processing a program with several different orders.

Materials and Method
This section describes the materials and methods used in this research, including analog filter, digital filter, and moving average filter. The filter is a process of taking some signals from certain desired frequencies and removing some signals from certain frequencies that are E3S Web of Conferences 328, 0 (2021) ICST 2021 https://doi.org/10.1051/e3sconf/202132802007 not needed. This is done to produce valid data. The filters themselves can be divided into two categories, namely analog filters, and digital filters.

Analog Filter
This filter is a filter in the form of an electronic circuit which usually consists of components such as resistors, capacitors, and op-amps to produce the desired filtering. In this filter, the filtered signal is an electric voltage or current such as sound.

Digital Filter
This filter is a filter that uses mathematical procedures or better-known algorithms to process digital input signals so that digital outputs are obtained that have the desired criteria from the filtering process. In the end, will produce valid data. Digital filters themselves also have many advantages over analog filters, both in terms of higher performance and smaller transition zones, as well as in terms of durability and flexibility in determining the working range. Here are some examples of digital filters, such as mechanical filtering windows, moving averages.

Moving Average Filter
Moving average is a filter that is used to refine the received data by averaging several samples. The value to be processed later is the result value of the average of several samples. This filtering must continue to be done to avoid noise caused by mechanics. This is because the data will not be free of noise and therefore need to be passed into a digital filter. Even with prior filtering, the data can be an error due to mechanical noise. So it is necessary to implement several filters. Depending on the number of samples being filtered, the actual acceleration can use 2 steps for averaging. Because perform calibration at rest requires data as accurately as possible.
Where: n = Sample number m = Range of data for each moving average process Out = The output of the moving average

Noise
Noise is an unwanted signal that is always present in a transmission system. This noise will interfere with the quality of the desired received signal and ultimately interfere with the process of receiving and sending data. The source of this noise can be divided into: 1. Internal Noise, due to thermal, intermodulation, crosstalk. 2. External Noise, due to atmosphere, extraterrestrial, man-made.
Random noise is noising whose occurrence is unpredictable. Kinds of random noise: 1. Thermal noise is noise due to the heat effect 2. Intermodulation noise is noise due to the entry of foreign frequencies into the communication channel 3. Crosstalk noise is noise due to the entry of foreign signals into the communication channel 4. Impulse noise is noise due to the sudden entry of a signal having a high enough voltage level into the communication channel 5. Fading noise is noise due to changes in the earth's atmospheric conditions Statistical noise is noising whose occurrence can be predicted. Types of statistical noise: 1. Attenuation is the decrease in the received signal voltage level due to the characteristics of the media 2. Delay is the delay in the arrival of the signal so that it slows down processing

Ultrasonic
In this section, we will discuss the properties of ultrasonic sound, in particular, starting with a discussion of the definition of ultrasonic sound, followed by the reflection properties of ultrasonic sound against several types of reflective surfaces. The reflecting properties are influenced by the acoustic impedance and the geometric shape of the reflecting surface.

Ultrasonic Sound
The sound that can be heard by the normal human ear is a sound that has a frequency range of 20 Hz to about 20,000 Hz. Outside of this frequency area, there are still two other frequency areas, namely: 1. Infrasound is sound with a frequency area that is below the hearing frequency range of the human ear. 2. Ultrasound is sound with a frequency region that is above the hearing frequency range of the human ear.
Ultrasound is sound that is in the ultrasound frequency range and usually ranges from 20,000 Hz to 600 MHz. Because ultrasonic has a high enough frequency, ultrasonic waves have a short wavelength. From equation 2. it can be obtained that the ultrasonic wavelength ranges from 17 mm (for 20,000 Hz) to about 576 nm (for 600 Mhz).

=
(2) Where: c = speed of sound in the air [ms-1] f = ultrasonic frequency used [Hz] Because the ultrasonic wavelength is short, often the reflected surface is mirror-like or often referred to as specular reflection, namely reflection where the angle of incidence of the ultrasonic wave to the normal line is the same as the angle of reflection (angle of departure) of the ultrasonic wave to the normal line, so that the surface E3S Web of Conferences 328, 0 (2021) ICST 2021 of the reflected plane acts like a mirror surface (similar to optical reflection).

The Reflection Properties of Ultrasonic Waves
Not all reflected planes have a specular reflection of ultrasonic waves, this depends on the acoustic impedance of the reflected field. The amount of ultrasonic energy absorbed by the surface of the reflecting plane compared to the amount of reflected ultrasonic energy is determined by the acoustic impedance (Z) between the propagation medium (air) and the reflecting plane itself.

Results and Discussion
In this research, the equipment used includes proximity sensors, serial and connector cables, Arduino, laptops, Peltiers, transistor switching modules, oscilloscopes, basins filled with fluid or water.

Conclusion
From this research the following statements can be drawn: 1. By using the MAF digital filter, the data obtained in the form of echo and temperature data will be smoother when compared to data without any filter. 2. The order comparison of the MAF filter can be expressed by the higher the order of the filter used, the closer the filter response will be to its ideal characteristics.