It was recently conjectured that 1/f noise is a fundamental characteristic of spectral fluctuations in chaotic quantum systems. This conjecture is based on the behavior of the power spectrum of the excitation energy fluctuations, which is different for chaotic and integrable systems. Using random matrix theory we derive theoretical expressions that explain the power spectrum behavior at all frequencies. These expressions reproduce to a good approximation the power laws of type 1/f (1/f^2) characteristics of chaotic (integrable) systems, observed in almost the whole frequency domain. Although we use random matrix theory to derive these results, they are also valid for semiclassical systems.