Techniques are provided for scanning frequency and voltages of a multipole mass filter while maintaining substantially the same number of AC cycles per mass during a scan across a range of masses. For example, a mass spectrum can be obtained by controlling a DC axial voltage that accelerates ions into a mass filter, a DC resolving voltage applied to the mass filter, an AC voltage amplitude applied to the mass filter, and an AC frequency of the AC voltage. The settings can be controlled such that ions of different mass-to-charge ratios are within the mass filter for substantially a same number of AC cycles. To achieve the same number of AC cycles, the AC frequency is changed during the scan. For low masses, a higher AC frequency can be used. For high masses, a lower AC frequency can be used.