A method to determine the spectral parameters, spectral level Ω0, corner frequency f0, and attenuation factor Q, using a genetic algorithm (ga), is presented. An adequate strategy for the ga was chosen by means of the 2D Ackley function. For modeling the seismic spectrum, a Boatwright source model and an attenuation factor independent of the frequency were used. Several objective functions are tested, and the best was found to be the L2 norm of the log difference between the observed and modeled spectra. To check the accuracy of the method, some tests with synthetic spectra were made, including spectra with noise. Real data, which have been already studied with other spectral methods, were analyzed to compare the results. The spectral parameters of 13 earthquakes (Granada, southern Spain) were calculated, as well as its source parameters: the seismic moment M0, the source radius r, and the stress drop Δσ, following Brune’s model. The seismic moments ranged from 3.65E + 17 to 9.98E + 18 dyne cm; the radii were between 0.08 and 0.2 km, and the static stress drops ranged from 0.32 to 1.73 bars. The attenuation factors ranged from 53 to 726, with an averaged value of 303. The results obtained are similar to those obtained by other researchers working with events of comparable magnitudes in the region.