Characteristics of different types of filaments in resistive switching memories investigated by complex impedance spectroscopy