A model for generating the periodicities of nucleotides in DNA sequences is presented. A generated periodicity or frequency in a power spectrum gives the periodic structure of a DNA sequence, and the intensity of the frequency defines the nonuniform codon usage that is specified by a probability. An example with the resonant frequency f = 1/3 is given. Other resonant frequencies can also be generated by this model.