Input design and data-driven approaches based on convex optimization for fault diagnosis in linear systems