Variable-window algorithm for ultra-high-speed distance protection