Resistive switching and impedance properties of soft nanocomposites based on Ag nanoparticles