# Group delay of the integrator

I have a set of sensors, some velocity-meters and others accelerometers. To process the two groups together, I integrate the accelerometers signals (in time domain, using MATLAB's cumsum), so I'll have all sensor data now in velocity. Knowing the precise arrival time of a signal at different sensors are very important in determining the location of the signal source. Wondering if I am introducing some phase shift by integration, I tried to estimate the group delay. I am not sure what I am doing is right though. Given that the integrator can be written as:

$$y(n) = x(n) + y(n-1)$$

the filter coefficients will be

\begin{align} a&=\begin{bmatrix}1 &-1\end{bmatrix}\\ b&=\begin{bmatrix}1 & 0\end{bmatrix} \end{align}

Giving these values to the MATLAB's grpdelay function (Group delay), I get a constant value across all frequencies of half a sample.

• Does it mean that my signal after integration is shifted by half a sample regardless of frequency ?
• And what about zero frequency (the mean value), why is the group delay 0.5 sample at 0?
• Isn't it possible that you have flat group delay?(linear phase response?) – Rizias Nov 15 '16 at 16:15
• Could be. I was expecting to have a different delay at frequency 0 as the integrator is 1/s (in Laplace domain). And I don't quite understand 0.5 sample delay, is it correct ? – user1641496 Nov 15 '16 at 17:07

Your integrator is a perfect accumulator, which is an unstable (marginally stable) system with a pole at $z=1$:

$$H(z)=\frac{1}{1-z^{-1}}\tag{1}$$

This means that the value of the frequency response at $\omega=0$ (corresponding to the pole at $z=1$) is undefined. Consequently, the value of the group delay at $\omega=0$ is also undefined. Note that you can write down the frequency response of an ideal accumulator using a Dirac delta impulse (see this question and its answer), but this doesn't help in finding a value of the frequency response (or the group delay) at $\omega=0$.

For $\omega\neq 0$ (or, more generally, $\omega\neq 2\pi k$), we can easily determine the frequency response and group delay of the system:

$$H(e^{j\omega})=\frac{1}{1-e^{-j\omega}}=e^{j\omega/2}\frac{1}{e^{j\omega/2}-e^{-j\omega/2}}=e^{j\omega/2}\frac{1}{2j\sin(\omega/2)},\quad\omega\neq 2\pi k\tag{2}$$

From $(2)$, we see that the phase $\phi(\omega)$ equals $\omega/2$ plus a constant term which is irrelevant for the group delay. Consequently, the group delay is given by

$$\tau_g(\omega)=-\frac{d\phi(\omega)}{d\omega}=-\frac12,\quad\omega\neq 2\pi k\tag{3}$$

which is what you found using Matlab. However, Matlab doesn't tell you what's going on at $\omega=0$, where the value of the group delay is indeed undefined.

• A causal system with negative group delay. How come? – Rodrigo de Azevedo Apr 10 '17 at 21:17
• @RodrigodeAzevedo: Causality does not imply non-negative group delay. Take a prediction filter as an example: it predicts future samples based on the past. – Matt L. Apr 11 '17 at 9:55
• Yet, I would expect a differentiator, rather than an integrator, to have predictive power. – Rodrigo de Azevedo Apr 11 '17 at 10:07
• I was thinking of the PID controller, where differentiating the input allegedly has some form of predictive power. I assume that a group delay of $-\frac 12$ means some form of prediction plus interpolation. – Rodrigo de Azevedo Apr 11 '17 at 15:21
• @RodrigodeAzevedo: You're right about the combination of interpolation and prediction. As for the PID controller, it's not the first order difference filter that predicts, but the addition of the first-order difference to the actual value, which corresponds to a filter with coefficients $[1,0]+[1,-1]=[2,-1]$. That filter indeed has a group delay of $-1$ at DC. – Matt L. Apr 11 '17 at 15:33