Time correlation functions of the vibrational frequency of nitrogen and of nitrogen in helium