def exponential_moving_average(samples, new_sample_wt):
    """ Compute exponential moving average of sample set. """
    if len(samples) is 0:
        return None
    else:
        exp_avg_filtered = samples[:1]
        for s in samples[1:]:
            s_filtered = ((1.0 - new_sample_wt) * exp_avg_filtered[-1]) + \
                         (new_sample_wt * s)
            exp_avg_filtered.append(s_filtered)
        return exp_avg_filtered