NMR and MRI physics · Intermediate

Gradient echo formation

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

A gradient echo is formed when a magnetic field gradient first dephases transverse magnetization and then a gradient of opposite polarity rephases it, producing a signal peak without any 180-degree pulse. Because static field inhomogeneities are not refocused, the echo amplitude decays with T2* rather than T2.

Intuition

After a excitation pulse, spins in the transverse plane precess at slightly different frequencies depending on position. A negative gradient lobe makes spins at different positions accumulate different phases, so they fan out and the net signal collapses toward zero. Reversing the gradient makes each spin unwind the phase it gained. When the area of the positive lobe equals the area of the negative lobe, all spins line up again and the signal peaks: this is the echo. Think of runners given different speeds for a time, then the speeds are reversed in sign; they all return to the start together. However, runners also have random speed differences from local field inhomogeneity that the gradient reversal does not reverse, so the peak is smaller than the original signal, scaled by exp(-TE/T2*). In a simulation, you can watch a fan of arrows spread, then reconverge, while the signal trace dips and then peaks at TE.

Key equations

ϕ(x,t)=γx∫0tG(t′)dt′
(1)

Phase accumulated by a spin at position x under gradient G(t); γ is the gyromagnetic ratio.

∫0TEG(t)dt=0
(2)

Echo condition: net gradient area is zero, so gradient-induced phase vanishes at the echo time.

S(TE)=S0e−TE/T2∗
(3)

Gradient echo amplitude decays with T2*.

1T2∗=1T2+γΔB0
(4)

T2* combines intrinsic T2 relaxation with dephasing from field inhomogeneity (ΔB0 as an effective spread in field, in tesla).

Derivation

  1. Start with transverse magnetization M_xy created by an RF pulse, all spins in phase at t=0.
  2. Apply a gradient G(t). Larmor frequency becomes ω(x,t)=γ(B0+G(t)x).
  3. Phase relative to the rotating frame is ϕ(x,t)=γx∫G.
  4. Total signal is the sum over x of rho(x)exp(i phi(x,t)); with a large phase spread the contributions cancel.
  5. Apply a first lobe of area -A: phase spread grows and the signal falls.
  6. Apply a second lobe of opposite sign: phase decreases linearly in time.
  7. When the integral of G equals zero, phi=0 for all x and the signal is maximal: the echo at TE.
  8. Static B0 inhomogeneity adds phase γΔB(x)t that is not cancelled, so amplitude is multiplied by exp⁡(−TE/T2∗).

Worked example

Problem

A gradient echo sequence uses a dephasing lobe of −4 mT/m for 1 ms. The readout gradient is +4 mT/m. When does the echo center occur after the start of the readout, and how much signal remains if TE=20 ms, T2∗=40 ms and S0=1?

  1. Dephasing area = -4 mT/m × 1 ms = -4 mT·ms/m.
  2. Echo occurs when the readout area cancels this: 4 mT/m × t = 4 mT·ms/m.
  3. So t = 1 ms after the readout begins.
  4. Signal = exp(-20/40) = exp(-0.5) ≈ 0.61.

Answer The echo peaks 1 ms into the readout, with about 61% of S0 remaining.

Common mistakes

  • Thinking the gradient reversal refocuses all dephasing; it only refocuses gradient-induced phase, not field inhomogeneity or susceptibility effects.
  • Confusing T2 with T2*: gradient echoes decay with T2*, spin echoes with T2.
  • Assuming the echo forms when the second lobe ends rather than when the areas cancel.
  • Believing a gradient echo needs a 180-degree pulse.
  • Using lobes of equal polarity, which only increases dephasing.

Animation

Animation coming soon

The animated version of this lesson is being prepared for the web. In the Signals AI app, lessons are drawn step by step.

Code

scene.py(82 lines)
import sys
from manim import *
from blocks import *

# Simulation: spin isochromats dephase under a gradient, rephase after polarity reversal
N = 9
G = 1.0          # gradient strength (rad per unit time per unit position)
T1 = 2.0         # dephasing duration
POS = np.linspace(-1, 1, N)
DT = 0.1


def simulate():
    """Return times, phases per isochromat, and net signal magnitude (fixed step)."""
    steps = int(round(2 * T1 / DT))
    times, phases, signal = [0.0], [np.zeros(N)], [1.0]
    ph = np.zeros(N)
    for k in range(steps):
        t = k * DT
        g = -G if t < T1 else G   # first lobe negative, second lobe positive
        ph = ph + g * POS * DT * (-1) * 1.5
        times.append((k + 1) * DT)
        phases.append(ph.copy())
        signal.append(abs(np.mean(np.exp(1j * ph))))
    return np.array(times), np.array(phases), np.array(signal)


TIMES, PHASES, SIGNAL = simulate()


class Main(Scene):
    def construct(self):
        self.camera.background_color = "#101418"
        TitleCard(self, "Gradient echo", "Dephase, then rephase")
        # circle with isochromat arrows on the left
        circ = Circle(radius=1.5, color=C_DIM).move_to(LEFT * 3.8 + UP * 0.2)
        self.play(Create(circ))
        cols = color_gradient([C_BAD, C_ACCENT, C_GOOD, C_MAIN], N)

        def arrows(ph):
            return VGroup(*[
                Arrow(circ.get_center(),
                      circ.get_center() + 1.4 * np.array([np.cos(p), np.sin(p), 0]),
                      buff=0, color=cols[i], stroke_width=4,
                      max_tip_length_to_length_ratio=0.25)
                for i, p in enumerate(ph)])

        arr = arrows(PHASES[0])
        # signal plot on the right
        plot = Axes(x_range=[0, 4, 1], y_range=[0, 1.1, 0.5], x_length=5.5,
                    y_length=3.2, axis_config={"color": C_DIM, "include_tip": False})
        plot.move_to(RIGHT * 3.0 + UP * 0.2)
        lab = Text("|signal| vs time", font_size=24).next_to(plot, UP, buff=0.2)
        self.play(FadeIn(arr), Create(plot), FadeIn(lab))
        StepCaption(self, "Gradient lobe 1: spins precess at different rates")
        idx = [0, len(TIMES) // 2, len(TIMES) - 1]
        # animate recorded states in chunks
        n = len(TIMES)
        prev = 0
        for stage, cap in [(n // 2, None), (n - 1, "Reversed gradient: phases unwind, echo forms")]:
            if cap:
                StepCaption(self, cap)
            for k in range(prev + 2, stage + 1, 2):
                new = arrows(PHASES[k])
                seg = plot.plot_line_graph(TIMES[prev:k + 1][::1], SIGNAL[prev:k + 1],
                                           add_vertex_dots=False, line_color=C_ACCENT)
                self.play(Transform(arr, new), Create(seg["line_graph"]),
                          run_time=0.25, rate_func=linear)
                prev = k
        echo = Dot(plot.c2p(TIMES[-1], SIGNAL[-1]), color=C_GOOD)
        self.play(FadeIn(echo))
        StepCaption(self, "Echo peaks when gradient areas cancel")
        self.wait(1)


if __name__ == "__main__" and "--selftest" in sys.argv:
    assert abs(SIGNAL[0] - 1.0) < 1e-9
    mid = int(round(T1 / DT))
    assert SIGNAL[mid] < 0.5 * SIGNAL[0]
    assert abs(SIGNAL[-1] - 1.0) < 1e-9
    assert np.argmax(SIGNAL[mid:]) + mid == len(SIGNAL) - 1
    print("ok")

The Manim scene code that draws this lesson's animation in the Signals AI app (Python, Manim Community).

ccBYNC© 2026 SignalsLab. Lesson text shared as is under CC BY-NC 4.0.