NMR and MRI physics · Introductory

How to read a pulse-sequence diagram (RF, gradients, ADC)

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

A pulse-sequence diagram is a timing chart with horizontal rows for the RF channel, the three gradient axes, and the ADC (signal readout). Time runs left to right, and each shape tells you what the scanner hardware does at that moment. Reading it row by row and then vertically lets you predict how the spins are excited, spatially encoded, and sampled.

Intuition

Think of the diagram as a musical score. Each row is an instrument: the RF row plays pulses that tip magnetization, the gradient rows (slice, phase, readout) play ramps that make the magnetic field vary with position, and the ADC row marks when the scanner is listening. Time is shared by all rows, so a vertical slice through the chart tells you everything happening at one instant. Gradients change precession frequency with position, so they label where the signal comes from. The area under a gradient lobe, not just its height, sets how much phase is accumulated. A negative lobe can undo a positive one, which is how echoes are formed.

Key equations

ω(𝐫,t)=γ(B0+𝐆(t)⋅𝐫)
(1)

Larmor frequency varies with position when a gradient G is on.

ϕ(𝐫)=γ𝐫⋅∫𝐆(t)dt
(2)

Accumulated phase is proportional to the gradient area.

Δz=BWRFγGz
(3)

Slice thickness is set by RF bandwidth and slice-select gradient strength (γ in Hz/T).

TE
(4)

Echo time: from the excitation pulse to the center of the echo, where the ADC window is centered.

Derivation

  1. Start with the Larmor relation: with a gradient along x, frequency is f=γ(B0+Gx⋅x), where γ is in Hz per tesla.
  2. A selective RF pulse with bandwidth BW excites only positions whose frequencies lie within BW, so the range of x is BW/(γG). This gives slice thickness.
  3. After excitation, spins at different positions precess at different rates while a gradient is on, so they gain phase φ = γ x ∫G dt.
  4. A dephasing lobe of area −A followed by a readout lobe of area +A returns net phase to zero at the readout midpoint. This forms a gradient echo at the center of the ADC window.
  5. A phase-encode gradient is stepped to a new area each repetition. Each step samples a different line of k-space, with kᵧ = γ∫Gᵧ dt.

Worked example

Problem

A slice-select gradient of 10 mT/m is used with an RF pulse of bandwidth 1.0 kHz. Find the slice thickness. Use γ = 42.58 MHz/T.

  1. Convert gradient to T/m: 10 mT/m = 0.010 T/m.
  2. Compute γG = 42.58×10^6 Hz/T × 0.010 T/m = 4.258×10^5 Hz/m.
  3. Thickness = BW/(γG) = 1000 / 4.258×10^5 m.
  4. This equals 2.35×10^-3 m.

Answer About 2.3 mm

Common mistakes

  • Reading only the height of a gradient lobe and ignoring its area.
  • Forgetting that negative lobes are real gradient reversals, not 'off'.
  • Assuming the RF row shows the signal; the received signal appears only as the ADC window.
  • Confusing TE (excitation to echo center) with the length of the ADC window.
  • Mixing up the axes: slice, phase, and readout are logical roles that can map to any physical x, y, or z.

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(113 lines)
from manim import *
import numpy as np
import sys
from blocks import *
from mri_blocks import *

# ---------- sequence timing (all times in ms) ----------
T_MAX = 10.0
T_RF = 1.0                    # centre of the 90 deg excitation (treated as instantaneous)
GX_PRE = (1.5, 3.5)           # readout prephaser (negative lobe)
GX_RO = (3.5, 7.5)            # readout lobe (positive)
T_ECHO = 5.5                  # gradient areas cancel here: 2 ms * (-G) + 2 ms * (+G) = 0
G = 3.0                       # cycles/ms per unit position
T2 = 30.0                     # ms
DT = 0.05


def simulate_gre():
    """Simulate a 1D gradient echo with isochromats along x; return (times, |signal|)."""
    pos = np.linspace(-1, 1, 41)
    df = np.zeros_like(pos)
    events = []

    def steps(typ, t0, t1, g=0.0):
        n = int(round((t1 - t0) / DT))
        for _ in range(n):
            e = {"type": typ, "dt": DT}
            if typ == "grad":
                e["g"], e["pos"] = g, pos
            events.append(e)

    steps("wait", 0.0, T_RF)
    events.append({"type": "rf", "flip": np.pi / 2})
    steps("wait", T_RF, GX_PRE[0])
    steps("grad", GX_PRE[0], GX_PRE[1], -G)
    steps("grad", GX_RO[0], GX_RO[1], +G)
    steps("wait", GX_RO[1], T_MAX)
    times, hist = bloch_simulate(events, [0, 0, 1], np.inf, T2, df)
    mxy = hist[:, :, 0] + 1j * hist[:, :, 1]
    sig = np.abs(mxy.mean(axis=0))
    return times, sig


def echo_index(times, sig):
    """Index of the signal maximum inside the readout (ADC) window."""
    win = (times > GX_RO[0] + 1e-9) & (times < GX_RO[1] - 1e-9)
    return int(np.argmax(np.where(win, sig, -1.0)))


TIMES, SIG = simulate_gre()


class Main(Scene):
    def construct(self):
        TitleCard(self, "Reading a pulse-sequence diagram", "Gradient echo: RF, gradients, ADC")

        # timing diagram in the upper part
        psd = PulseSequenceDiagram(rows=("RF", "Gz", "Gy", "Gx", "ADC"), t_max=T_MAX,
                                   width=11, height=3.4)
        psd.move_to(UP * 1.0)
        rf = psd.add_rf(0.5, 1.5, kind="sinc")
        gz = VGroup(psd.add_gradient("Gz", 0.4, 1.6, 1.0),
                    psd.add_gradient("Gz", 1.8, 2.6, -0.6))
        gy = psd.add_gradient("Gy", 2.0, 3.0, 0.6, color=C_MAIN)
        gx = VGroup(psd.add_gradient("Gx", *GX_PRE, -0.5, shape="rect"),
                    psd.add_gradient("Gx", *GX_RO, 0.5, shape="rect"))
        adc = psd.add_adc(*GX_RO)
        te_top = psd._pt(T_ECHO, 0) + UP * psd.row_h * 0.45
        te_bot = psd._pt(T_ECHO, 4) + DOWN * psd.row_h * 0.45
        te_line = DashedLine(te_bot, te_top, color=C_DIM)
        te_lab = Text("echo", font_size=24, color=C_DIM).next_to(te_top, UP, buff=0.02).shift(RIGHT * 0.5)

        self.play(FadeIn(psd))
        StepCaption(self, "Rows share one time axis: RF, slice, phase, read, ADC")
        self.play(Create(rf), Create(gz), run_time=1.2)
        self.play(Create(gy), Create(gx), FadeIn(adc), run_time=1.2)
        self.play(Create(te_line), FadeIn(te_lab), run_time=0.6)

        # signal plot aligned to the same time axis
        width = psd._pt(T_MAX, 0)[0] - psd._pt(0, 0)[0]
        sp = SignalPlot(x_range=(0, T_MAX, 1), y_range=(0, 1.1, 0.5), x_label="t (ms)",
                        y_label="|S|", width=width, height=1.5)
        sp.move_to(DOWN * 2.3)
        sp.shift(RIGHT * (psd._pt(0, 0)[0] - sp.axes.c2p(0, 0)[0]))
        self.play(FadeIn(sp), run_time=0.6)

        cursor = psd.time_cursor()
        trace = always_redraw(lambda: sp.plot(
            TIMES[TIMES <= psd.tracker.get_value() + 1e-9],
            SIG[TIMES <= psd.tracker.get_value() + 1e-9]))
        self.add(cursor, trace)

        # sweep time: cursor and simulated signal move together
        StepCaption(self, "RF tips spins; the negative Gx lobe dephases them")
        self.play(psd.cursor_to(GX_PRE[1], rate_func=linear), run_time=3)
        StepCaption(self, "Readout lobe rephases: echo when Gx areas cancel")
        self.play(psd.cursor_to(T_MAX, rate_func=linear), run_time=4)
        k = echo_index(TIMES, SIG)
        self.play(FadeIn(sp.dot_at(TIMES[k], SIG[k])), run_time=0.4)
        StepCaption(self, "Takeaway: read columns as time; the echo sits where lobe areas balance")
        self.wait(1)


if __name__ == "__main__" and "--selftest" in sys.argv:
    assert SIG[0] == 0.0
    i_rf = int(np.argmin(np.abs(TIMES - (T_RF + 0.2))))
    assert abs(SIG[i_rf] - np.exp(-0.2 / T2)) < 1e-3
    k = echo_index(TIMES, SIG)
    assert abs(TIMES[k] - T_ECHO) < 1e-6, TIMES[k]
    assert abs(SIG[k] - np.exp(-(T_ECHO - T_RF) / T2)) < 1e-3
    i_pre = int(np.argmin(np.abs(TIMES - GX_PRE[1])))
    assert SIG[i_pre] < 0.1
    print("selftest 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.