Intense electromagnetic interference while drilling prevents traditional analog phase sensitive detection (APSD) from correctly acquiring electromagnetic wave signal of logging while drilling (LWD). A digital phase sensitive detection (DPSD) utilizes high-performance floating-point DSP and FPGA to separately process real part and imaginary part of the acquired logging signal, changes traditional calculating method, improves processing speed and calculating precision. The programmable technique used can fully utilize logging information, simplify control logic, improve precision of timing control and measuring precision. Discussed are the principle, characteristics, implement of circuit and analysis of experimental data. Testing result shows that the DPSD may utilize logging information effectively and optimize the LWD system.