<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi there</p>
    <p>In Scilab I've used interp1 to calculate a cubic spline
      interpolation, like this:<span style="color:rgb(0,0,0);"><br>
      </span></p>
    <p><span style="color:rgb(0,0,0);">a</span><span
        style="color:rgb(74,85,219);">(</span><span
        style="color:rgb(255,170,0);">:</span><span
        style="color:rgb(0,0,0);">,</span><span
        style="color:rgb(188,143,143);">1</span><span
        style="color:rgb(74,85,219);">)</span> <span
        style="color:rgb(92,92,92);">=</span> <span
        style="color:rgb(174,92,176);text-decoration:underline;">interp1</span><span
        style="color:rgb(74,85,219);">(</span><span
        style="color:rgb(50,185,185);">log</span><span
        style="color:rgb(74,85,219);">(</span><span
        style="color:rgb(0,0,0);">f3</span><span
        style="color:rgb(74,85,219);">)</span><span
        style="color:rgb(0,0,0);">,</span><span
        style="color:rgb(0,0,0);">a1</span><span
        style="color:rgb(0,0,0);">,</span><span
        style="color:rgb(50,185,185);">log</span><span
        style="color:rgb(74,85,219);">(</span><span
        style="color:rgb(0,0,0);">f</span><span
        style="color:rgb(74,85,219);">)</span><span
        style="color:rgb(0,0,0);">,</span><span
        style="color:rgb(188,143,143);">'</span><span
        style="color:rgb(188,143,143);">spline</span><span
        style="color:rgb(188,143,143);">'</span><span
        style="color:rgb(74,85,219);">)</span><span
        style="color:rgb(0,0,0);">;</span></p>
    <p>a = amplitude (magnitude). f3 is a frequency (27000 linear spaced
      data), a1 is the original data, f is the resampled 1200
      frequencies (log-spaced), where I need the spline to interpolate
      some data for me.</p>
    <p>Above should work OK, but it's not perfect, compared to a Fortran
      script. The fortran script calculates with its own cubic spline
      routine, utilizing LAPACK (DGTTRF and DGTTRS) to solve for
      polynomial coefficients.</p>
    <p><br>
    </p>
    <p>The question is - above code line with the interp1 spline, which
      kind of spline is it?</p>
    <p>Digging into interp, I see multiple options. Digging into splin,
      I also see multiple options.</p>
    <p>I looks like the interp1 is using "natural" spline - is this
      correct?</p>
    <p>It's strange because the splin help documentation doesn't
      recommend this. It says: Don't use the natural type unless the
      underlying function have zero second end points derivatives.<br>
    </p>
    <p>This might be my problem.</p>
    <p>The Scilab help for interp1 doesn't give any examples, but does
      mention I can add an "extrap" method. Could this be any of the
      suggestions in the splin documentation. For example, could I
      write:</p>
    <p><span style="color:rgb(0,0,0);">a</span><span
        style="color:rgb(74,85,219);">(</span><span
        style="color:rgb(255,170,0);">:</span><span
        style="color:rgb(0,0,0);">,</span><span
        style="color:rgb(188,143,143);">1</span><span
        style="color:rgb(74,85,219);">)</span> <span
        style="color:rgb(92,92,92);">=</span> <span
        style="color:rgb(174,92,176);text-decoration:underline;">interp1</span><span
        style="color:rgb(74,85,219);">(</span><span
        style="color:rgb(50,185,185);">log</span><span
        style="color:rgb(74,85,219);">(</span><span
        style="color:rgb(0,0,0);">f3</span><span
        style="color:rgb(74,85,219);">)</span><span
        style="color:rgb(0,0,0);">,</span><span
        style="color:rgb(0,0,0);">a1</span><span
        style="color:rgb(0,0,0);">,</span><span
        style="color:rgb(50,185,185);">log</span><span
        style="color:rgb(74,85,219);">(</span><span
        style="color:rgb(0,0,0);">f</span><span
        style="color:rgb(74,85,219);">)</span><span
        style="color:rgb(0,0,0);">,</span><span
        style="color:rgb(188,143,143);">'</span><span
        style="color:rgb(188,143,143);">spline</span><span
        style="color:rgb(188,143,143);">'</span><span
        style="color:rgb(0,0,0);">,</span><span
        style="color:rgb(188,143,143);">'</span><span
        style="color:rgb(188,143,143);">not-a-knot</span><span
        style="color:rgb(188,143,143);">'</span><span
        style="color:rgb(74,85,219);">)</span><span
        style="color:rgb(0,0,0);">;</span></p>
    <p>?</p>
    <p>P.S. Since not-a-knot is mentioned as the default for the splin
      function, I think it should also be made the default for interp1
      ... just my two cents.<br>
    </p>
    <p>/Claus<br>
    </p>
  </body>
</html>