def _taper_stream(tr, taper_buffer):
    """ Taper the stream, return new stream """
    start = tr.stats.starttime
    end = tr.stats.endtime
    dur = end - start
    buffer = taper_buffer
    tr.taper(type='hann', max_percentage=0.05, max_length=dur * buffer)
    return tr
