Signal Processing
This page summarizes the main signal and spectral processing steps used to construct amplitude spectra for inversion in SourceSpec.
The diagrams provide an overview of the processing pipelines. For more details, see the detailed steps below each diagram.
Trace Processing
![digraph signal_processing {
graph [rankdir=TB, fontsize=14, fontname="Helvetica",
abelloc=t, nodesep=0.45, ranksep=0.6, bgcolor="#ffffff"]
node [shape=box, style="rounded,filled", fontname="Helvetica",
fontsize=11, fillcolor="#f0f8ff", color="#2b6ea3", penwidth=1]
edge [color="#666666", arrowsize=0.8]
raw [label="Raw Trace\nInput", shape=parallelogram,
fillcolor="#fff4e6", color="#d97706", fontsize=11]
proc [label="Processed\nTrace\nOutput", shape=parallelogram,
fillcolor="#fff4e6", color="#d97706", fontsize=11]
raw -> "1. Check gaps/overlaps";
"1. Check gaps/overlaps" -> "2. Remove mean";
"2. Remove mean" -> "3. Merge gaps/overlaps";
"3. Merge gaps/overlaps" -> "4. RMS check";
"4. RMS check" -> "5. Clipping detection";
"5. Clipping detection" -> "6. Remove instrument response";
"6. Remove instrument response" -> "7. Filter trace";
"7. Filter trace" -> "8. S/N ratio check";
"8. S/N ratio check" -> proc;
}](_images/graphviz-61723098ac2eb1e829e7548047f682f3ef728015.png)
Traces are checked for gaps and overlaps. Traces with cumulative gap or overlap duration larger than
gap_maxoroverlap_max, respectively, are skipped.The trace mean is removed (only if the configuration parameter
trace_unitsis set toauto, i.e., if the trace has not been preprocessed outside SourceSpec).Gaps and overlaps are merged.
Traces with RMS smaller than
rmsminare skipped.Traces are optionally checked for clipping (see Clipping Detection).
Instrumental response is removed and trace transformed in its physical units (e.g., velocity, acceleration).
Trace is filtered.
Signal to noise ratio is measured as the ratio between signal RMS in the P- or S-window (depending on the
wave_typeparameter) and the RMS of the noise window. Traces with signal to noise ratio smaller thansn_minare skipped.
See the source code of ssp_process_traces.process_traces() for
implementation details.
Spectral Processing
![digraph spectral_processing {
graph [rankdir=TB, fontsize=14, fontname="Helvetica",
labelloc=t, nodesep=0.45, ranksep=0.6, bgcolor="#ffffff"]
node [shape=box, style="rounded,filled", fontname="Helvetica",
fontsize=11, fillcolor="#f7fff0", color="#3b7a3b", penwidth=1]
edge [color="#666666", arrowsize=0.8]
in [label="Input:\nProcessed Traces", shape=parallelogram,
fillcolor="#fff8e1", color="#b07a00", fontsize=11]
out [label="Output:\nSpectra + Weight", shape=parallelogram,
fillcolor="#fff8e1", color="#b07a00", fontsize=11]
in -> "1. Signal window check";
"1. Signal window check" -> "2. Integrate to displacement (optional)";
"2. Integrate to displacement (optional)" -> "3. Cut & taper windows";
"3. Cut & taper windows" -> "4. Noise window check";
"4. Noise window check" -> "5. Compute amplitude spectra";
"5. Compute amplitude spectra" -> "6. Integrate in frequency domain (optional)";
"6. Integrate in frequency domain (optional)" -> "7. Window spectra";
"7. Window spectra" -> "8. Geometrical spreading correction";
"8. Geometrical spreading correction" -> "9. Convert to moment units";
"9. Convert to moment units" -> "10. Resample log10 frequency";
"10. Resample log10 frequency" -> "11. Smooth spectra";
"11. Smooth spectra" -> "12. Spectral S/N check";
"12. Spectral S/N check" -> "13. Build H component";
"13. Build H component" -> "14. Convert to magnitude units";
"14. Convert to magnitude units" -> "15. Apply station corrections";
"15. Apply station corrections" -> "16. Build weight spectrum";
"16. Build weight spectrum" -> out;
}](_images/graphviz-cd41399f9717971a5f4788ecc23e594716acc696.png)
A check is made to see if the signal window contains enough data. Traces with no data or more than 25% of zero values are skipped. This is typically due to a wrong specification of signal window (e.g., wrong P or S arrivals).
Traces are integrated to displacement in time domain, if
time_domain_intisTrue.Signal and noise windows are cut and tapered.
The noise window is checked. If the ratio between noise RMS and signal RMS is smaller than 1e-6, the noise is considered not significant and the trace is skipped.
The amplitude spectra of the signal and noise windows are computed, using
numpy.fft.rfft(). Ifspectral_win_lengthis notNone, the signal is zero-padded to this length before computing the Fast Fourier Transform.Spectra are integrated to displacement in frequency domain, if
time_domain_intisFalse.Amplitude spectra are windowed (see config parameters
freq1_broadb,freq2_broadband similar).Geometrical spreading is corrected (see Geometrical spreading).
Amplitude spectra are converted to seismic moment units (see Building spectra).
Amplitude spectra are resampled in \(log_{10}\) frequency spacing.
The resampled spectra are smoothed. The smoothing window width is defined in frequency decades (config parameter
spectral_smooth_width_decades)The spectral signal to noise ratio is checked. Amplitude spectra with signal to noise ratio smaller than
spectral_sn_minare skipped.The “H” component is built based on one or more spectral components, depending on the
wave_typeandignore_verticalconfig parameters:if
wave_typeisPorS:if
ignore_verticalisFalse, the two horizontals and the vertical components are combined;if
ignore_verticalisTrue, only the two horizontals components are combined;
if
wave_typeisSV:if
ignore_verticalisFalse, the radial and the vertical component are combined;if
ignore_verticalisTrue, only the radial component is used;
if
wave_typeisSH:only the transverse component is used;
Spectra are combined through the root sum of squares (see Overview).
All the amplitude spectra are converted to moment magnitude units (see Building spectra).
Station corrections are applied, if requested (see Station Residuals).
The weight spectrum is built, depending on the config option
weighting.
See the source code of ssp_build_spectra.build_spectra() for
implementation details.