obspy.signal.konnoohmachismoothing.konno_ohmachi_smoothing_window

konno_ohmachi_smoothing_window(frequencies, center_frequency, bandwidth=40.0, normalize=False)[source]

Returns the Konno & Ohmachi Smoothing window for every frequency in frequencies.

Returns the smoothing window around the center frequency with one value per input frequency defined as follows (see [Konno1998]):

[sin(b * log_10(f/f_c)) / (b * log_10(f/f_c)]^4
    b   = bandwidth
    f   = frequency
    f_c = center frequency

The bandwidth of the smoothing function is constant on a logarithmic scale. A small value will lead to a strong smoothing, while a large value of will lead to a low smoothing of the Fourier spectra. The default (and generally used) value for the bandwidth is 40. (From the Geopsy documentation - www.geopsy.org)

All parameters need to be positive. This is not checked due to performance reasons and therefore any negative parameters might have unexpected results.

This function might raise some NumPy warnings due to divisions by zero and logarithms of zero. This is intentional and faster than prefiltering the special cases. You can disable NumPy warnings (they usually do not show up anyways) with:

temp = np.geterr()
np.seterr(all='ignore')
...code that raises NumPy warning due to division by zero...
np.seterr(**temp)
Parameters:
  • frequencies (numpy.ndarray (float32 or float64)) All frequencies for which the smoothing window will be returned.
  • center_frequency (float) The frequency around which the smoothing is performed. Must be greater or equal to 0.
  • bandwidth (float) Determines the width of the smoothing peak. Lower values result in a broader peak. Must be greater than 0. Defaults to 40.
  • normalize (bool, optional) The Konno-Ohmachi smoothing window is normalized on a logarithmic scale. Set this parameter to True to normalize it on a normal scale. Default to False.