The paper introduces the theory of gas concentration detection by infrared absorption spectrum and the modeling method of gas detection simulation system based on LabVIEW. On the basis of wavelength modulation technology, the second harmonic curve of the absorption spectrum is extracted by phase-locked algorithm and the concentration of the target gas can be obtained. By changing the parameters of the target gas concentration and modulation coefficients, the variation of the absorption curves and the second harmonic curves is acquired. It provides the reference for the design of gas detection system in practice.