Algorithmintro
Normal moveout correction
Also called NMO correction.
Map each sample of a trace at offset x from the time t = sqrt(t0^2 + x^2/v^2) back to its zero-offset time t0, so that reflections in a gather become flat.
- Time
- O(m n) worst · average · best
- Space
- O(m n) extra
- Where
- m = the number of traces in the gather; n = the number of samples per trace
- Model
- Real RAM
- Properties
- deterministicexact for one flat layerlinear in dataneeds velocity
- Evidence
- Proof sketchCode in 1 languages
- Origin
- C. Hewitt Dix, 1955
Normal moveout (NMO) correction removes the delay that offset adds to a reflection. In a common-midpoint gather, a flat reflector shows as a hyperbola: the farther the receiver is from the source, the later the echo comes. NMO maps every sample back to the time it would have at zero offset, so that the hyperbola becomes a flat line. It needs a velocity for each time. It is the step before common-midpoint stacking, and semblance velocity analysis is the scan that finds the velocity.
In plain words
A shot sends sound down, a flat layer reflects it, and receivers at the surface record the echo. A receiver far from the shot hears the echo later than a receiver close to the shot, because the path is longer. The extra delay grows with the distance in a known way that depends on the speed of sound in the rock. NMO correction undoes that extra delay on each trace. After it, the same echo arrives at the same time on every trace, and the traces line up. The price is that the far traces get stretched in time, most of all near the top of the record, so very stretched parts are cut away.
The problem
Input: a trace of samples , recorded at the source-receiver offset , and a velocity function in m/s for the zero-offset two-way time . Output: the trace with , where
is the traveltime of the hyperbola through . For one flat layer of constant velocity this hyperbola is the exact reflection time. For flat layers it is a second-order approximation in when is the rms velocity, and in a real earth is the stacking velocity, the velocity that best flattens the event. A gather of traces is corrected trace by trace, each with its own .
The algorithm
NMO(d, Δt, x, v, s_max) ▷ s_max = stretch limit, or none- 1
for j ← 0 to n - 1 do - 2
t_0 ← j Δt - 3
t ← sqrt(t_0² + x² / v(t_0)²) ▷ input time on the hyperbola - 4
if s_max given and t - t_0 > s_max t_0 then u_j ← 0; continue ▷ stretch mute - 5
u_j ← linear interpolation of d at time t ▷ 0 past the record end - 6
return u
The loop runs over output samples, not input samples. Each output time reads the input at a later time , so the trace is pulled up toward smaller times, by more at small and at large . Because is rarely a sample time, line L5 interpolates; linear interpolation is the cheapest choice, and sinc or spline interpolation is more accurate. Line L4 is the stretch mute: it sets to zero the samples whose relative stretch is above the limit. A common limit is between 0.2 and 0.5; it is a processing choice.
Example
The check value. With s, m and m/s, line L3 gives s. The output sample at 1 s takes the input value at 1.11803 s, a moveout of 118 ms.
A spike that moves exactly. Take ms and a trace at m with one spike of amplitude 1 at sample 125 (0.5 s), and m/s. The output sample has s and s, which is sample 125, so the interpolation weight is zero and exactly. The neighbors and read times between samples 124 and 126 and pick up a part of the spike; all other output samples are zero. The spike moved up by 200 ms.
The stretch. For m and m/s, the stretch factor and the relative stretch are:
| (s) | (s) | ||
|---|---|---|---|
| 0.2 | 0.5385 | 2.693 | 1.693 |
| 0.5 | 0.7071 | 1.414 | 0.414 |
| 1.0 | 1.1180 | 1.118 | 0.118 |
| 2.0 | 2.0616 | 1.031 | 0.031 |
A 30 Hz wavelet at s comes out with a dominant frequency near Hz. With a stretch limit of 0.3, line L4 mutes the samples of this trace with below about 0.6 s and keeps the later ones.
Two layers. A layer 400 m thick with 2000 m/s lies over a layer 600 m thick with 3000 m/s. Each layer takes 0.4 s of two-way time, so s and the rms velocity is m/s. Exact ray tracing through the two layers against the hyperbola with gives:
| (m) | exact (s) | hyperbola (s) | difference (ms) |
|---|---|---|---|
| 500 | 0.82364 | 0.82369 | -0.05 |
| 1000 | 0.89024 | 0.89098 | -0.74 |
| 2000 | 1.11199 | 1.12044 | -8.45 |
At small offsets the hyperbola is very close. At 2000 m it is 8 ms late, a quarter of a period at 30 Hz, and the event is no longer flat after NMO. This is the residual moveout of the next sections.
Correctness
For one flat layer the reflection time is by Pythagoras. The map is strictly increasing, so an event on the hyperbola through comes out with its peak at on every trace: the event is flat. Near the output is the input stretched by , because . Linear interpolation adds an error of at most . For flat layers, the ray parameter gives with the rms velocity , and the term is negative unless all layer velocities are equal. The proofs are in proofs/correctness.md.
Proof: NMO correction moves a hyperbolic event to its zero-offset time, stretches it by t/t0, and the hyperbola is exact for one layer and second-order accurate for flat layersfull
Setting. A trace is recorded at offset and sampled at , . Times are two-way times. The velocity is given for each output time . NMO (lines L1 to L6) sets the output sample to , where and is the linear interpolant of the samples, or to when line L4 mutes it. We write for a constant .
Claim 1 (one flat layer). Let a flat reflector lie at depth under a layer of constant velocity , with the source and the receiver on the surface at offset , symmetric about the midpoint. Then the reflection time is with .
Proof. By the law of reflection at a flat interface, the ray goes from the source to the point under the midpoint and back up. Each leg is the hypotenuse of a right triangle with sides and , so the path length is . Dividing by gives .
Claim 2 (an event is moved to ). Let the trace hold one event with a wavelet that peaks at , at the time of the hyperbola through the zero-offset time , and let the velocity used in line L3 equal the of the event. Without the interpolation error and the mute, the output is , and it peaks at for every offset .
Proof. Lines L2 and L3 compute , and line L5 reads the input at that time, so . The map is strictly increasing on , because for . So only at , and takes the peak value there. The argument holds for each , so all traces of the gather have the event at the same time : the event is flat after the correction.
Claim 3 (the stretch). Near , the output is the input wavelet stretched in time by the factor . For small offsets, the relative stretch is .
Proof. By Claim 2, , and with . So an output interval reads an input interval , and a feature of length in the input has length in the output. Its dominant frequency falls by the factor . The expansion with gives the small-offset form. Line L4 sets to the samples with above the chosen limit; this is a choice of the user, not part of the correction. For and the stretch is infinite, so line L4 always mutes that sample when a limit is given.
Claim 4 (interpolation error). If has a continuous second derivative, the output differs from the exact value by at most . If falls on a sample time, the output is exact.
Proof. Line L5 evaluates the linear interpolant between the two samples around . The standard error formula of linear interpolation on an interval of length gives . At a sample time the weight in the code is , and the interpolant returns the sample.
Claim 5 (flat layers: the hyperbola is a second-order approximation). Let there be flat layers with velocities and two-way vertical times , with and the rms velocity . Then the exact reflection time from the bottom of layer satisfies . It equals the hyperbola for all only when all are equal.
Proof. Let be the ray parameter, constant along the ray by Snell's law, and , the cosine of the angle in layer . In layer the ray travels the vertical distance down and again up; it covers the horizontal distance and spends the time on each leg. Summing both legs gives
With this is and . So and , which gives . Since is proportional to for small , . If all , then and the stack of layers is one layer, so Claim 1 gives equality. If the differ, take one more term: gives , where . By the Cauchy-Schwarz inequality when the are not all equal, so the term is not zero, and the true time is earlier than the hyperbola at moderate offsets.
Claim 6 (cost). One trace of samples costs operations: lines L2 to L5 do a fixed amount of work for each . A gather of traces costs , and the extra space is the output samples per trace.
Complexity
Each output sample costs a square root, a test and an interpolation, so a trace costs and a gather of traces costs in the real-RAM model. The output needs space per trace. A sinc interpolator of length raises the cost to .
Properties
- Linear in the data: the correction of a sum of traces is the sum of the corrections.
- Not invertible in general: the stretch mute throws samples away, and at the top of a far trace many input samples map into few output samples.
- Exact for one flat layer of constant velocity. For flat layers it is a second-order approximation in offset (a theorem, Claim 5 of the proof). For one dipping layer of constant velocity the best fitting velocity is with the dip , so a dipping event and a flat event at the same time need different velocities; the correction for dip is a separate step (dip moveout).
- The stretch is , largest at shallow times and far offsets.
Variants and improvements
- Higher-order moveout: add a term in to the hyperbola, as in the series of Taner and Koehler, to correct far offsets in layered media.
- Anisotropic moveout: a nonhyperbolic term with an anellipticity parameter for transversely isotropic layers.
- Stretch-free NMO: methods that shift whole wavelets instead of single samples, to avoid the loss of frequency at far offsets.
- Inverse NMO: put the hyperbolic moveout back, for example after a parabolic Radon transform removed the multiples.
When to use it
Use it on common-midpoint gathers before stacking and before velocity analysis by stacking, when the reflectors are close to flat and the velocity changes mainly with depth. For strong dips or strong lateral velocity changes, prestack seismic migration replaces NMO and stacking.
Pitfalls
- A wrong velocity leaves residual moveout: too low a velocity over-corrects (the event curves up at far offsets), too high a velocity under-corrects.
- Without a stretch mute, the shallow far-offset part of the stack is dominated by stretched, low-frequency noise. The mute limit is a heuristic choice.
- Multiples have a lower stacking velocity than primaries at the same time. After NMO with the primary velocity they remain curved; this difference is what the parabolic Radon transform uses.
- Linear interpolation of a signal close to the Nyquist frequency smooths it. Use a longer interpolator for high-frequency data.
- The velocity of NMO is the stacking velocity, not the interval velocity of a layer. The Dix formula converts rms velocities to interval velocities.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/normal-moveout-correction/. The authors are listed in prov/3TP2T7.jsonl.
"""Normal moveout (NMO) correction of the traces of a common-midpoint gather.
A trace is a list of samples d[k] at the two-way times k * dt, k = 0..n-1.
The offset x is in m and the velocity in m/s. The output sample j at the
zero-offset time t0 = j * dt takes the input value at the time
t = sqrt(t0^2 + x^2 / v(t0)^2), found by linear interpolation.
"""
import math
def nmo_time(t0, x, v):
"""The hyperbolic traveltime t = sqrt(t0^2 + x^2 / v^2)."""
return math.sqrt(t0 * t0 + (x / v) ** 2)
def stretch_factor(t0, x, v):
"""The NMO stretch t / t0 for a constant velocity: an interval dt at time t becomes (t / t0) dt."""
return nmo_time(t0, x, v) / t0
def interp_linear(trace, dt, t):
"""Linear interpolation of the trace at time t; 0 outside [0, (n - 1) dt]."""
n = len(trace)
u = t / dt
if u < 0.0 or u > n - 1:
return 0.0
k = min(int(math.floor(u)), n - 2) if n > 1 else 0
if n == 1:
return trace[0] if u == 0.0 else 0.0
f = u - k
return (1.0 - f) * trace[k] + f * trace[k + 1]
def _velocity_at(vel, j):
return vel[j] if isinstance(vel, (list, tuple)) else vel
def nmo_correct(trace, dt, x, vel, stretch_max=None):
"""NMO-correct one trace recorded at offset x.
vel is a constant or a list with v(t0) for every output sample. If
stretch_max is given, output samples with (t - t0) / t0 > stretch_max are
muted (set to 0), and so is t0 = 0 for x != 0. Returns (out, live), where
live[j] is 1 for a sample that was not muted and 0 otherwise.
"""
n = len(trace)
out = [0.0] * n
live = [0] * n
for j in range(n): # @line L1
t0 = j * dt # @line L2
t = nmo_time(t0, x, _velocity_at(vel, j)) # @line L3
if stretch_max is not None and (t - t0) > stretch_max * t0: # @line L4
continue
out[j] = interp_linear(trace, dt, t) # @line L5
live[j] = 1
return out, live # @line L6
def nmo_gather(gather, offsets, dt, vel, stretch_max=None):
"""NMO-correct every trace of a gather. Returns the list of corrected traces."""
return [nmo_correct(tr, dt, x, vel, stretch_max)[0] for tr, x in zip(gather, offsets)]
def one_layer_traveltime(z, x, v):
"""The exact two-way time from a flat reflector at depth z under a constant velocity v.
The source and the receiver are at the surface, x apart, and the ray
reflects halfway between them (image-source construction).
"""
return 2.0 * math.sqrt(z * z + (x / 2.0) ** 2) / v
test_normal_moveout_correction.py 143 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/normal-moveout-correction/. The authors are listed in prov/3TP2T7.jsonl.
import math
import random
from normal_moveout_correction import (
interp_linear,
nmo_correct,
nmo_gather,
nmo_time,
one_layer_traveltime,
stretch_factor,
)
def ricker(t, f):
a = (math.pi * f * t) ** 2
return (1.0 - 2.0 * a) * math.exp(-a)
def synthetic_gather(t0s, vels, amps, offsets, dt, n, f=25.0):
"""Hyperbolic events t = sqrt(t0^2 + x^2 / v^2) with a Ricker wavelet of peak frequency f."""
gather = []
for x in offsets:
tr = [0.0] * n
for t0, v, a in zip(t0s, vels, amps):
tx = nmo_time(t0, x, v)
for k in range(n):
tr[k] += a * ricker(k * dt - tx, f)
gather.append(tr)
return gather
def argmax(v):
return max(range(len(v)), key=lambda i: v[i])
def test_check_value():
assert abs(nmo_time(1.0, 1000.0, 2000.0) - 1.118034) < 1e-6
def test_hyperbola_is_exact_for_one_flat_layer():
rng = random.Random(1)
for _ in range(50):
z = rng.uniform(100.0, 3000.0)
v = rng.uniform(1500.0, 5000.0)
x = rng.uniform(0.0, 4000.0)
t0 = 2.0 * z / v
assert abs(one_layer_traveltime(z, x, v) - nmo_time(t0, x, v)) < 1e-12
def test_zero_offset_is_the_identity():
rng = random.Random(2)
tr = [rng.gauss(0.0, 1.0) for _ in range(100)]
out, live = nmo_correct(tr, 0.004, 0.0, 2000.0)
assert out == tr
assert live == [1] * 100
def test_pythagorean_triple_moves_a_spike_exactly():
# t0 = 0.3 s and x / v = 0.4 s give t = 0.5 s: sample 125 moves to sample 75.
dt = 0.004
tr = [0.0] * 200
tr[125] = 1.0
out, _ = nmo_correct(tr, dt, 800.0, 2000.0)
assert abs(out[75] - 1.0) < 1e-9
assert all(abs(out[j]) < 1e-9 for j in range(200) if j not in (74, 75, 76))
def test_linear_interpolation():
tr = [0.0, 2.0, 4.0, 1.0]
assert interp_linear(tr, 0.5, 0.25) == 1.0
assert interp_linear(tr, 0.5, 1.5) == 1.0
assert interp_linear(tr, 0.5, 1.25) == 2.5
assert interp_linear(tr, 0.5, -0.1) == 0.0
assert interp_linear(tr, 0.5, 1.6) == 0.0
def test_correct_velocity_flattens_the_event():
dt, n = 0.004, 300
offsets = [100.0 * i for i in range(13)]
gather = synthetic_gather([0.6], [2200.0], [1.0], offsets, dt, n)
flat = nmo_gather(gather, offsets, dt, 2200.0)
peaks = [argmax(tr) for tr in flat]
assert all(p == 150 for p in peaks)
wrong = nmo_gather(gather, offsets, dt, 1800.0)
assert argmax(wrong[-1]) < 150 - 5
def test_time_varying_velocity_flattens_two_events():
dt, n = 0.004, 400
offsets = [150.0 * i for i in range(11)]
gather = synthetic_gather([0.5, 1.2], [1800.0, 2600.0], [1.0, -0.8], offsets, dt, n)
vel = [1800.0 + (2600.0 - 1800.0) * min(1.0, max(0.0, (j * dt - 0.6) / 0.5)) for j in range(n)]
flat = nmo_gather(gather, offsets, dt, vel)
for tr in flat:
assert argmax([abs(v) for v in tr[100:150]]) + 100 == 125
assert argmax([-v for v in tr[275:325]]) + 275 == 300
def test_stretch_factor_matches_the_mapping():
t0, x, v, h = 0.4, 1500.0, 2000.0, 1e-6
t_a = nmo_time(t0, x, v)
t_b = nmo_time(t0 + h, x, v)
# An output interval h comes from an input interval t_b - t_a = h t0 / t.
assert abs((t_b - t_a) / h - t0 / t_a) < 1e-5
assert abs(stretch_factor(t0, x, v) - t_a / t0) < 1e-15
def test_stretch_mute():
dt, n = 0.004, 250
tr = [1.0] * n
x, v, smax = 1000.0, 2000.0, 0.3
out, live = nmo_correct(tr, dt, x, v, stretch_max=smax)
for j in range(n):
t0 = j * dt
t = nmo_time(t0, x, v)
if (t - t0) > smax * t0:
assert live[j] == 0 and out[j] == 0.0
else:
assert live[j] == 1
assert live[0] == 0
assert live[-1] == 1
def test_two_layers_hyperbola_is_only_approximate():
# Exact rays through two flat layers against the hyperbola with the rms velocity.
h = [400.0, 600.0]
v = [2000.0, 3000.0]
dts = [2.0 * hk / vk for hk, vk in zip(h, v)]
t0 = sum(dts)
vrms = math.sqrt(sum(d * vk * vk for d, vk in zip(dts, v)) / t0)
errors = []
for k in range(1, 40):
p = k * 0.0003 / 40.0 * 1.0
c = [math.sqrt(1.0 - (p * vk) ** 2) for vk in v]
x = sum(d * p * vk * vk / ck for d, vk, ck in zip(dts, v, c))
t = sum(d / ck for d, ck in zip(dts, c))
errors.append((x, abs(t - nmo_time(t0, x, vrms))))
small = [e for x, e in errors if x < 300.0]
assert small and max(small) < 1e-5
assert max(e for _, e in errors) > 1e-4
History
The hyperbola of a flat reflector follows from the geometry of one layer. Dix (1955) showed that for flat layers and small offsets the reflection time fits a hyperbola whose velocity is the rms velocity of the layers above, and used it to get interval velocities. Mayne (1962) described common-depth-point stacking, in which every trace is NMO-corrected and then summed. Taner and Koehler (1969) wrote the squared reflection time as a series in the squared offset and made the scan over velocities a routine computer step.
References
- Oz Yilmaz, Seismic Data Analysis, Society of Exploration Geophysicists, 2001, Investigations in Geophysics 10, the chapter on velocity analysis and statics corrections (normal moveout, NMO stretch and the stretch mute)
- C. Hewitt Dix, Seismic velocities from surface measurements, Geophysics 20(1), 1955, 68 to 86, the hyperbolic approximation of the reflection time for flat layers and its velocity
- M. Turhan Taner and Fulton Koehler, Velocity spectra, digital computer derivation and applications of velocity functions, Geophysics 34(6), 1969, 859 to 881, the series of the squared reflection time in powers of the squared offset, whose second coefficient is the rms velocity
- Peter M. Shearer, Introduction to Seismology, 2nd edition, Cambridge University Press, 2009, Chapter 7 (reflection seismology)
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 3TP2T7 Edit this page History Report an error Markdown