taper_Tukey#

PySeismoSoil.helper_signal_processing.taper_Tukey(input_signal: ndarray, width: float = 0.05) → ndarray[source]#

Taper a time-domain signal on both ends with a Tukey window.

Parameters:
  • input_signal (np.ndarray) – Signal to be tapered. Can be 1D numpy array or 2D array with 2 columns.

  • width (float, default=0.05) – The width of the Tukey window. The two tapered (cosine-shaped) ends together span width / 2 of the signal length (width / 4 at each end), i.e., width / 2 is the alpha parameter of scipy.signal.windows.tukey().

Returns:

output – The tapered signal. If input_signal has 2 columns, the 0th column (time) is unchanged.

Return type:

np.ndarray

Raises:

TypeError – When the input signal is not a numpy array