On magnetic spectra of Earth and Mars