Modulation of the auroral proton spectrum in the upper atmosphere