zero crossing detector?

It doesn't get any simpler than that.