08-24-2015 06:11 AM - edited 08-24-2015 06:12 AM
Hey guys,
I am looking for the formula which shows me the behaviour of a recursive moving average in the time domain. So i am looking for the step response in dependency of M, the amount of points used for averaging.
In general the step response is: transferfunction * unit step. But neither with the laplace transformation nor in the z-domain I am able to derive it.
The second question is: How do I get from the riste time (10% to 90%) to the -3dB freuqency or time constant? I know about t=TC*2,2 but I cant find a general derivation.
Kind regards
Slev1n
08-24-2015 06:28 AM
I suspect that a textbook on Signal Theory will be helpful. You might also find some useful information by doing a search on the Web. Do you have colleagues who are Electrical Engineers (or EE students)?
Bob Schor
08-26-2015 04:37 AM
Hi Slev1n,
a moving average is basically a FIR lowpass filter with constant filter coefficients.
In LabVIEW you can find a lot of filter functions. I attached a little example of how i would implement a moving average using the VI under:
Signal Processing >> Filter >> Advanced FIR Filtering >> FIR Filter
The order M of the filter is determined by the size of the array containing the filter coefficients. For example averaging over 5 points in time you need to
initialize a array of size 5 and each value would be 1/5.
I hope I understood your questions and this gives you a bit of help to get going from here.
Greetings.
08-26-2015 07:27 AM
Hey guys,
thanks for your help.
You are both right so far 🙂
I managed to plot the frequency magnitude response, impulse and step response of a "moving average" and an "exponentially weighted moving average" filter. I also implemented to plot the responses of mutiple pass MA or EWMA.
Therefor I used the "signal processing --> filter --> advanced IIR Filter --> smoothing filter coefficients.vi" and the "DFD Toolkit" to cascade and plot them. Usefull is also the example: "Build an EWMA filter.vi".
I also managed to find literature for the relation between "time constant" and alpha (for EWMA) but I don't find a source for the following equation explaining the relation between the filter lenght M of a Moving Average and the cut off frequency/ time constant.
Fc = 1/(2*pi*TC) = 0,44294 / (sqrt(M^2)-1); TC=time constant and the formula is equal for N>=2
This formula seems to be right, because from my magnitude response I can derive the cut off frequency Fc and compare it with different filter lengths M. But I dont know how to get to this equation. Maybe someone knows literature, where I could find it?
kind regards
Slev1n
08-26-2015 08:46 AM
Did you try Google? I typed in EWMA (since I didn't know what that stood for) and Google filled in EWMA Formula (among other choices).
Bob Schor
08-27-2015 03:31 AM - edited 08-27-2015 03:32 AM
I am looking for a source for the formula I found by using google 🙂
And this formula is for the MA not EWMA. For EWMA I have a good book 🙂