Determining the number of jumps in a spectrum