Sign in

username:

password:



Not a member?

Search Online Books



Search tips

Free Online Books

Chapters

Chapter Contents:

Search Physical Audio Signal Processing

  

Book Index | Global Index


Would you like to be notified by email when Julius Orion Smith III publishes a new entry into his blog?

  

Lagrange Interpolation Frequency Response Examples

Figure K.2: Lagrange Interpolator Frequency Responses: Order 4 -- $ \Delta $ = 1.1 to 1.5 in steps of 0.1.
\includegraphics[width=3.5in]{eps/lagrange4-P1-P5}

Figure K.3: Lagrange Interpolator Frequency Responses: Order 3 -- $ \Delta $ = 1.1 to 1.5 in steps of 0.1.
\includegraphics[width=3.5in]{eps/lagrange3-P1-P5}

Figure K.4: Lagrange Interpolator Frequency Responses: Order 2 -- $ \Delta $ = 1.1 to 1.5 in steps of 0.1.
\includegraphics[width=3.5in]{eps/lagrange2-P1-P5}

Figure K.5: Lagrange Interpolator Frequency Responses: Order 1 -- $ \Delta $ = 1.1 to 1.5 in steps of 0.1.
\includegraphics[width=3.5in]{eps/lagrange1-P1-P5}

Figure K.6: Lagrange Interpolator Frequency Responses: Orders 1, 2, and 3 -- $ \Delta = 1.4$
\includegraphics[width=3.5in]{eps/lagrange}

Figure K.7: Faust program tlagrange.dsp used to generate Figures K.2 through K.5.

 
// tlagrange.dsp - test lagrange.lib

import("lagrange.lib");

N = 16;

// Change "processX" to "process" in one case below:

// Aggregate test:
processA = 1-1' <: (fdelay1(N,5.5),
                               fdelay2(N,5.5),
                               fdelay3(N,5.5),
                               fdelay4(N,5.5));
// To see results:
// [in a shell]:
//   make tlagrange.m
// [in Octave]:
//   plot(db(fft(faustout,1024)(1:512,:)));
// Conclusion: 4th order seems worth it, all considered.

// Individual tests:
process1 = 1-1' : fdelay1(N,5.5);
process2 = 1-1' : fdelay2(N,5.5);
process3 = 1-1' : fdelay3(N,5.5);
process4 = 1-1' : fdelay4(N,5.5);

// Test a range of 4th-order cases:
process = 1-1' <: (fdelay4(N,5.1),
                   fdelay4(N,5.2),
                   fdelay4(N,5.3),
                   fdelay4(N,5.4),
                   fdelay4(N,5.5));

// Test a range of 3rd-order cases:
process3R = 1-1' <: (fdelay3(N,5.1),
                   fdelay3(N,5.2),
                   fdelay3(N,5.3),
                   fdelay3(N,5.4),
                   fdelay3(N,5.5));

// Test a range of 2nd-order cases:
process2R = 1-1' <: (fdelay2(N,5.1),
                   fdelay2(N,5.2),
                   fdelay2(N,5.3),
                   fdelay2(N,5.4),
                   fdelay2(N,5.5));

// Test a range of 1st-order cases:
process1 = 1-1' <: (fdelay1(N,5.1),
                   fdelay1(N,5.2),
                   fdelay1(N,5.3),
                   fdelay1(N,5.4),
                   fdelay1(N,5.5));

Figure K.8: File lagrange.lib containing Lagrange interpolation utilities written in the Faust language.

 
// lagrange.lib - Lagrange interpolation utilities

declare name "Lagrange Interpolation Library";
declare author "Julius O. Smith (jos at ccrma.stanford.edu)";
declare copyright "Julius O. Smith III";
declare version "1.0";
declare license "STK-4.3"; // Synthesis Tool Kit 4.3 (MIT style license)
//declare reference 
//"http://www.dsprelated.com/dspbooks/pasp/Lagrange_Interpolation";

import("music.lib"); // define delay, frac

// NOTE: While the implementations below appear to use multiple delay lines,
//  they in fact use only one thanks to optimization by the