NMO with linear interpolation implies that the matrix is a two-band matrix. Each row has exactly two elements that interpolate between two elements on the input. I will sketch the appearance of the matrix, using the letters a and b for the elements. Each a and b is different numerically, but on a given row, a+b=1.
(21) |
Here the matrix is tridiagonal,
but I am going to let you work out the details by yourself.
The original data can be recovered by solving the tridiagonal system.
This method can be used to program an invertible NMO or
to program an invertible trace interpolation.
I do not want to clutter this book with the many details.
Instead, I present spot1(),
a convenient subroutine for linear interpolation
that can be used in many applications.
# Nearest neighbor interpolation would do this: val = vec( 1.5 + (t-t0)/dt)
# This is the same but with _linear_ interpolation.
#
subroutine spot1( adj, add, nt,t0,dt, t, val, vec )
integer it, itc, adj, add, nt
real tc, fraction, t0,dt, t, val, vec(nt)
call adjnull( adj, add, val, 1, vec,nt)
tc = (t-t0) / dt
itc = tc
it = 1 + itc; fraction = tc - itc
if( 1 <= it && it < nt)
if( adj == 0) { # add value onto vector
vec(it ) = vec(it ) + (1.-fraction) * val
vec(it+1) = vec(it+1) + fraction * val
}
else # take value from vector
val = val + (1.-fraction) * vec(it) + fraction * vec(it+1)
return; end