# An Enhanced Genetic Algorithm for Parameter Estimation of Sinusoidal Signals
## The Proposed EGA
### EGA Procedures  
To solve a problem using the proposed EGA, \(N\) individuals are randomly generated by a float encoding method as the initial population \(Init\_Pop\). Each individual's objective value and fitness value are calculated, and the best individual \(BestX\_Old\) in the current population is obtained. In order to keep population diversity and promote a healthy competition, individuals are assigned to a \(Benign\) group or \(Malignant\) group with the same size of \(N/2\), respectively, according to their fitness values. As the individuals in the \(Benign\) group have higher fitness values, performing a crossover operation in this group is helpful to generate better descendants. Therefore, the TSC operation with probabilities \(P_{c1}\) and \(P_{c2}\) is run for them only. Instead of being discarded directly, in the \(Malignant\) group, the remaining individuals with a low fitness but rich population diversity go through the adaptive mutation. Once the crossover and mutation are complete, the fitness values of the individuals in the new population \(New\_Pop\) will be evaluated. The individuals in the \(Malignant\) group that have a high fitness will migrate to the \(Benign\) group, and a reverse movement is also carried out synchronously for the ones in the \(Benign\) group having a low fitness. Again, the best individual \(Best\_New\) in the current population will be picked up against the \(Best\_Old\), and the better one is saved as \(Best\_Temp\). As the optimum may hide near \(Best\_Temp\), some random individuals (e.g., 10) are generated in this area, and their fitness values are calculated. If someone is better than \(Best\_Temp\), they will be reassigned as \(Best\_Temp\); else, \(Best\_Temp\) keeps its original value. At the end of each iteration, \(BestX\_Old\) and \(Old\_Pop\) are updated by \(Best\_Temp\) and \(New\_Pop\), respectively. Figure 3: Adaptive mutation probability as the change of iteration. The termination criterion will be triggered when the maximum iteration \(MaxGen\) reaches. A more clear procedure of the EGA is shown in Figure 4 and Algorithm 1. ```
\(N:\) size of initial population \(MaxGen:\) maximum number of iteration \([P_{c1},P_{c2}]:\) probabilities of the two-step crossover operation \([P_{m1},P_{m2}]:\) probabilities of the initial and final adaptive mutation operation \(num:\) number for generating new individuals around the best solution in each iteration \(f(x):\) objective function \(Trace:\) the best solution and corresponding objective value in each iteration function\(EGA(N,MaxGen,[P_{c1},P_{c2}],[P_{m1},P_{m2}],num,f(x))\) \(Init\_Pop\gets random\) individuals with a size of \(N\); \(Old\_Pop\gets Init\_Pop; for\(i\leq N\)do  Calculate the fitness value of each individual in Old_Pop; endfor \(gen\gets 1\); while\(gen\leq MaxGen\)do \(Best\_Old\leftarrow\) the best individual in Old_Pop; Selection: \(Benign\gets N/2\) high \(fit\) individuals in Old_Pop; \(Malignment\gets N/2\) low \(fit\) individuals in Old_Pop; Crossover: Carry out the TSC operation to the individuals in the Benign group;
```  
**Algorithm 1** The pseudo-code of the enhanced genetic algorithm. Figure 4: Flow chart of the proposed enhanced genetic algorithm (EGA). **Mutation:**  
_Apply an adaptive mutation operation to the individuals in the Malignant group;_  
_New_Pop \(\leftarrow\) combination of the processed individuals from the Benign and Malignant groups;_  
**for** \(i\leq N\)**do**  
_Calculate the fitness value of each individual in New_Pop;_  
**end for**  
_BestX_New \(\leftarrow\) the best individual in New_Pop;_  
_BestX_Temp \(\leftarrow\) (BestX_New \(<\) BestX_Old)? BestX_New : BestX_Old;_  
_BestX_Temp \(\leftarrow\) (\(\mathbf{min}(\mathbf{rand}(num))<\) BestX_Temp)?