Synthesis and characterization of a series of conducting polymers based on indole and carbazole