calculate exponential moving average in python

EDIT: It seems that mov_average_expw() function from scikits.timeseries.lib.moving_funcs submodule from SciKits (add-on toolkits that complement SciPy) better suits the wording of your question. To calculate an exponential smoothing of your data with a smoothing factor alpha (it is (1 – alpha) in Wikipedia’s terms): >>> alpha = 0.5 >>> assert 0 < alpha <= 1.0 … Read more

Exponential Moving Average Sampled at Varying Times

This answer based on my good understanding of low-pass filters (“exponential moving average” is really just a single-pole lowpass filter), but my hazy understanding of what you’re looking for. I think the following is what you want: First, you can simplify your equation a little bit (looks more complicated but it’s easier in code). I’m … Read more

How to implement band-pass Butterworth filter with Scipy.signal.butter

You could skip the use of buttord, and instead just pick an order for the filter and see if it meets your filtering criterion. To generate the filter coefficients for a bandpass filter, give butter() the filter order, the cutoff frequencies Wn=[lowcut, highcut], the sampling rate fs (expressed in the same units as the cutoff … Read more