def apodization(mzs, intensities, w_size=10):
    """
    apodization with slepian window
    :param mzs:  numpy array numpy array of mz values
    :param counts:  numpy array numpy array of values to smooth
    :param w_size:  int window size
    :return: mzs: numpy array
    :return: counts: numpy array
    """
    import scipy.signal as signal
    win = signal.hann(w_size)
    win = signal.slepian(w_size, 0.3)
    intensities = signal.fftconvolve(intensities, win, mode='same') / sum(win)
    intensities[intensities < 1e-06] = 0
    return mzs, intensities
