Matrix Theory of Oscillatory Networks