In the density functional theory approximation, we have calculated the phonon dispersions and the densities of vibrational states of the 2H, 3C, 4H, 6H, and 8H hexagonal polytypes of diamond. We have found that a one-dimensional incommensurate modulation of the structure arises along the hexagonal axis, the parameter of which not only exceeds the parameters of basic translations of the crystal lattices of polytypes, but also is not a multiple of them. Based on the estimation of interactions between bilayers of carbon atoms in the structure of polytypes, we have assumed that competing interactions between bilayers are the main mechanism by which incommensurability arises. We have shown that optical measurements of vibrational frequencies in the center of the Brillouin zone of polytypes make it possible to retrieve the dispersion of acoustic branches of cubic diamond.