3
\$\begingroup\$

What is the Laplace transfer function of a moving average? $$y_k=\frac{x_k+x_{k-1}+x_{k-2}+x_{k-3}+...+x_{k-N+1}}{N}$$ I tried to get it from the z-domain transfer function using conversion tables: $$\frac{y_k}{x_k}=\frac{1+z^{-1}+z^{-2}+z^{-3}+...+z^{-N+1}}{N}$$

But unless I've read them wrong they don't have the "bricks" I need to get me anywhere.

\$\endgroup\$
  • 1
    \$\begingroup\$ You ask for Laplace transform, but then ask about the Z domain. Make up your mind. \$\endgroup\$ – Olin Lathrop Feb 13 '15 at 13:28
  • \$\begingroup\$ @Olin: I ask for Laplace transform, and tell that I tried to get it from the z transform and couldn't get it. \$\endgroup\$ – Mister Mystère Feb 13 '15 at 13:31
  • 1
    \$\begingroup\$ The edited question refers to transforming from Z to S domains. I think you need to convolve the Z transfer function with a rectangular window function in the time domain (sinc function in the S-domain) assuming zero-order hold. Hopefully that'll get you headed in the right general direction. \$\endgroup\$ – Brian Drummond Feb 13 '15 at 13:31
10
\$\begingroup\$

$$\frac{y_k}{x_k}=\frac{1+z^{-1}+z^{-2}+z^{-3}+...+z^{-N+1}}{N}$$

can be re-written as

$$\frac{y_k}{x_k}=\frac{1}{N}\frac{1-z^{-N}}{1-z^{-1}}$$

That should be straightforward to model in the s-domain by replacing z by $$e^{sT}$$

i.e. $$H(s)=\frac{1}{N}\frac{1-e^{-sTN}}{1-e^{-sT}}$$ $$$$

This is a SINC function in the frequency domain whose magnitude versus frequency is of the form: $$\dfrac{sin(\pi fN)}{Nsin(\pi f)}$$

enter image description here (source)

\$\endgroup\$
  • \$\begingroup\$ Thanks a lot, I replaced z by exp(sT) in the basic z form. It makes a lot of sense that z be replaced this way as a previous value is simply a delay of the sampling period. The frequency response is very interesting too. \$\endgroup\$ – Mister Mystère Feb 13 '15 at 14:30
3
\$\begingroup\$

Just to add to the question (as I had the same some time ago), the "continuous version" of the moving average would be the sliding window integral:

$$ y(t) = \int_{t-T}^{t} u(\tau) d\tau $$

This can be written as:

$$ y(t) = \int_{0}^{t} u(\tau) d\tau - \int_{0}^{t-T} u(\tau) d\tau $$

Noting that the second term is a time-shifted version of the first and taking the Laplace transform:

$$ Y(s) = \frac{U(s)}{s} - \frac{U(s) e^{-sT}}{s} = \frac{1-e^{-sT}}{s} U(s) $$

(which by the way is the same transfer function as the zero-order hold)

The frequency response is a sinc function too: wolframalpha

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.