NMR and MRI physics · Introductory

RF pulse and flip angle

Written by SignalsLab

Early edition: these lessons are being reviewed.

Content

Summary

A radiofrequency (RF) pulse oscillating at the Larmor frequency tips the net magnetization away from the main field direction. The flip angle measures how far it is tipped, and depends on the strength and duration of the pulse.

Intuition

In a magnet, nuclear spins give a net magnetization M0 along the static field B0 (the z axis). It precesses about B0 at the Larmor frequency. If we apply a small magnetic field B1 that rotates at exactly this frequency, then in a frame rotating with the spins B1 looks static, and M simply precesses around B1, like a compass needle swinging around a new axis. The longer or stronger the pulse, the further M rotates. A 90 degree pulse lays M flat in the transverse plane, where it induces a measurable signal in the receiver coil. A 180 degree pulse inverts M. In the lab frame this motion is a spiral from the z axis down toward the xy plane.

Key equations

ω0=γB0
(1)

Larmor frequency: the RF pulse must be centered here (resonance). For protons γ2π is about 42.58 MHz/T.

α=γ∫0τB1(t)dt
(2)

Flip angle is γ times the area under the B1 envelope.

α=γB1τ
(3)

For a rectangular pulse of constant amplitude B1 and duration tau.

Mz=M0cos⁡α,Mxy=M0sin⁡α
(4)

Longitudinal and transverse magnetization immediately after the pulse (ignoring relaxation).

Derivation

  1. Bloch equation without relaxation: d𝐌dt=γ𝐌×𝐁.
  2. Total field is B0 along z plus B1 rotating in the xy plane at frequency ω.
  3. Move to a frame rotating at ω about z. If ω equals γB0, the apparent z field vanishes.
  4. Only B1 remains, static along x' in the rotating frame.
  5. Then 𝐌 precesses about x′ at angular frequency γB1.
  6. After time τ the rotation angle is α=γB1τ.
  7. Starting from M=M0 along z, the result is Mz=M0cos⁡(α) and My′=M0sin⁡(α) (up to sign convention).

Worked example

Problem

A proton 90∘ rectangular RF pulse lasts 1 ms. What B1 amplitude is needed? Use γ2π=42.58 MHz/T.

  1. Required angle: α=π/2 rad.
  2. gamma = 2pi x 42.58e6 = 2.675e8 rad/s/T.
  3. B1 = alpha/(gamma tau) = 1.571/(2.675e8 x 1e-3).
  4. B1 = 5.87e-6 T.
  5. Check: for 180 degrees, either double B1 or double the duration.

Answer About 5.9 microtesla (roughly 5.9 μT).

Common mistakes

  • Thinking the RF pulse is at an arbitrary frequency; it must match the Larmor frequency (resonance) to tip efficiently.
  • Confusing B1 (tiny RF field) with B0 (tesla-scale static field).
  • Assuming a 90 degree pulse needs a longer pulse regardless of amplitude; only the product of B1 and duration matters.
  • Believing a 180 degree pulse gives maximum signal; it gives none, since transverse magnetization is zero.
  • Forgetting that relaxation (T1, T2) begins right after the pulse.

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


def simulate_flip(alpha_deg, steps=60):
    """
    Simulate rotation of M around X-axis by alpha_deg.
    Returns trajectory as list of 3D vectors.
    """
    alpha = np.deg2rad(alpha_deg)
    M = np.array([0.0, 0.0, 1.0])
    trajectory = [M.copy()]
    cos_a = np.cos(alpha)
    sin_a = np.sin(alpha)
    for _ in range(steps):
        y, z = M[1], M[2]
        M[1] = y * cos_a - z * sin_a
        M[2] = y * sin_a + z * cos_a
        trajectory.append(M.copy())
    return np.array(trajectory)


class Main(Scene):
    def construct(self):
        TitleCard(self, "RF Pulse & Flip Angle", "Rotating Magnetization Vector")

        alpha_deg = 45
        traj = simulate_flip(alpha_deg)

        # --- Left: YZ-plane view (from +X) ---
        center = LEFT * 3.0 + DOWN * 0.5
        R = 2.0

        # Reference circle and axes
        ref_circle = Circle(radius=R, color=C_DIM, stroke_width=1.5).move_to(center)
        y_axis = Line(center + LEFT * R, center + RIGHT * R, color=C_DIM, stroke_width=2)
        z_axis = Line(center + DOWN * R, center + UP * R, color=C_DIM, stroke_width=2)
        y_lab = Text("M_y", font_size=24, color=C_DIM).next_to(y_axis, RIGHT, buff=0.15)
        z_lab = Text("M_z", font_size=24, color=C_DIM).next_to(z_axis, UP, buff=0.15)
        self.play(Create(ref_circle), Create(y_axis), Create(z_axis), FadeIn(y_lab), FadeIn(z_lab))

        # M vector (arrow from center to current pos)
        m_arrow = Arrow(center, center + R * UP, buff=0, color=C_MAIN, stroke_width=6, tip_length=0.25)
        self.add(m_arrow)

        # Tracker for animation
        tracker = ValueTracker(0)

        def get_m_pos():
            angle = tracker.get_value()  # radians from Z toward Y
            vec = np.array([0, np.sin(angle), np.cos(angle)])
            return center + R * vec

        m_dot = always_redraw(lambda: Dot(get_m_pos(), color=C_MAIN, radius=0.12))
        m_line = always_redraw(lambda: Arrow(center, get_m_pos(), buff=0, color=C_MAIN, stroke_width=6, tip_length=0.25))

        # Arc showing the flip angle
        arc = Arc(start_angle=PI / 2, angle=-np.deg2rad(alpha_deg), radius=R, color=C_ACCENT, stroke_width=4)
        arc.shift(center)
        alpha_label = MathTex(r"\alpha", font_size=40, color=C_ACCENT).next_to(
            center + R * 0.55 * np.array([np.sin(np.deg2rad(alpha_deg / 2)), np.cos(np.deg2rad(alpha_deg / 2)), 0]),
            LEFT, buff=0.2
        )

        self.play(Create(arc), FadeIn(alpha_label), run_time=0.8)

        # Animate rotation
        self.play(tracker.animate.set_value(np.deg2rad(alpha_deg)), run_time=3, rate_func=linear)

        # --- Right: Info panel ---
        info_box = Rectangle(width=4.5, height=2.8, color=C_DIM, fill_color=BLACK, fill_opacity=0.8)
        info_box.move_to(RIGHT * 3.5 + UP * 0.3)

        t1 = Text("RF Pulse (B1)", font_size=28, color=C_ACCENT).move_to(info_box.get_center() + UP * 0.9)
        t2 = MathTex(r"\alpha = \gamma B_1 \tau", font_size=32, color=WHITE).next_to(t1, DOWN, buff=0.3)
        t3 = Text("Rotates M around B1 axis", font_size=24, color=WHITE).next_to(t2, DOWN, buff=0.3)
        t4 = Text(f"Flip angle: {alpha_deg}°", font_size=24, color=C_MAIN).next_to(t3, DOWN, buff=0.3)

        self.play(Create(info_box), FadeIn(t1), FadeIn(t2), FadeIn(t3), FadeIn(t4))

        StepCaption(self, "The flip angle alpha determines the new orientation of M.")
        self.wait(1.5)


if __name__ == "__main__" and "--selftest" in sys.argv:
    alpha = 45
    traj = simulate_flip(alpha)
    assert np.allclose(traj[0], [0, 0, 1]), "Start should be (0,0,1)"
    expected_end = np.array([0, np.sin(np.deg2rad(alpha)), np.cos(np.deg2rad(alpha))])
    assert np.allclose(traj[-1], expected_end, atol=1e-5), f"End mismatch: {traj[-1]} vs {expected_end}"
    for m in traj:
        assert abs(np.linalg.norm(m) - 1.0) < 1e-5, "Magnitude should be preserved"
    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.