baseline_wavelet#
- PySeismoSoil.helper_gof_scores.baseline_wavelet(signal: ndarray, wavelet_level: int = 6, wavelet_name: str = 'dmey') ndarray [source]#
Perform baseline correction using wavelet decomposition. This function first decomposes the signal into different wavelets, and then removes the low-frequency trend (i.e., the baseline) from the wavelets, and then reconstruct the remaining wavelets into a new signal.
While baseline correction using high pass filtering is more suitable for correcting acceleration time histories, this wavelet decomposition method is maybe more suitable for correcting displacement time histories.
The python version of this function uses a Python version of modwt, the functions of which come from https://github.com/pistonly/modwtpy and can be found included at the bottom of this file.
- Parameters:
signal (np.ndarray) – The signal to be corrected. Must have two columns, with the first being time and the second containing the data.
wavelet_level (int) – Wavelet level.
wavelet_name (str) – Type of wavelet to use.
- Returns:
y – The baseline corrected signal. Also has two columns.
- Return type:
np.ndarray
Notes
Original Matlab code (c) Jian Shi, 2/17/2015 Ported to Python by Flora Xia, 02/2024