Basis identification through convex optimization