Summary
This metric uses a Median Absolute Deviation (MAD) approach to detect spikes consisting of one to a few samples in time series. MAD values are calculated over a 41-sample sliding window. Values exceeding a set threshold are counted as outliers. Adjacent outliers are attributed to a single spike.
Uses
Spikes lasting one or a few samples may indicate the presence of electrical noise sources.
Data Analyzed
Traces – one N.S.L.C (Network.Station.Location.Channel) per measurement
Window – 24 hours starting at 00:00:00 UTC
Data Source – IRIS miniSEED archive or IRIS PH5 archive
SEED Channel Types – [BH]H? | High Gain
Algorithm
- Request 24 hours of time series data for a single N.S.L.C.
- For each sample in the time series,
- Calculate the median absolute deviation (MAD) over a 41-sample sliding window centered on the current sample and store it:
MAD(i) = mean{ abs(amplitude(i) - mean_amplitude_over_N) } for N = i-20,…,i+20
- If the current MAD exceeds a threshold of 10, flag it as a potential spike and store its array index.
- Calculate the median absolute deviation (MAD) over a 41-sample sliding window centered on the current sample and store it:
- For each outlier index,
- Count each isolated index as a distinct spike,
- Count adjacent indices as a single spike.
- Report the count of distinct spikes as the num_spikes measurement.
Metric Values Returned
value – number of distinct spikes detected
target – the trace analyzed, labeled as N.S.L.C.Q (Network.Station.Location.Channel.Quality)
start – beginning of the data day requested (00:00:00 UTC)
end – end of the data day requested (truncated as 23:59:59 UTC)
lddate – date/time the measurement was made and loaded into the MUSTANG database (UTC)
Notes
num_spikes differs from the glitches and spikes metrics in that it examines the time series in order to detect spikes rather than reporting flags set in the miniSEED header.
The threshold is set high to limit effects of environmental noise, but large amplitude high-frequency signals may be misidentified as spikes by the algorithm.