NMR and MRI physics · Introductory

Larmor precession of spins in B0

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

A magnetic moment with angular momentum placed in a static magnetic field B0 does not simply align with the field. It precesses around B0 at the Larmor frequency, which is proportional to field strength. This frequency is the resonance frequency that MRI and NMR use to excite and detect signal.

Intuition

Think of a spinning top tilted away from vertical. Gravity tries to topple it, but because it spins, it instead circles around the vertical axis. A nuclear spin behaves similarly: the field B0 exerts a torque on the magnetic moment, but because the moment is tied to angular momentum, the result is a sideways motion, a circling at a fixed angle around B0. The stronger the field, the faster the circling. The gyromagnetic ratio is a property of the nucleus that sets the proportionality. For hydrogen in a 1.5 T scanner the circling is about 64 million times per second, which is in the radiofrequency range. The angle with B0 stays constant without relaxation, so the longitudinal component is fixed and the transverse component rotates, and a rotating transverse magnetization is what induces a signal in a receiver coil.

Key equations

dμ→dt=γμ→×B→0
(1)

Torque on the magnetic moment equals the rate of change of its angular momentum, giving precession.

ω0=γB0
(2)

Larmor angular frequency in rad/s.

f0=γ2πB0
(3)

Larmor frequency in Hz; for 1H, γ2π is about 42.58 MHz/T.

Derivation

  1. Take B0 along z. The moment μ has angular momentum J with μ=γJ.
  2. Torque equals dJ/dt = mu x B0, so dmu/dt = gamma mu x B0.
  3. Write components: dμxdt=γB0μy, dμydt=−γB0μx, dμzdt=0.
  4. Differentiate again: d2μxdt2=−(γB0)2μx, a harmonic oscillator.
  5. Solution: μx=μ⊥cos⁡(ω0t+ϕ), μy=−μ⊥sin⁡(ω0t+ϕ), with ω0=γB0.
  6. So μz is constant and the transverse part rotates clockwise viewed from +z, at ω0.

Worked example

Problem

Find the Larmor frequency of hydrogen protons in a 3.0 T scanner, and compare with 1.5 T.

  1. Use f0=γ2πB0 with γ2π=42.58 MHz/T.
  2. At 3.0 T: f0 = 42.58 x 3.0 = 127.7 MHz.
  3. At 1.5 T: f0 = 42.58 x 1.5 = 63.9 MHz.
  4. Ratio is 2, since f0 is proportional to B0.

Answer About 127.7 MHz at 3 T, twice the 63.9 MHz at 1.5 T.

Common mistakes

  • Thinking spins simply align like compass needles and stop; they precess.
  • Confusing angular frequency ω (rad/s) with frequency f (Hz) and forgetting the factor 2π.
  • Believing precession frequency depends on the tilt angle; it depends only on γ and B0.
  • Assuming the Larmor frequency is the same for all nuclei; γ differs, e.g. 13C is about a quarter of 1H.
  • Confusing precession with spin itself; precession is the motion of the moment's axis.

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

GAMMA = 2 * np.pi * 42.58  # rad/s/T (proton, gamma/2pi = 42.58 MHz/T)


def simulate(B0=1.0, steps=120, dt=0.002, M0=(1.0, 0.0, 0.5)):
    """Rotate M about z with fixed-step exact rotation by omega*dt; record states."""
    omega = GAMMA * B0 / 1e6 * 1e3  # scaled to a slow visual rate (rad per unit time)
    states = [np.array(M0, dtype=float)]
    for _ in range(steps):
        x, y, z = states[-1]
        a = omega * dt
        states.append(np.array([x * np.cos(a) - y * np.sin(a),
                                x * np.sin(a) + y * np.cos(a), z]))
    return omega, states


class Main(Scene):
    def construct(self):
        TitleCard(self, "Larmor precession", "spin in a static field B0")
        omega, states = simulate()
        # top-down view of the transverse plane (Mx, My)
        R = 2.0
        circle = Circle(radius=R, color=C_DIM).shift(LEFT * 3 + DOWN * 0.3)
        c = circle.get_center()
        xax = Line(c + LEFT * R, c + RIGHT * R, color=C_DIM)
        yax = Line(c + DOWN * R, c + UP * R, color=C_DIM)
        lx = Text("Mx", font_size=24).next_to(xax, RIGHT, buff=0.1)
        ly = Text("My", font_size=24).next_to(yax, UP, buff=0.1)
        self.play(Create(circle), Create(xax), Create(yax), FadeIn(lx), FadeIn(ly))
        pts = [c + R * np.array([s[0], s[1], 0]) for s in states]
        tracker = ValueTracker(0)

        def pos():
            k = tracker.get_value()
            i = int(min(k, len(pts) - 2))
            f = k - i
            return pts[i] * (1 - f) + pts[i + 1] * f

        arrow = always_redraw(lambda: Arrow(c, pos(), buff=0, color=C_ACCENT,
                                            stroke_width=6))
        trail = TracedPath(pos, stroke_color=C_MAIN, stroke_width=3)
        eq = MathTex(r"\omega_0=\gamma B_0", font_size=44).move_to(RIGHT * 3.5 + UP * 1.5)
        note = Text("B0 along z", font_size=26, color=C_MAIN).next_to(eq, DOWN, buff=0.4)
        self.add(trail)
        self.play(FadeIn(arrow), Write(eq), FadeIn(note))
        self.play(tracker.animate.set_value(len(pts) - 1), run_time=8, rate_func=linear)
        StepCaption(self, "Spins precess about B0 at the Larmor frequency, proportional to B0.")
        self.wait(1.5)


if __name__ == "__main__" and "--selftest" in sys.argv:
    om, st = simulate()
    assert np.allclose(st[0], [1, 0, 0.5])
    for s in st:
        assert abs(np.hypot(s[0], s[1]) - 1.0) < 1e-9
        assert abs(s[2] - 0.5) < 1e-12
    om2, _ = simulate(B0=2.0)
    assert abs(om2 / om - 2) < 1e-9
    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.