  A general algorithm for computing the quadrupole-hyperfine effects in the
rovibrational spectra of polyatomic molecules is presented for the case of
ammonia (NH$_3$). The method extends the general variational approach TROVE by
adding the extra term in the Hamiltonian that describes the nuclear quadrupole
coupling, with no inherent limitation on the number of quadrupolar nuclei in a
molecule. We applied the new approach to compute the
nitrogen-nuclear-quadrupole hyperfine structure in the rovibrational spectrum
of NH$_3$. These results agree very well with recent experimental spectroscopic
data for the pure rotational transitions in the ground vibrational and $\nu_2$
states, and the rovibrational transitions in the $\nu_1$, $\nu_3$, $2\nu_4$,
and $\nu_1+\nu_3$ bands. The computed hyperfine-resolved rovibrational spectrum
of ammonia will be beneficial for the assignment of experimental rovibrational
spectra, further detection of ammonia in interstellar space, and studies of the
proton-to-electron mass variation.
