ion-resonance-principle spectrometer