Home > Matching_SYM_LSM > src > Functions > Splines > LSM_f_cubic_smoothing.m

LSM_f_cubic_smoothing

PURPOSE ^

spline smoothing

SYNOPSIS ^

function z=LSM_f_cubic_smoothing(x,y,f)

DESCRIPTION ^

 spline smoothing

 f   = N x M array of function values
 x,y = real coordinates \in [2:N-1,2:M-1]

 z   = smoothed value

 wf 08/2012

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function z=LSM_f_cubic_smoothing(x,y,f)
0002 % spline smoothing
0003 %
0004 % f   = N x M array of function values
0005 % x,y = real coordinates \in [2:N-1,2:M-1]
0006 %
0007 % z   = smoothed value
0008 %
0009 % wf 08/2012
0010 
0011 i=floor(x);
0012 j=floor(y);
0013 u=x-i;
0014 v=y-j;
0015 p=[1 u u^2 u^3]';
0016 q=[1 v v^2 v^3]';
0017 M= 1/6*[ 1  4  1  0;...
0018         -3  0 +3  0;...
0019          3 -6 +3  0;...
0020         -1  3 -3  1];
0021 Fij = [f(i-1,j-1), f(i-1,j), f(i-1,j+1), f(i-1,j+2);...
0022        f(i  ,j-1), f(i  ,j), f(i  ,j+1), f(i  ,j+2);...
0023        f(i+1,j-1), f(i+1,j), f(i+1,j+1), f(i+1,j+2);...
0024        f(i+2,j-1), f(i+2,j), f(i+2,j+1), f(i+2,j+2);...
0025         ];   
0026 z=p'*M*Fij*M'*q;  
0027 end

Generated on Sun 19-Jul-2020 23:00:25 by m2html © 2005