% splInterpolation.m This function perform interpolation over a grid of spl values

function [ ZI ] = splInterpolation( spl, virtualMicNumber, extX, extY, extXI, extYI, surfpoint, sps32type )

Z                       = spl';

    if virtualMicNumber == 122 || ( virtualMicNumber == 32 && sps32type == 1 )
        extZ            = [ Z; Z; Z ];
        ZI              = griddata( extX, extY, extZ, extXI, extYI, 'cubic' );
    else
        extZ            = [ Z; Z; Z; Z; Z; Z; Z; Z; Z ];
        extZI           = griddata( extX, extY, extZ, extXI, extYI, 'cubic' );
        ZI              = extZI( surfpoint/2 + 1 : surfpoint, surfpoint + 1 : 2*surfpoint );
    end

end