# Negative group delay and envelope advance

Let there be an input to a LTI system with frequency response $$H(f)$$, given signal $$x(t) = a(t)\cos(2\pi f_ot)$$, where $$a(t)$$ is a narrowband envelope and of bandwidth $$B$$ Hz, such that $$f_o \gg B$$.

The output $$y(t)$$ is given by $$y(t) =\lvert H(f_o) \rvert a\left(t - \tau_g\right)\cos\left(2\pi f_o\left(t - \tau_p\right)\right)$$ here $$\tau_g$$ is the group delay and $$\tau_p$$ is the phase delay at frequency $$f_o$$.

My question

It is not unusual to have positive gradients in the phase response and hence have a negative group delay which seems to suggest that the envelope is advanced in time, so the input appears at the output prior to being applied!! This of course should not happen in practice so what are we missing here. Can somebody explain this. Is there an issue with the derivation? But this is a well known equation.

Note:I have read the research article and other questions that conclude with the notion of "filter being able to predict values from past" , I am not convinced by those. In a causal LTI practical system I am sure, an input will appear at output only after it is applied at input.

• Check out these three answers. I find it hard to believe these (at least) haven't come up in the suggestions' list while writing the question. – a concerned citizen Apr 17 at 18:41
• @a concerned citizen, only the second answer touches on this aspect , and points to an article reading which it suggests that there is a prediction possible for narrowband signals, I don't agree to that, that's not logical. This is what the author says "a bandlimited signal can theoretically be reconstructed from just knowing its value over a small stretch of time (this is called analytic continuation).This knowledge of the past is sufficient to predict the future" Regarding suggestion while writing the question, I am using the stackexchange Android app so there are no predictions in those – Dsp guy sam Apr 17 at 19:06
• Never used the phone to post, but in the 2nd link I posted, in the answer, there's a link to a paper which explains very well what exactly a negative group delay is in practice: it's an attempt of the system to predict what will happen, but which is only valid for harmonic signals. Read it, it's a very nice read. – a concerned citizen Apr 17 at 21:50
• Does this answer your question? What is meant by "Group delay"?in simple words? – Dan Boschen Apr 17 at 22:30
• @VMMF, that's where the question started this prediction of signal In a causal LTI system seems quite naive. The explanation below from DSP Rookie, makes total sense, the assumption of bandlimited signal itslef doesn't make sense where we define a time of applying it. So the total signal will be delayed and certain frequencies advance, but this advance doesn't hapen prior to the actual signal being applied at the input. – Dsp guy sam Apr 19 at 5:40

Answer : No, any causal LTI system with frequency response $$H(f)$$ cannot produce the output $$y(t)$$ in advance. And, the answer lies in the causality of input signal $$x(t)$$ being applied to $$h(t)$$. Any causal input $$x(t)$$ which has an identifiable beginning cannot truly be Narrow-Band or Band-Limited. It will have non-zero frequency content at all frequencies.

Yes, you are right that it is not uncommon to have practical LTI systems with $$+ve$$ gradient of $$\angle H(f)$$ in parts of the response and hence making group delay $$-ve$$ around those parts of $$H(f)$$. And, if we can give a Narrow-Band input $$x(t)$$ such that the bandwidth of $$x(t)$$ is restricted in that part of $$H(f)$$, then you would have a time-advanced output. So, are we able to look into the future?

NO!!!! We are not. My point will get clear in a minute.

Let me take an example of a very common and practically realizable IIR filter in equivalent discrete time scenario : the Leaky Integrator.

The $$H(e^{j\omega})$$ of a leaky integrator is given by the following: $$H(e^{j\omega}) = \frac{1-\lambda}{1-\lambda e^{-j\omega}},$$So, $$|H(e^{j\omega})|^2 = \frac{(1-\lambda)^2}{1 + \lambda^2 -2\lambda cos(\omega)}, \angle{H(e^{j\omega})} = arctan \{\frac{-\lambda sin(\omega)}{1-\lambda cos(\omega)} \}$$

The shape can be plotted in MATLAB by following:

freqz(0.1, [1 -0.9], (-pi:0.001:pi)); Now, if we can give a very narrow-band input $$x[n]$$ centered around $$\omega = 0.6\pi$$ and bandlimited within a very small $$\Delta \omega$$, then we would get a response as follows:

$$x[n] = s[n]cos[\omega_o n]$$, where s[n] is a narrowband baseband signal and $$\omega_o = 0.6\pi$$ and group delay of the filter is $$g_d$$ around $$\omega_o$$ $$Y(e^{j\omega}) = X(e^{j\omega}).e^{-j.g_d(\omega-\omega_o)},$$ You can work this out to get $$y[n] = s[n - g_d]cos[\omega_o n]$$

According to the equation above, leaky integrator is basically producing an output which is having a delayed envelope of input by $$g_d$$ samples. And, what happens if this $$g_d$$ is negative!

Check out that $$g_d$$ is indeed negative around $$\omega_o = 0.6\pi$$. Does that mean that the leaky integrator is able to produce the $$s[n]$$ envelope $$g_d$$ samples in advance?

No, it is not. The caveat is that we cannot have a perfectly bandlimited narrowband causal input $$x[n]$$. We cannot have a $$x[n]$$ which has an absolute start in time and yet it is having a bandlimited narrowband response in frequency domain.

Because we cannot have such input $$x[n]$$, hence we cannot have a "future seeing time machine".

In order to produce a causal input, which has an identifiable absolute start in time, the frequency response of the input will spread in frequency domain and the input $$X(e^{j\omega})$$ will be present at all frequencies with non-zero spectral components, and this will make the overall delay to be positive.

Indeed, if you plot the group delay response of the leaky integrator, you get the following, and check that even though the group delay is small negative number away from $$\omega = 0$$, it is taking high $$+ve$$ values around $$\omega = 0$$: • Nice answer- to clarify "So, leaky integrator is basically producing an output which is having a delayed envelope of input by gd samples." When the carrier of the envelope is centered at $0.6\pi$ the envelope of the output would precede the envelope of the input if we have a negative group delay, so wouldn't this be "So, leaky integrator is basically producing an output where the envelope of the input is delayed by the envelope of the output by gd samples."? – Dan Boschen Apr 18 at 17:16
• @DanBoschen I have written the statement "So, leaky Integrator ....", in general according to the result that $y[n] = s[n-g_d]cos[\omega_o n]$. Then, in the next paragraph, I have said that because group delay is negative around $\omega_o = 0.6\pi$, "Does that mean the leaky Integrator is able to produce the envelope in advance?". I think my way of presenting the info has got you confused but what I meant and what you are saying are same. :) – DSP Rookie Apr 18 at 17:24
• @DanBoschen I have improved presentation of that statement. Thanks for pointing it out! – DSP Rookie Apr 18 at 17:31
• Yeah it was just because right before it says $\omega_o = 0.6\pi$ and then right after it said that sentence, so that was the confusing part. But perfect now! – Dan Boschen Apr 18 at 17:32
• @DSP Rookie, that makes total sense, nice answer! – Dsp guy sam Apr 19 at 5:41

Here is a actual example with negative group delay that will provide further insight:

Below is a plot of the output and input of a pulse through a realizable filter that has negative group delay: It seems like a complete violation of causality, but it is just a clever DSP magic trick. Let's explore further:

The filter above that did this had the following transfer function with the normalized frequency of the carrier within the pulse envelope was 0.1 radians/sample:

$$H(z) = \frac{42.7(z-.9)^2}{z(z-.1)^2}$$

Notice that a scaled derivative of the input would almost provide this, but there are other features in the memory of this filter that cause the peak of the envelope to go down based on the previous cycles. In either case, as with the derivative the pulse can lead without having started before the input.

This filter can be factored into a cascade of filters including the transfer function below.

$$G(z) = \frac{z-0.9}{z(z-0.1)}$$

H(z) as a more complex filter has a larger delay offset so was more obvious for the plot, but G(z) is simpler and will be easier to see what is occurring since it is given by this equation:

$$y[n] = x[n-1] - 0.6x[n-2] + 0.4y[n-1]$$

A plot of the same input pulse through $$G(z)$$ is shown below. Below shows the initial conditions out of the filter with a constant envelope input signal of the same frequency: A zoom in of the very first samples shows how the leading pulse shape can develop. Answering how the output knows how to turn up before the input will further help explain how the pulse envelope can do similar things while still being causal. Working through the equation above manually for the first 40 samples can help further illustrate how the memory of the past samples in the filter can help predict the future, given that the pulse occupies a narrow band of frequencies. Extending this further and it gets really fascinating: consider an extended pulse by using a Tukey (cosine taper) window where the pulse is of very long duration: And we zoom in at the beginning and end of the pulse and see that the envelope of the output is indeed advanced in time, but here it really gives the illusion that the output could predict the input since it appears that the envelope begins to decay at the output before the first sample of the input!

End of Pulse -- How can this be?? The secret to the DSP Magic Trick revealed!

At the scale of the entire pulse it appears that the change in the input is somehow predicted before it even occurs. However if we zoom in and look carefully at the 5 peaks that at whole scale appear unchanged, we see that indeed the input starts to change and it is this change that gets captured and amplified in the memory of the filter in the creating of the next output, it is completely causal. We are essentially seeing the DSP equivalent of economic "leading indicators" applicable to conditions when this can occur (when the derivative of phase with respect to frequency is positive for the "group" of frequencies within our signal). We see the bandwidth constraint in that this occurs with very small changes that start to occur over many cycles, even before it is immediately visible to us such as on this plot. A sudden unannounced larger change from one sample to the next would require high bandwidth, while low bandwidth implies memory over multiple samples. For futher details please refer to: What is meant by "Group delay"?in simple words?

• I see your point, but this notion of memory of past samples predicting future is not a very appealing notion to me. I have been thinking about this, I think issue is that as soon as we say, that a signal is bandlimited, means it has infinite time support, once we have this, then the notion of "applying" a signal at the input, inherently is deeming it to be a one sided sequence and this is a contradiction itslef. I am trying to concretize this notion and thinking. – Dsp guy sam Apr 18 at 6:08
• @Dspguysam Think of it in terms of human perception, we use the derivative to assess and predict motion: we look left and right to see the cars that are coming and, based on their speed, we can evaluate whether we can cross or not, and we can do that because the rate of change is slow and smooth. Compare this with a falling leaf, which falls slow, then curls, then changes direction, then... Can you predict where a car will be next? Can you predict where a falling leaf will be next? I'm sure you can pick on details in what I said, but think of the general picture (or similar examples). – a concerned citizen Apr 18 at 7:06
• @Dspguysam Yes with bandlimiting in this context we don't necessitate it to be zero outside a certain frequency limit (as that can't happen as you explain), yet we are still able to bandpass filter a time limited waveform-- the frequency content approaches zero out of band but never gets there. I added some further details with the case I was using in how it makes its "prediction" in this case. – Dan Boschen Apr 18 at 18:12
• @Dan appreciate you adding new details, those make sense – Dsp guy sam Apr 19 at 14:27
• @Dspguysam it is all very interesting. If I get more time I'd like to try the same extended pulse with a more abrubt window (I used the Tukey window which provides the very gradual transition AKA bandwidth limiting). It would also be interesting to see an example that has the most pronounced negative group delay for a pulse--- I can see how this requires a very high dynamic range in the filter coefficients, hence there is a practical limitation. – Dan Boschen Apr 19 at 14:30