The rank of the spectral density matrix conveys relevant information in a variety of modelling scenarios. Phillips (1986) showed that a necessary condition for cointegration is that the spectral density matrix of the innovation sequence at frequency zero is of a reduced rank. In a recent paper Forni and Reichlin (1998) suggested the use of generalized dynamic factor model to explain the dynamics of a large set of macroeconomic series. Their method relied also on the computation of the rank of the spectral density matrix. This paper provides formal tests to estimate the rank of the spectral density matrix at any given frequency. The tests of rank at frequency zero are tests of the null of 'cointegration', complementary to those suggested by Phillips and Ouliaris (1988) which test the null of 'no cointegration'.