In earlier works, solutions of Lyapunov equations were represented as sums of Hermitian matrices corresponding to individual eigenvalues of the system or their pairwise combinations. Each eigen-term in these expansions are called a sub-Gramian. In this paper, we derive spectral decompositions of the solutions of algebraic Lyapunov equations in a more general
formulation using the residues of the resolvent of the dynamics matrix. The qualitative differences and advantages of the sub-Gramian approach are described in comparison with the traditional analysis of eigenvalues when estimating the proximity of a dynamical system to its stability boundary. These differences are illustrated by the example of a system with a multiple root and a system of two resonating oscillators. The proposed approach can be efficiently used to evaluate resonant interactions in large dynamical systems.