Voltage sag is one of the problems of power quality. In order to detect and analyze voltage sag more accurately and quickly, this paper proposes a detection method of voltage sag signal based on improved S-transform, which uses the difference square vector of fundamental frequency amplitude to detect the start and end time of voltage sag signal, and defines the start and end time error, sag depth error, local standard deviation, kurtosis and energy The relation curve between the five indexes and the adjusting factor of the improved S-transform Gaussian window is obtained, and the five indexes are weighted by the optimal combination weighting method, so as to obtain the optimal parameters of the S-transform. Finally, the simulation results show that the method proposed in this paper is easy to get the difference square vector curve of the fundamental frequency amplitude and the curve of the mutation point, so as to more accurately locate the start and end time of the sag; the phase jump curve can better reflect the phase jump of the voltage sag; the fundamental frequency amplitude curve can more accurately detect the sag depth of the voltage sag; the time amplitude is flat The square and mean curve can more accurately reflect the starting and ending position of voltage sag.