### Lagrange Frequency Response Examples

The following examples were generated using Faust code similar to that
in Fig.4.12 and the `faust2octave` command
distributed with Faust.

#### Orders 1 to 5 on a fractional delay of 0.4 samples

Figure shows the amplitude responses of Lagrange interpolation, orders 1 through 5, for the case of implementing an interpolated delay line of length samples. In all cases the interpolator follows a delay line of appropriate length so that the interpolator coefficients operate over their central one-sample interval. Figure shows the corresponding phase delays. As discussed in §4.2.10, the amplitude response of every odd-order case is constrained to be zero at half the sampling rate when the delay is half-way between integers, which this example is near. As a result, the curves for the two even-order interpolators lie above the three odd-order interpolators at high frequencies in Fig.. It is also interesting to note that the 4th-order interpolator, while showing a wider ``pass band,'' exhibits more attenuation near half the sampling rate than the 2nd-order interpolator.

In the phase-delay plots of Fig., all cases are exact at frequency zero. At half the sampling rate they all give 5 samples of delay.

Note that all three odd-order phase delay curves look generally better in Fig. than both of the even-order phase delays. Recall from Fig. that the two even-order amplitude responses outperformed all three odd-order cases. This illustrates a basic trade-off between gain accuracy and delay accuracy. The even-order interpolators show generally less attenuation at high frequencies (because they are not constrained to approach a gain of zero at half the sampling rate for a half-sample delay), but they pay for that with a relatively inferior phase-delay performance at high frequencies.

#### Order 4 over a range of fractional delays

Figures 4.15 and 4.16 show amplitude response and phase delay, respectively, for 4th-order Lagrange interpolation evaluated over a range of requested delays from to samples in increments of samples. The amplitude response is ideal (flat at 0 dB for all frequencies) when the requested delay is samples (as it is for any integer delay), while there is maximum high-frequency attenuation when the fractional delay is half a sample. In general, the closer the requested delay is to an integer, the flatter the amplitude response of the Lagrange interpolator.

Note in Fig.4.16 how the phase-delay jumps discontinuously, as a function of delay, when approaching the desired delay of samples from below: The top curve in Fig.4.16 corresponds to a requested delay of 2.5 samples, while the next curve below corresponds to 2.499 samples. The two curves roughly coincide at low frequencies (being exact at dc), but diverge to separate integer limits at half the sampling rate. Thus, the ``capture range'' of the integer 2 at half the sampling rate is numerically suggested to be the half-open interval .

#### Order 5 over a range of fractional delays

Figures 4.17 and 4.18 show amplitude response and phase delay, respectively, for 5th-order Lagrange interpolation, evaluated over a range of requested delays between and samples in steps of samples. Note that the vertical scale in Fig.4.17 spans dB while that in Fig.4.15 needed less than dB, again due to the constrained zero at half the sampling rate for odd-order interpolators at the half-sample point.

Notice in Fig.4.18 how suddenly the phase-delay curves near 2.5 samples delay jump to an integer number of samples as a function of frequency near half the sample rate. The curve for samples swings down to 2 samples delay, while the curve for samples goes up to 3 samples delay at half the sample rate. Since the gain is zero at half the sample rate when the requested delay is samples, the phase delay may be considered to be exactly samples at all frequencies in that special case.

**Next Section:**

Avoiding Discontinuities When Changing Delay

**Previous Section:**

Faust Code for Lagrange Interpolation