Optimization of high-order harmonic generation by genetic algorithm and wavelet time-frequency analysis of quantum dipole emission