A method for spectrally shaping a communication signal is provided. The method comprises generating a plurality of spreading codes, assigning a probability to each of the plurality of spreading codes, and modulating the communication signal by hopping between the plurality of spreading codes such that a time-average proportion of time spent using any one of the plurality of spreading codes is equal to the probability assigned to that spreading code.