Controllability and observabilityindices for linear time-invariant systems: a new approach