For some time now it has been conventional ‘wisdom’ that using time based digital integration may cause amplitude errors in the result and that these get worse as the frequency increases. As a result of this, integration using Omega arithmetic has been prevalent by using Fourier Transforms of the signal. This, of course, remains a valid approach and is particularly useful if the data is already in the frequency domain, which was its prime purpose.
It has also been conventional wisdom that a higher order integrator is ‘better’. Now, a rectangular integrator is a zero order integrator and a trapezium integrator is a first order integrator. So according to the ‘second wisdom’ the trapezoidal integrator should produce better results than the rectangular integrator. This is not the case. As will become evident, further studies into wide band integrators have shown this amplitude degredation is limited to what are refered to as ‘odd order’ integrators, in particular integrators such as the Trapeziodal integrator. Even order integrators, such as the rectangle integrator, do not have this frequency related degredation. What remains valid is that using a higher even order integrator is more accurate than that of a lower even order integrator.
First let us illustrate the problem using a trapezoidal integrator. Figure 1 below is the result of using a trapezium integrator on a 100Hz sinewave of amplitude and sampled at 1024 samples/second which is well below half the Nyquist frequency. The second graph (Figure 2) is the same except at 300Hz. In both case the blue curve is the mathematically exact result and the black curve is the trapezoidal integration. In both cases the Trapezoidal integration has a loss of amplitude with this loss being worse as the frequency increases towards the Nyquist frequency (Sample Rate/2).
Recently, a new set of wide band even order integrators up to 6th order has been introduced into Prosig’s DATS software. These are accurate over the entire frequency range and are comparable to the omega arithmetic algorithm in terms of accuracy. The examples in Figure 3 below show the same two cases as above except that a 4th order wide band integrator has been used in place of the trapezium integrator. There is excellent agreement. The slight apparent discrepancies in the higher frequency case are in fact due to an effective delay as discussed later.
As a start consider the frequency response characteristics of an ideal integrator. It is readily shown that the desired frequency response of an ideal integrator is
That is, the modulus is given by and the phase by
In the following it is helpful to know the relationship between the phase and any time delay. Now the quantity known as the phase delay, , is simply the time delay equivalent to the particular phase at each frequency, for example
, in seconds is defined as seconds, where is in radians and is in radians/sec. Alternatively in degrees and Hz we have seconds. The phase delay gives the time delay at each frequency. If the phase delay is linear, that is, if it is a straight line versus frequency, then it means that all frequencies are delayed by the same amount. Specifically, if the phase is in the form then the phase consists of the constant angle plus a time delay to the whole signal of seconds. Note that the special case of constant phase may be expressed as .
For completeness, there is a similar phase related delay known as the group delay, , which is defined by seconds when is in radians and is in radians/sec or when is in degrees and $f$ is in Hz. This is most useful when dealing with modulated signals, but in the special case where the phase is linear, that is , then the group delay also gives the delay of the signal.
The transfer function for the Trapezium integrator, which is an order 1 integrator, is shown in Figure 5. The transfer function of all odd order integrators is similar to that of the trapezium integrator. For these the modulus function is like the ideal integrator up to about the quarter sample rate. After that it increasingly diverges.
Ignoring the zero frequency phase, which is artificially set to zero by the software, then the phase is a straight line. The phase delay is half of a sample period of the signal together with a constant minus 900. That is the result is the integrated signal delayed by half a sample time. Obviously the trapezium integrator is limited in its frequency range.
The Rectangular integrator (Figure 6) is an order 0 integrator and does not suffer the amplitude error. It has the same phase delay of half of a sample period together with a constant minus 900.
The effects are shown in the integrated sine waves in Figure 7 & 8. With a sample rate of 1000 samples/second at 60Hz (12% of Nyquist frequency) the results of either a rectangular or a trapezoidal integrator are identical for practical purposes, but at 350Hz (70% of Nyquist frequency), the results are very different. Note that the apparent beating in the 350Hz case is just that, apparent. It is the effect of the lower number of samples per period and that the software draws straight lines between points.
To illustrate the half order delay a sine wave was digitally integrated using rectangular integration and is shown in Figure 9 (red curve) compared to direct generation of the integrated sine wave (blue curve). That is, the blue curve is the ‘correct’ one in amplitude and time, the integrated signal is ‘delayed’.
To compensate for the delay the integrated curve was ‘advanced’ by adjusting its start time ('base' in DATS terms) by one half of a sample period. The result is shown in Figure 10 without the computer drawn straight lines joining successive points. It is clear that the digitally integrated signal produces the integrated values at the midpoints.
In summary, if we seek to integrate the time history or similar then we should use even order integrators. These will give a result that lags the ‘true’ integration by half a sample time. If we have a signal in the frequency domain then we should use the Omega arithmetic option, which does not have the minor delay.