Resistive switching in aluminum-polymer-based diodes has been investigated using small signal impedance measurements. It is shown that switching is a two-step process. In the first step, the device remains highly resistive but the low frequency capacitance increases by orders of magnitude. In the second step, resistive switching takes place. A tentative model is presented that can account for the observed behavior. The impedance analysis shows that the device does not behave homogenously over the entire electrode area and only a fraction of the device area gives rise to switching