A voltage sag detection algorithm based on rectified voltage processing