Group Delay, Time Delay, and Phase Shift.
To illustrate the differences between group delay, time delay, and phase shift, the next circuit was simulated. The input filter reduces the gain at high frequencies by 6dB and adds phase lag, the phase shift being as shown in the first plot below for V4.
The phase is -15 deg at 20kHz, and (very approximately) linear at lower frequencies. If we had used a constant time delay element instead of the filter the phase plot would be a perfect straight line heading for infinite phase shift at infinite frequency. In the limited frequency range of the 'linear' shift we can work out the time delay which would give a similar line. A delay of 50usec at 20kHz would be one complete cycle of the sinewave, so 360deg. If 360deg is 50usec then the 15deg at 20kHz on the plot is 50x15/360 = 2usec. That is what is referred to as the 'group delay'. More generally in a plot of phase vs frequency the group delay is the negative of the gradient of the plot at any given frequency. If the phase shift becomes more negative as frequency increases then that corresponds to a positive group delay. A more complete treatment of group delay has been added as Putting the 'Group' into 'Group Delay' which also covers the effect on the signal envelope for multiple sinewaves.
The group delay can be completely cancelled by passing the signal through a phase advance network, in this case it is the 500p capacitor plus resistors. Looking at V5 after this network we find a flat gain and zero phase shift, we are back to the original input signal, (Except for a 6dB attenuation. We could give the unity gain buffer a gain of 6dB to compensate.)
To confirm that no real time delay is involved with this group delay, add a real delay of 0.5 usec to the output and apply a fast voltage step (V1, red) to the input. After the 'group delay' and compensating phase advance filter we get an attenuated but not delayed step (V5 green). Then after this is passed through the 0.5usec delay line, we find a real time delay (V7 blue). The larger 2usec 'group delay' has been cancelled by a simple RC filter, but there is no way to cancel the real 0.5usec time delay, until someone invents time travel. To put it another way, a positive group delay can be cancelled by a negative group delay (see references 1,2,3), but there is, as far as I know, no such thing as a negative time delay. However....
This is a little misleading, the step function has a wide bandwidth, far beyond 20kHz. Suppose we instead used a band limited audio signal with nothing above 20kHz (or better nothing above 10kHz where the initial phase lag is more accurately linear). Then the wave shape would be maintained, apart from being shifted 2usec along the time axis. If we used a real 2usec time delay instead of the RC network the result would be almost identical, apart from the small RC network phase nonlinearity. The second RC network will apply exactly the right phase advance to reverse the effect of the first RC network, but also would almost exactly cancel the effect of a real 2usec time delay. So, provided we are dealing with a band limited signal, cancelling a real time delay can be done, approximately. A difference between a real time delay and a simple RC phase shift is its accuracy and the bandwidth over which it can be maintained. Also of course the time delay may have a flat frequency response, but the RC networks used have 6dB variations in gain, and these also are in opposite directions and get cancelled, almost, apart from the final constant 6dB attenuation.
Here is the resulting gain and phase for a 2usec time delay followed by the RC phase advance circuit, the result is reasonably flat up to 10kHz as expected, but increasingly poor beyond that. So, even a real time delay can be cancelled fairly well over a limited frequency range.
This looks surprising if we imagine our signal starts at a precise point in time, t0, then there will be no signal after the delay line until t0 + 2usec, so how can a simple RC network cancel that delay and produce an output at t0? The simple answer is that band limited signals don't have a precise starting point, or to put it another way, a signal with a precise starting point is not band limited. I covered that in my Feedback Effects page in the section about time delays.Now consider an example of group delay in an audio amplifier, if we thought the group delay from input to output was a real time delay we could imagine that the feedback would arrive back at the input too late to counteract high frequency or crossover switching distortion.
Here is a basic inverting amplifier with gain 20 and a 10p capacitor in parallel with the 200k feedback resistor, giving closed loop -3dB at 80kHz, and the following phase plot shows 15deg phase lag at 20kHz, and therefore group delay from 0 to 20kHz about 2usec. The capacitor C1 makes very little difference to the phase for values tried from 0 to 470pF. The reason for its inclusion may become clear later.So how well does the feedback reduce distortion at different frequencies? To find out a 1V distortion signal is injected into the output via 1k, and with no feedback and the 10R open-loop output impedance shown there would be about 10mV at the output, V4.
The gain round the feedback loop is 476 at low frequencies, so as expected the 10mV 'distortion' injected at the output is reduced to 10/476 mV = 21uV, about what we find in the plots:
At higher frequencies C1 has a significant effect, though up to 20kHz the effect is still small. With C1 = 0pF the increased feedback via the 10pF reduces high frequency distortion (even though its inclusion adds 'group delay' at the output). With C1 = 200pF the ratio of the 200p and 10p capacitors is the same as the ratio of the 200k and 10k, and the feedback loop gain is constant, and gives a constant distortion level. Increasing C1 to 470pF the loop gain now falls at high frequencies and so distortion rises. I included this because I used a 470p capacitor here in my MJR7 mosfet amplifier. The effect on potentially audible distortion up to 20kHz is very small, but what I have left out so far is the question of feedback loop stability. We need to get the loop gain down to unity before enough phase lags accumulate to make the excess loop phase shift reach 180deg, and including that 470p plays a central role in achieving stability while maintaining a high loop gain to minimise distortion.
So clearly a parallel capacitor across the feedback resistor adds group delay at the output, but can increases loop gain at high frequencies and therefore help reduce high frequency distortion. What does adversely affect distortion levels is the fall in loop gain at high frequencies because of the internal compensation for loop stability, and in my MJR7 that includes the 470p input capacitor C1, which is part of the loop stabilisation. The distortion at 10kHz is about 10 times higher than at 1kHz, partly because of the lower feedback loop gain, but also because open-loop distortion is higher. Fortunately the 1kHz distortion is down around 0.0001% (-120dB), so even a factor of 10 increase at higher frequencies where distortion is less audible is of no concern. There is also a passive low-pass filter at the input of the MJR7 which also adds group delay giving a total around 3.3usec from 1kHz to 20kHz. And if anyone is concerned about that they can compensate just by moving 1mm closer to the speaker.
References:
1) Time machine, Anyone? by Andor Bariska.
About circuits with negative group delay, which look a lot like time travel, the peak of a signal envelope can appear to reach the output before arriving at the input, but this is not really time travel, and it makes use of some level of redundancy in band-limited signals enabling the future signal shape to be predicted.2) Causality and negative group delays in a simple bandpass amplifier by Mitchell and Chiao.
A good treatment of negative group delay.3) Negative Group Delay and Superluminal Propagation: An Electronic Circuit Approach by Kitano, Nakanishi, and Sugiyama.
More about negative group delay4) The Differential Time-Delay Distortion and Differential Phase-Shift Distortion as Measures of Phase Linearity, by W.Marshall Leach.
Not entirely relevant to this article, but gives useful information about amplifier bandwidth requirements for a given level of phase nonlinearity. For 5deg error up to 20kHz you don't need 500kHz bandwidth amplifiers as some have suggested, with a 2nd order Bessel response 25kHz is enough. With a 60kHz 2nd order response my MJR7 amplifier has far less than 5deg nonlinearity, at least from 1kHz to 20kHz.