Characterization of diamondlike carbon by infrared spectroscopy