The traditional Transform Domain Communication System(TDCS)utilizing the fixed threshold is difficult to adapt to the increasingly complex and variable electromagnetic environment, and the adaptive thresholding methods only concern the probability of detection and ignore the probability of false alarm ,which causes the increase of BER(bit error rate). To tackle with the problems above, a new method of adaptive threshold is proposed. This method combines the probability of detection and the probability of false alarm by setting the weighting factor. The optimal threshold is deduced based on the optimal detection performance and it can also adaptively adjust the threshold value according to the change of channel environment. Theoretical analysis and simulations show that this method can correctly location and eliminate the spectrum of interference. The amplitude spectrum of basic function is generated with almost no interference after interference elimination, which reduces the TDCS's BER and the system's anti-jamming performance is improved.