# The Application of Spectral Entropy to P-Wave Detection in Continuous Seismogram Analysis
## 2 Materials and Methods
### The Methodological Approach  
Spectral entropy is a measure of the distribution of a signal's spectral power. The concept is based on Shannon entropy, also known as information entropy, from the field of information theory. Spectral entropy treats the normalized power distribution of a signal in the frequency domain as a probability distribution and computes its Shannon entropy. In this context, Shannon entropy becomes the spectral entropy of the signal. This property can be valuable for feature extraction in detection and diagnostic tasks--for example, in assessing bearing degradation [20] and identifying gear failures [21]. In such applications, spectral entropy has proven to be an effective and sensitive indicator of changes in conditions, particularly in cases where features are weakly expressed. Moreover, spectral entropy has demonstrated robustness to noise in speech recognition systems [22]. The equations for spectral entropy are derived from the power spectrum and the corresponding probability distribution of the signal. For a discrete signal \(x(n)\), the power spectrum is defined as \(S(m)=|X(m)|^{2}\), where \(X(m)\) is the discrete Fourier transform (DFT) of \(x(n)\). The probability distribution \(P(m)\) is then given by the following. Figure 1: A temporal map of seismic events. The figure illustrates the distribution of registered events across key seismic stations during the period from 2023 to 2024. It shows that most stations registered a comparable number of seismic events, with a peak observed in January and February 2024. However, the BAET station had significantly fewer events (only 12). This discrepancy is explained by the fact that BAET became operational only in 2024, resulting in a substantially shorter observation period compared to that for the other stations. The probability distribution:  
\[P(m)=\frac{S(m)}{\sum_{i}S(i)} \tag{1}\]  
The spectral entropy \(H\) follows as follows:  
\[H=-\sum_{m=1}^{N}P(m)\log_{2}P(m) \tag{2}\]  
Normalization is as follows:  
\[H_{n}=-\frac{\sum_{m=1}^{N}P(m)\log_{2}P(m)}{\log_{2}N} \tag{3}\]  
where \(N\) is the total frequency points. The denominator, \(\log_{2}N\), represents the maximal spectral entropy of white noise, uniformly distributed in the frequency domain. If a time-frequency power spectrogram \(S(t,f)\) is known, then the probability distribution becomes as follows. \[P(m)=\frac{\sum_{i}S(t,m)}{\sum_{i}\sum_{f}S(t,f)} \tag{4}\]  
The spectral entropy is still  
\[H=-\sum_{m=1}^{N}P(m)\log_{2}P(m) \tag{5}\]  
To compute the instantaneous spectral entropy given a time-frequency power spectrogram \(S(t,f)\), the probability distribution at time \(t\) is  
\[P(t,m)=\frac{S(t,m)}{\sum_{f}S(t,f)} \tag{6}\]  
Then, the spectral entropy at time \(t\) is  
\[H(t)=-\sum_{m=1}^{N}P(t,m)\log_{2}P(t,m) \tag{7}\]  
The proposed information entropy approach falls into the broader class of spectral analysis methods. Its pronounced sensitivity to the structural and compositional features of seismic signals makes it suitable for short-term seismogram analyses, particularly for detecting initial P-wave arrivals. The spectral entropy of the one-dimensional time series of seismic records was calculated using the _pentropy_ function in MATLAB (Release 2020b). The spectrogram x(t) was calculated using the _spectrum_ function with the default parameters; see Figure 2.  
As a measure of detecting qualitative changes in the signal characteristics, including variations in the oscillation amplitude, we used the difference between the averaged spectral entropy values, \(H_{2}-H_{1}\), calculated over two equal-length time windows: one preceding \(H_{1}\) and one following \(H_{2}\) the seismic event. A sensitivity analysis was performed to evaluate how the window size and the overlap used in _spectrum_ affect the detection sensitivity of the entropy-based method. Figure 3 illustrates the variation in the gain of spectral entropy \(\Delta H\) as a function of these parameters.