Ab Initio Calculations of Phonon Spectra in BaF2 and PbF2 Crystals