Self-sensing synchronized switch damping based on zero-crossing detection with voltage decay compensation