def member_to_beacon_proximity_smooth(m2b, window_size = '5min',
                                      min_samples = 1):
    """ Smooths the given object using 1-D median filter
    Parameters
    ----------
    m2b : Member to beacon object

    window_size : str
        The size of the window used for smoothing.  Defaults to '5min'.

    min_samples : int
        Minimum number of samples required for smoothing

    Returns
    -------
    pd.DataFrame :
        The member-to-beacon proximity data, after smoothing.
    """
    df = m2b.copy().reset_index()
    df = df.sort_values(by=['member', 'beacon', 'datetime'])
    df.set_index('datetime', inplace=True)

    df2 = df.groupby(['member', 'beacon'])[['rssi']] \
        .rolling(window=window_size, min_periods=min_samples) \
        .median()

    # For std, we put-1 when std was NaN. This handles the case
    # when there was only one record. If there were no records (
    # median was not calculated because of min_samples), the record
    # will be dropped because of the NaN in 'rssi'
    df2['rssi_std']\
        = df.groupby(['member', 'beacon'])[['rssi']] \
        .rolling(window=window_size, min_periods=min_samples) \
        .std().fillna(-1)

    # number of records used for calculating the median
    df2['rssi_smooth_window_count']\
        = df.groupby(['member', 'beacon'])[['rssi']] \
        .rolling(window=window_size, min_periods=min_samples) \
        .count()

    df2 = df2.reorder_levels(['datetime', 'member', 'beacon'], axis=0)\
        .dropna().sort_index()
    return df2