The Vibrational Spectra of Molecules and Complex Ions in Crystals. I. General Theory