Spectral testing has become one of the most widely used approach to characterize electronic systems. As the performance of the system becomes higher, the cost and the difficulty of accurately characterizing such systems has increased dramatically. To obtain accurate spectral results of signals from such high performance systems, one of the stringent test requirement is to maintain stable signal amplitude. If such requirement is not met, spectrum leakage will show up at the spectrum and the correct signal spectral performance cannot be obtained. In this paper, a low-cost method is proposed to estimate and remove amplitude drift in the signal under test, via segmentation and Least Square, and accurate spectral testing results of the signal can therefore be obtained. Extensive simulation results demonstrated the accuracy, as well as the robustness of the proposed method, which is capable of obtaining accurate spectral performance of the signal under various test conditions. Such low-cost method relaxes the stringent requirement such as constant amplitude on the signals under test, and can be implemented for high precision spectral testing using less precise instrumentations.