Preparation and characterization of carbon and titanium carbide coatings