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 (QP and QSfor 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 byAkinci et al.  (QSC = 34.8f1.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, QPM and QSM in the mantle. The equation which associates the integral of the spectral amplitude for P and S waves (as a function of frequency SP,S(f)) to the quality factor is
where Kincludes source-, site-, instrument-transfer functions and velocity model;T is the travel time (M and Cindicate 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 QP, SM) 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(Ti,P,SM) where Ti,P,SMis the travel time in the mantle at the i-th receiver).Wis 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 QP and QS are obtained using as Covariance matrix the diagonal matrix associated with the variances in the spectral estimates.