A programmable micro mirror has been used in a near infrared spectrometer in order to achieve the purpose of signal multiplexing, to solve the problem of low luminous flux when using single slit and to increase the signal-to-noise (SNR) ratio. Use Hadamard Transform (HT) and programmable micro mirror as its encoding mask to detect the whole spectrum with a single detector, research and analyze the enhancement of SNR of the weak signal. First of all, the mask symbol number is fixed as 63-order based on the Hadamard Transform principle, calculate the optimal S-Matrix, and then the encoding mask has been realized by micro mirror. At last, carry out some experimental verifications as well as data analyzing, discuss the alternating spectrum signal which produce an effect on transformational algorithm, bring out the coadded upswing plan. The result shows that: the conflict of resolution and SNR can be well settled with Hadamard multiplex. The SNR can be increased by the factor of 3.5, which is identical with the theoretic result.