Aiming at the problem of spectrum leakage and fence effect when transforming harmonic distortion signals with compressed sensing based on DFT base, a windowed and interpolated compressed sensing (WI-CS) algorithm is proposed. The algorithm combines the binary sparse measurement matrix and the six-term fifth-order cosine window to construct a new window sparse measurement (WSM) matrix. After the sparse vector is reconstructed, the quadratic spectral line interpolation is used to accurately detect the parameters of harmonics and interharmonics. Through MATLAB simulation, the results show that the proposed method can have higher detection efficiency and certain anti-noise ability under the condition of less sampling data.