Based on a novel representation of the three-dimensional structure of molecules, the relationships between compounds and their infrared spectra are condensed into a counterpropagation network. Such a network can be used for the simulation of an infrared spectrum and thus provide infrared spectra for candidates in structure identification and elucidation problems, On the other hand, the counterpropagation network can also provide the three-dimensional structure of a compound on input of its infrared spectrum.