Spectrum of the galactic magnetic fields