Home > atmlab > arts > arts_polybasis_func.m

arts_polybasis_func

PURPOSE ^

ARTS_POLYBASIS_FUNC Polynomial basis functions (following arts-2)

SYNOPSIS ^

function B = arts_polybasis_func( grid, polcoeff )

DESCRIPTION ^

 ARTS_POLYBASIS_FUNC   Polynomial basis functions (following arts-2)

   This function matches the arts internal function polynomial_basis_func, used
   to set up the basis functions for jacobian polynomial representations. For
   example, arts_polybasis_func( Q.SENSOR_RESPONSE.F_BACKEND, 1 ) gives the
   "weight" for changing the backend frequencies to match a retrieved frequency
   stretch.

 FORMAT   B = arts_polybasis_func( grid, polcoeff )
        
 OUT      B          Calculated basis function(s), stored as columns.
 IN       x          The grid 
          polcoeff   Polynomial coefficients. Can be a single index (e.g. 1)
                     or a range (e.g. 0:3)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

arts_polybasis_func.m

SOURCE CODE ^

0001 % ARTS_POLYBASIS_FUNC   Polynomial basis functions (following arts-2)
0002 %
0003 %   This function matches the arts internal function polynomial_basis_func, used
0004 %   to set up the basis functions for jacobian polynomial representations. For
0005 %   example, arts_polybasis_func( Q.SENSOR_RESPONSE.F_BACKEND, 1 ) gives the
0006 %   "weight" for changing the backend frequencies to match a retrieved frequency
0007 %   stretch.
0008 %
0009 % FORMAT   B = arts_polybasis_func( grid, polcoeff )
0010 %
0011 % OUT      B          Calculated basis function(s), stored as columns.
0012 % IN       x          The grid
0013 %          polcoeff   Polynomial coefficients. Can be a single index (e.g. 1)
0014 %                     or a range (e.g. 0:3)
0015 
0016 % 2009-10-22   Created by Patrick Eriksson.
0017 
0018 
0019 function B = arts_polybasis_func( grid, polcoeff )
0020 
0021 n = length(polcoeff);
0022 B = zeros( length(grid), n );
0023 
0024 for i = 1 : n
0025   if polcoeff(i) == 0
0026     %
0027     B(:,i) = 1;
0028     %
0029   else
0030     %
0031     x1 = min( grid );
0032     b = ( grid - x1 ) / ( 0.5*( max(grid) - x1 ) ) - 1;
0033     if polcoeff > 1
0034       b = b.^ polcoeff(i);
0035     end
0036     %
0037     B(:,i) = b - mean(b);
0038     %
0039   end
0040 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005