A method for detecting a vector shift in an AC power system, the method comprising: a) determining a frequency of the AC power system on the basis of a difference between a first phase angle of a voltage of the AC power system and a second phase angle of the voltage of the AC power system, the first and second phase angles corresponding to time points spaced by a fundamental period of the AC power system, wherein the first and second phase angles of the voltage of the AC power system are determined by means of the discrete Fourier transform of the sliding window type, which has a length corresponding to the fundamental period of the AC power system; b) determining a time derivative of the frequency; c) filtering the time derivative of the frequency with a moving window filter, wherein a window of the moving window filter has the length of the fundamental period of the AC power system; and either d) calculating time derivatives for the filtered time derivatives of the frequency over a time period having the length of the fundamental period of the AC power system; e) determining a number of positive time derivatives and a number of negative time derivatives obtained in step d); and f) detecting a vector shift in the AC power system in response to an absolute value of a difference between the number of positive time derivatives and the number of negative time derivatives obtained in step e) exceeding a predetermined threshold value, or g) calculating time derivatives for the filtered time derivatives of the frequency over a first time period having the length of the fundamental period of the AC power system; h) determining a number of positive time derivatives and a number of negative time derivatives obtained in step g); i) if an absolute value of a difference between the number of positive time derivatives and the number of negative time derivatives obtained in step h) exceeds a predetermined threshold value, calculating time derivatives for the filtered time derivatives of the frequency over a second time period immediately following the first time period and having the length of the fundamental period of the AC power system; j) determining a number of positive time derivatives and a number of negative time derivatives obtained in step i); and k) detecting a vector shift in the AC power system in response to an absolute value of a difference between the number of positive time derivatives and the number of negative time derivatives obtained in step j) exceeding the predetermined threshold value. a) determining a frequency of the AC power system on the basis of a difference between a first phase angle of a voltage of the AC power system and a second phase angle of the voltage of the AC power system, the first and second phase angles corresponding to time points spaced by a fundamental period of the AC power system, wherein the first and second phase angles of the voltage of the AC power system are determined by means of the discrete Fourier transform of the sliding window type, which has a length corresponding to the fundamental period of the AC power system; b) determining a time derivative of the frequency; c) filtering the time derivative of the frequency with a moving window filter, wherein a window of the moving window filter has the length of the fundamental period of the AC power system; and either d) calculating time derivatives for the filtered time derivatives of the frequency over a time period having the length of the fundamental period of the AC power system; e) determining a number of positive time derivatives and a number of negative time derivatives obtained in step d); and f) detecting a vector shift in the AC power system in response to an absolute value of a difference between the number of positive time derivatives and the number of negative time derivatives obtained in step e) exceeding a predetermined threshold value, or g) calculating time derivatives for the filtered time derivatives of the frequency over a first time period having the length of the fundamental period of the AC power system; h) determining a number of positive time derivatives and a number of negative time derivatives obtained in step g); i) if an absolute value of a difference between the number of positive time derivatives and the number of negative time derivatives obtained in step h) exceeds a predetermined threshold value, calculating time derivatives for the filtered time derivatives of the frequency over a second time period immediately following the first time period and having the length of the fundamental period of the AC power system; j) determining a number of positive time derivatives and a number of negative time derivatives obtained in step i); and k) detecting a vector shift in the AC power system in response to an absolute value of a difference between the number of positive time derivatives and the number of negative time derivatives obtained in step j) exceeding the predetermined threshold value.