Zero crossing detector sorted.