[6] We measure the decay of spectral amplitude of the ground velocity (for P and S waves) with source-to-station distance [*Sato and Fehler*, 1998, pp. 110–111], which, as well known, depends on the total-Q (*Q*_{P} and *Q*_{S}for P and S waves, respectively). The spectral amplitude is estimated through Fast Fourier Transform. The amplitude spectral density is calculated for time-windows 60 seconds long, starting respectively at the P- and S- wave onset. We use spectra of vertical component for P-waves and log-averaged spectra of the two horizontal components for S-waves. Pre-event noise spectra are calculated and compared with signal spectra. Signal-to-noise ratio results always greater than 5 at 8 Hz, and much greater than this value for decreasing frequency. The spectral Log-average is evaluated over the horizontal components and finally the integral of the spectral amplitude is calculated in 6 frequency bands, respectively from 0 to 0.35, from 0.35 to 0.7, from 0.7 to 1.4, from 1.4 to 2.8, from 2.8 to 5.6 and from 5.6 to 12 Hz. Central frequencies for each band are 0.25, 0.5, 1.0, 2.0, 4.0 and 8.0 Hz. To estimate the contribution of the seismic attenuation in the crust, we use total-Q for S-waves in southern Spain calculated by*Akinci et al.* [1995] (*Q*_{S}^{C} = 34.8*f*^{1.0}). We assume that total-Q for P-waves is a half of total-Q for S-waves in the crust, an average of the experimental values through the world [*Sato and Fehler*, 1998, Figure 5.3], and use this estimate as a constraint for calculating the correspondent quality factors, *Q*_{P}^{M} and *Q*_{S}^{M} in the mantle. The equation which associates the integral of the spectral amplitude for P and S waves (as a function of frequency *S*_{P,S}(*f*)) to the quality factor is

where *K*includes source-, site-, instrument-transfer functions and velocity model;*T* is the travel time (*M* and *C*indicate respectively mantle and crust and subscripts P and S respectively compressional and shear waves). The left hand side of this equation represents the measured quantities as a function of travel time (calculated through ray-tracing).Equation (1) for all the stations, and for P and S waves, represents a largely overdetermined system of *N* equations for 2 unknowns (*K* and *Q*_{P, S}^{M}) that can be solved, after Log-linearization, with an optimization algorithm. We use here the weighted least squares approach, described by the following matrix equation for any value of the frequency,*f.*

where **m**(f) is the vector containing the unknowns, **G**(f) is the 2-column coefficient matrix (first column elements = 1; second columns elements = − *πf*(*T*_{i,P,S}^{M}) where *T*_{i,P,S}^{M}is the travel time in the mantle at the i-th receiver).**W**is the matrix containing the weights. After many tests for different weighting matrices, we observe that unweighted- are comparable to weighted-solutions and selected W = unity.**d**(f) is the data matrix, whose elements (*i* = 1,...N) are

We solved system (2) for each frequency, separately for P and S. Errors on the estimates of *Q*_{P} and *Q*_{S} are obtained using as Covariance matrix the diagonal matrix associated with the variances in the spectral estimates.