Analytic Framework for HVDC Grid Protection Algorithm Design in Phase and Modal Domains