NMR and MRI physics · Introductory

NMR pulse-acquire experiment: 90 degree pulse, FID, spectrum

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

In a pulse-acquire NMR experiment, a short radiofrequency pulse tips the net magnetization from the z axis into the transverse plane. The magnetization then precesses and decays, inducing an oscillating signal in the coil called the free induction decay (FID). A Fourier transform converts the FID into a spectrum with peaks at the resonance frequencies.

Intuition

At equilibrium in a strong field B0, spins give a small net magnetization M0 along z. This cannot be detected directly because the coil senses only changing flux in the transverse plane. A 90 degree pulse at the Larmor frequency rotates M0 onto the xy plane. There it spins like a tiny bar magnet, inducing a voltage in the coil. Over time the spins lose phase coherence (T2 or T2∗ relaxation) and the signal shrinks, while M slowly regrows along z (T1). The recorded signal is a decaying cosine, or a sum of several. Fourier transform asks which frequencies are present and how much of each. A single decaying oscillation gives one peak, its width set by the decay rate. Faster decay means a broader line. Several chemical environments give several peaks at different offsets, measured in ppm.

Key equations

ω0=γB0
(1)

Larmor frequency: precession rate of spins in field B0, with gyromagnetic ratio γ.

θ=γB1tp
(2)

Flip angle from pulse amplitude B1 and duration tp; a 90 degree pulse has θ=π/2.

S(t)=S0cos⁡(Δωt)e−t/T2∗
(3)

FID in the rotating frame, offset from the reference frequency, decaying with T2*.

Δν1/2=1πT2∗
(4)

Full width at half height of the Lorentzian line after Fourier transform.

δ=ν−νrefνref×106
(5)

Chemical shift in ppm, independent of field strength.

Derivation

  1. Start with M=(0,0,M0) along z at equilibrium.
  2. Apply a B1 field rotating at the Larmor frequency along x in the rotating frame; M precesses about x at rate γB1.
  3. After time tp the angle is γB1tp; choose it to equal 90 degrees so M lies along y.
  4. After the pulse, in the rotating frame M precesses at the offset Δω and the transverse part decays: Mxy(t)=M0e−t/T2∗eiΔωt.
  5. The coil detects Mxy, giving the FID S(t).
  6. Fourier transform: the integral of S(t)e^{-iωt}dt gives a Lorentzian centred at Δω with half-width 1/(πT2*).
  7. Peak area is proportional to the number of nuclei contributing.

Worked example

Problem

A proton FID, on a 400 MHz spectrometer, oscillates at 1200 Hz relative to the reference and decays with T2* = 0.25 s. Find the chemical shift and linewidth.

  1. Chemical shift = 1200 Hz / 400 MHz = 1200/400,000,000 = 3.0e-6, i.e. 3.0 ppm.
  2. Linewidth = 1/(π × 0.25 s) = 1/0.785 = 1.27 Hz.
  3. In ppm the width is 1.27/400 ≈ 0.003 ppm.

Answer Peak at 3.0 ppm with a width of about 1.3 Hz.

Common mistakes

  • Thinking the signal is measured along z; only transverse magnetization is detected.
  • Confusing T2 with T2*: field inhomogeneity makes the observed decay faster than true T2.
  • Believing a 180 degree pulse gives maximum signal; it gives none, while 90 gives the maximum.
  • Saying a longer FID gives a broader line; slow decay gives a narrower line.
  • Forgetting that ppm is field-independent while Hz is not.

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

# ---- parameters (time in ms for the diagram, seconds for physics) ----
T_MAX = 100.0          # ms, diagram length
PULSE_END = 4.0        # ms, 90 degree hard pulse 0..4 ms
F0 = 40.0              # Hz, offset in rotating frame
T2STAR = 0.030         # s
T1 = 0.500             # s
DT = 0.5               # ms, fixed simulation step


def simulate():
    """Fixed-step sim: 90x pulse, then free precession; return times(ms), M history, signal."""
    M = rf_pulse(np.array([0.0, 0.0, 1.0]), np.pi / 2, 0.0)
    ts = np.arange(PULSE_END, T_MAX + 1e-9, DT)
    hist = [M.copy()]
    for _ in ts[1:]:
        M = free_precession(M, DT / 1000.0, T1, T2STAR, F0)
        hist.append(M.copy())
    hist = np.array(hist)
    sig = -hist[:, 1]          # real channel: starts at +1 after the pulse
    return ts, hist, sig


def spectrum(sig):
    """Zero-padded FFT magnitude; return freqs (Hz), normalised magnitude."""
    n = 4096
    S = np.abs(np.fft.rfft(sig, n))
    f = np.fft.rfftfreq(n, DT / 1000.0)
    return f, S / S.max()


class Main(Scene):
    def construct(self):
        TitleCard(self, "NMR pulse-acquire", "90° pulse, FID, spectrum")
        ts, hist, sig = simulate()
        f, S = spectrum(sig)
        f_peak = f[np.argmax(S)]

        # --- timing diagram (upper part) ---
        d = PulseSequenceDiagram(rows=("RF", "ADC"), t_max=T_MAX, width=11, height=2.0)
        d.shift(UP * 1.5)
        rf = d.add_rf(0, PULSE_END, kind="hard", label="90°x")
        adc = d.add_adc(PULSE_END, T_MAX)
        cursor = d.time_cursor()
        self.play(FadeIn(d), FadeIn(rf), FadeIn(adc), run_time=1.0)
        self.add(cursor)

        # --- lower panels: Bloch sphere, FID, spectrum ---
        bs = BlochSphere2D(radius=1.0).move_to([-5.2, -1.5, 0])
        arrow = bs.vector([0, 0, 1])
        fid = SignalPlot(x_range=(0, 100, 20), y_range=(-1, 1, 0.5), x_label="t (ms)",
                         y_label="signal", width=4.0, height=2.0).move_to([-0.6, -1.5, 0])
        spec = SignalPlot(x_range=(0, 100, 20), y_range=(0, 1.1, 0.5), x_label="f (Hz)",
                          y_label="|S(f)|", width=3.0, height=2.0).move_to([4.6, -1.5, 0])
        self.play(FadeIn(bs), FadeIn(arrow), FadeIn(fid), run_time=1.0)

        # --- RF pulse: tip M from z into transverse plane ---
        StepCaption(self, "RF pulse rotates M from z into the transverse plane")
        tip = UpdateFromAlphaFunc(arrow, lambda m, a: bs.update_vector(
            m, rf_pulse(np.array([0.0, 0.0, 1.0]), a * np.pi / 2, 0.0)))
        self.play(tip, d.cursor_to(PULSE_END), run_time=2.0, rate_func=linear)

        # --- acquisition: precession + decay gives the FID ---
        StepCaption(self, "ADC records the precessing, decaying signal: the FID")
        curve = fid.plot(ts, sig)
        follow = UpdateFromAlphaFunc(arrow, lambda m, a: bs.update_vector(
            m, hist[min(int(a * (len(ts) - 1)), len(ts) - 1)]))
        self.play(Create(curve), follow, d.cursor_to(T_MAX), run_time=6.0, rate_func=linear)

        # --- Fourier transform gives the spectrum ---
        StepCaption(self, "Fourier transform of the FID gives the spectrum")
        mask = f <= 100
        line = spec.plot(f[mask], S[mask], color=C_GOOD)
        self.play(FadeIn(spec), Create(line), run_time=2.0)
        lab = Text(f"peak {f_peak:.0f} Hz", font_size=24, color=C_ACCENT)
        lab.next_to(spec.axes.c2p(f_peak, 1.0), UP, buff=0.1)
        self.play(FadeIn(lab), run_time=0.6)
        self.wait(0.8)
        StepCaption(self, "Pulse, then listen: FID frequency is the peak, decay sets its width")
        self.wait(1.5)


if __name__ == "__main__" and "--selftest" in sys.argv:
    ts, hist, sig = simulate()
    assert abs(hist[0][2]) < 1e-9 and abs(np.hypot(hist[0][0], hist[0][1]) - 1) < 1e-9
    assert abs(sig[0] - 1.0) < 1e-9
    ref = fid_signal((ts - PULSE_END) / 1000.0, T2STAR, F0)
    assert np.allclose(sig, ref, atol=1e-9)
    assert hist[-1][2] > 0  # T1 recovery started
    f, S = spectrum(sig)
    assert abs(f[np.argmax(S)] - F0) < 2.0
    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.