  We study the electronic and magnetic structures of multiferroic
CaMn$_7$O$_{12}$ by first-principle calculations, based on the experimentally
determined modulated crystal structure. We confirm the presence of a 3$d$
orbital modulation of the Mn2 (Mn$^{3+}$) sites, previously inferred from the
Jahn-Teller crystal distortions. Our results indicate that in the multiferroic
phase the magnetic structure of the Mn3 (Mn$^{4+}$) sites is anharmonically
modulated via orbitally-mediated coupling with the structural modulation, and
that the Dzyaloshinskii-Moriya and exchange striction mechanisms contribute
equally to the polarization
