Block decomposition algorithm for time-invariant systems using the generalized matrix sign function