In photoacoustic spectroscopy based multicomponent gas analysis, the overlap of the absorption spectra among different gases can affect the measurement accuracy of gas concentrations. We report a multicomponent gas analysis method based on empirical modal decomposition (EMD), convolutional neural networks (CNN), and long short-term memory (LSTM) networks that can extract the exact concentrations of mixed gases from the overlapping wavelength-modulated spectroscopy with second harmonic (WMS-2f) detection. The WMS-2f signals of 25 different concentration combinations of acetylene-ammonia mixtures are detected using a single distributed feedback laser (DFB) at 1531.5 nm. The acetylene concentrations range from 2.5 to 7.5 ppm and the ammonia concentrations from 12.5 to 37.5 ppm. The data set is enhanced by cyclic shifting and adding Gaussian noise. The classification accuracy of the test set reaches 99.89% after tuning. The mean absolute errors of the five additional sets of data measured under different conditions are 0.092 ppm for acetylene and 1.902 ppm for ammonia, within the above concentration ranges.