# Is $y[k] = y[k-1] + x[k]$ an integrator?

It looks exactly like an integrator to me. Since $$y[k] = y[k-1]+x[k] = y[k-2] + x[k-1] +x[k] = \sum{x}$$

Applying the Z-transform gives \begin{align} Y(z) &= Y(z)\cdot z^{-1} + X(z)\\ \Rightarrow\frac{Y(z)}{X(z)} &= \frac{1}{1-z^{-1}} \end{align}

When I convert $\frac{1}{1-z^{-1}}$ into Lapace transform in Matlab using d2c, it does not return $\frac{k}{s}$. Instead, it returns $\frac{1+s}{s}$. It seems there is a proportional term inside, when thinking in PID control point of view.

Could anyone explain on that?

• The system as a pole at z = 1 so it's unstable and, strictly speaking, the Z transform isn't the right tool since the region of convergences doesn't include the entire unit circle – Hilmar Apr 1 '16 at 13:59
• @Gilles: Thanks for the edit; I just corrected the first occurrence of "Laplace transform" to "Z-transform". – Matt L. Apr 1 '16 at 18:08
• @MattL. That's right, I was too hasty editing. Thanks ! – Gilles Apr 1 '16 at 18:10

The system

$$y[n]=y[n-1]+x[n]\tag{1}$$

is an ideal accumulator, i.e., it computes the cumulative sum of the input samples:

$$y[n]=\sum_{k=-\infty}^nx[k]\tag{2}$$

It is in a way analogous to a continuous-time integrator, but this doesn't mean that you will necessarily obtain an ideal integrator by transforming the discrete-time system to a continuous-time system. There are several methods to do the conversion, and I'm not sure which one you used when calling d2c.

In any case, the properties of the transformed continuous-time system not only reflect the properties of the original discrete-time system, but also the properties of the transformation. So the properties of a discrete-time system should be investigated directly in the discrete-time domain, not by transforming it to a continuous-time system.

• Thanks for your reply. It seems that any method for d2c does not give a 1/s. – richieqianle Apr 1 '16 at 14:15
• Actually this is an intermediate problem of mine and is not the final one. My real problem is actually to design a discrete controller which is to be transformed from s domain. I am really thinking if I shall use $y[k] = y[k-1] + x[k]$ or $y[k] = y[k-1] + x[k-1]$ or $y[k] = y[k-1] + 0.5*x[k-1]+0.5*x[k]$ for $1/s$ part of the controller. – richieqianle Apr 1 '16 at 14:16
• Is "when calling d2m" a typo and should be "when calling d2c" instead? – Matthias W. Apr 3 '16 at 10:40
• @MatthiasW.: That was indeed a typo, thanks. – Matt L. Apr 3 '16 at 10:57

Your simple integrator is called a "Rectangular Rule" integrator. There are more complicated (and more accurate) integrators called "Trapazoidal Rule", "Simpson's Rule", and "Tick's Rule" integrators.

• It should be mentioned that the choice of integrator's depends upon presumptions of the behavior between samples; that is input characteristics. – rrogers Apr 6 '16 at 16:31

Yes, the system should be an integrator.

What method did you use in the call to d2c.

• Thanks for your reply. It seems that any method for d2c does not give a 1/s. – richieqianle Apr 1 '16 at 14:12