Design a Suitable Optimized Low Pass FIR Filter for Ultrasonic Signal

Sensors play a vital role in the human life, so it is very important to improve their output signals. One of the most known sensors is ultrasonic sensor. The mentioned sensor uses simple principle to measure a distance between it and nearest obstacle. The output of this sensor improved in this work using FIR filter. The FIR filter parameters are calculated based on Genetic Algorithm (GA). The simulated results using MATLAB show that the optimized filtered data is more suitable and effective to use in many applications.


Introduction
Nowadays, the ultrasonic sensors play an important role in different applications that it send an ultrasonic signal to a target and receive its reflection from this target. Depends on this principle the distance between sensor and target can be measured by the time from sending the wave to receiving it [1][2] [3].
In the COVID-19 pandemic now, they used in many projects like a design of automatic water tap with low cost [4]. In addition, to prevent face handing and to save the safe distance between people, which is 2m in the World Health Organization (WHO) reports [5]. In addition, they used in our life in different other applications like in radar systems to detect strange objects in the line of sight of radar [6], in new cars smart systems to prevent accidents and car  [8]. Also, they can be used to help blind people to walk safely by designing different types of smart sticks and caps [1] [9].
Actually, short range of detection and low sampling rate still the main limitations to use ultrasonic sensor. The other problem is that ultrasonic signal as any other signals suffers from noisy channel due to environment, which makes it noisy signal. These problems can make the performance of the sensor not efficient which may effect on the application used it. Therefore, the researchers make different works to solve these problems. The authors of [10] deals with increase sampling rate and improve signal to noise ratio (SNR) and they succeed by increasing the range of detection.
The ultrasonic signal was improved using two states of filtering to remove its noise. The first state used Wiener filter while the second state used discrete wavelet transform to enhance ultrasonic system's resolution and sensitivity. They successfully execute their algorithm to real and simulated signals for airplanes applications [11]. In [12] the ultrasonic signal was processed by frequency domain deconvolution. It succeed by enhancing SNR of the signal and improves its resolution.
The security of ultrasonic sensor in autonomous vehicles was improved by using two strategies of defense in [13] while the authors of [14] use microcontroller to receive and process the output from the sensor. They conclude that the error of measurement is decreased in their proposed system. The authors of [15] improved the accuracy of range of sensor with algorithm depends on software statistics. They make the measurement faster than traditional method but the failed to enhance the accuracy of measurement using their proposed algorithm. This work will differs from other works that it will use low pass finite impulse response (FIR) filter and Genetic Algorithm (GA) optimization to improve the ultrasonic signal. Arduino microcontroller and MATLAB also will be used to make tests before and after improvements and compare between them.

Genetic Algorithm (GA)
John Holland creates GA. GA is a metaheuristic algorithm. It relies on the theory of evolution and natural selection in order to reach the optimal solution. This algorithm is a small branch compared to a giant branch called evolutionary computation [16].

Basic Concepts of Genetic Algorithm
Some crucial terms must be clarified before discussing the genetic algorithm: 1-Population: A set of solutions that belong to a total possible solution set.
2-Chromosomes: Each member of the population represents one chromosome. The chromosome is one of the solutions that make up the population 3-Gene: A single chromosome consists of several genes. Each group of genes forms a chromosome.

4-Fitness Function:
A function that is used to determine the value of each solution or each chromosome. This value determines the degree to which the chromosome fits with the environment compared to other solutions.

5-Genetic
Operators: These Operators change the genes in the chromosomes during the implementation of the algorithm. In this algorithm, we start with a population. Each member of the population represents a possible solution. The initial population is randomly generated. Sometimes the first population is created in other heuristic ways. The size of the population must be acceptable. The excessive increase in population size slows down the work of the algorithm. On the other hand, too little population size leads to premature convergence.
The movement of the population from one generation to another is carried out in a natural evolutionary way. The chromosomes pass through four steps to achieve the goal: Fitness value calculation, selection, recombination, and mutation. To be producing new children who make up the next generation. These steps are repeated continuously. The fitness function evaluates each individual. Individuals assessed with high values are given higher opportunities for mating. This is derived from Darwin's theory (survival of the fittest). In this way, the algorithm ensures the multiplication of the fittest individuals. Thus, the trend towards the optimal solution and achieve the condition of suspension [17].
The genetic algorithm is random but performs much better than local random searches. The way to represent solutions or chromosomes in the algorithm is one of the essential things before start working on the algorithm. It was noted that false representation leads to inaccurate results. One of the most popular ways of representing chromosomes is a binary representation. Also, there is an integer representation that uses integers. Choosing the right parents is an essential process because it contributes to the creation of a new generation of the population. A right choice helps drive the algorithm to find the optimal solution faster. There are several methods used for selection, including roulette wheel selection, tournament selection, and rank selection. The crossover operator is the process of producing each son from more than one chromosome of the parents. There are several ways to accomplish this work, including onepoint crossover, two-point crossover, and uniform crossover. The mutation is a simple change on a single chromosome with very little probability. The mutation is used to produce a new individual and maintain diversity and not fall into the local optimal solution [17].

Stopping Condition
The condition of terminating the algorithm is critical. It does not make sense that the algorithm continues to improve to infinity. The algorithm gives a noticeable improvement at the beginning of its work and then tends to saturate. Usually, one of the following conditions is chosen for suspension [17]:  When generating an X number of generations without improvement in result.
 When reaching a limited number of generation.
 Case of getting the desired value by the best chromosome.

Proposed Practical System
Ultrasonic sensor is one of the important sensors used today in robots and other applications to measure the distance from sensor to a point [18] [19]. It has four pins: one for Vcc, second for Trigger, third for Echo and fourth one is the Ground pin as shown in figure (1). It transmits trigger wave to the target and receives echo wave that reflected from the target as shown in figure (2). Therefore, by knowing the time of transmitted and reflected signals, the speed of sound is 340 m/sec., it can be measure the distance to the target according to equation (  In this work, the ultrasonic sensor was connected to UNO Arduino as shown in figure (3). The Arduino was connected to PC and All ultrasound signal tests were made by MATLAB.

Results and Discussion
To get the signal from ultrasonic sensor, the ultrasonic sensor must connected to the Arduino as shown in figure 3. The MATLAB receive ultrasonic sensor and began signal processing. Low pass FIR filter was used as signal processing and all its parameters were estimated using GA. Figure 4 explain the serial monitor reading from the ultrasonic. It is represent the simplest method to get the information from Arduino or any other board can connect with the computer through the serial port.

Conclusions
This work improves the performance of the ultrasonic sensor, which leads in its turn to increase the robust applications depending on it. FIR filter used in this work to erase the noise. The filtering efficiency appears good improvements after using the GA for tuning. It can be say that the system is applicable to multiple applications. The proposed system was tested for multiple scenarios and give good enhancement to ultrasonic signal.