Knowing crystallographic and magnetic structures of a crystal one might find a general form of local fields on nuclei.
Assume that the local magnetic field on a nucleus of any magnetic sublattice depends linearly on an electron magnetic moment of its own atom as well as of surrounding atoms from all sublatices. Local fields on any nucleus from <math>\nu</math>-th sublattice is given by:
<math>{H}^{\alpha}_{n}(j_{\nu})=\sum_{\nu^{\prime}\j^{\prime}_{\nu^{\prime}}} {A}^{\alpha\beta}_{\j_{\nu}\j^{\prime}_{\nu^{\prime}}} {M}^{\beta}_{\j^{\prime}_{\nu^{\prime}}}.</math>
Here <math>\alpha \quad (\beta) \equiv {x,y,z}</math> (there is summation over β too), <math>{M}_{j_{\nu}}</math> - magnetic moment of the <math>{j_{\nu}}</math>-th atom (ion) normalized by corresponding atomic volume, <math>{A}^{\alpha\beta}_{\j_{\nu}\j^{\prime}_{\nu^{\prime}}}</math> are dimensionless coefficients, maximum number of which is given by a local symmetry of atomic nodes in the sublattice <math>\nu</math>. In the case of equivalent positions the corresponding coefficients can be obtained by symmetry transformation of the <math>\nu</math>-th sublattice.
The anisotropy of hyperfine interactions gives rise to the dependence of NMR frequency on position of nuclear spin in the domain wall.
NMR method might be used to investigate the magnetocrystalline anisotropy in ferromagnetic films. The NMR enhancement factor η in a single-domain specimen is given by
<math> \eta(H)=\frac{\partial{H}^{\bot}_{n}}{\partial{h}}=-H_{n}\text{sin}(\phi+\theta_0)\left(\frac{\partial{\theta_0}}{\partial{h}}\right)_{h=0}. </math>
The angle θ0 represents the equilibrium position of the electronic saturation magnetization vector MS of a magnetically anisotropic sample, h is the rf field vector, φ is the angle between the easy magnetization axis and the vector h, Hn - vector of local field on nuclei.
The angle θ0 can be found by minimizing the total magnetic energy. For example, assuming a biaxial magnetic anisotropy in the (100) film plane, with easy axis along [110] the total magnetic energy for an ideal cubic crystal is given by:
<math> E=K_{1}\sin^{2}\theta\cos^{2}\theta-HM_{s}\cos(\alpha-\theta)-hM_{s}\cos(\phi+\theta) </math>
where θ, φ, and α are angles between the easy magnetization axis and the vectors MS, h, and H, respectively. Then for a resonant excitation of the nuclei in the domain bulk, the equation for η predicts the following field dependence for the echo amplitude:
<math> A(H,\alpha,\theta)=H_n\cdot\frac{\sin^{2}(\phi+\theta_{0})}{(2K_{1}/M_{s})\cos(4\theta_0)+H\cos(\alpha-\theta_{0})}+O(h) </math>
where θ0 is the angular coordinate of the equilibrium magnetization.
So for fixed values of φ and α, it is possible to find the field dependence of the echo signal A(H); for fixed values of φ and H, it is possible to obtain the angular dependence A(α). The anisotropy field Hk=2K1/MS corresponds to the maximum of A(H), and the maxima of A(α) determine the directions of the difficult magnetization axes in a crystal.