---
title: "How a gradient turns position into frequency"
description: "A field that grows with position makes water precess at a different frequency everywhere. Derive the Fourier signal, field of view, pixel size and folding."
canonical_url: "https://sandboxphysics.com/stories/mri-spatial-encoding/gradients-make-position-into-frequency/"
language: "en"
page_type: "story"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/stories/mri-spatial-encoding/gradients-make-position-into-frequency/"
last_modified: "2026-10-29"
---

[MRI spatial encoding](https://sandboxphysics.com/stories/mri-spatial-encoding/)

L2 · Chapter 3

# How a gradient turns position into frequency

Sandbox Physics · 2026-10-29

In a uniform field the coil can only tell us how much water the sample holds, not where it is. Make the field grow linearly along $x$ and the water at each position precesses at its own frequency, like a row of strings tuned to different pitches sounding at once. This chapter derives the relation between the coil signal and the distribution of water, which turns out to be a Fourier transform. From the sampling interval it then finds the field of view and the pixel width, and explains what goes wrong when the gradient is reversed, the sampling is too slow or the signal decays too fast.

## Before you begin

The Larmor frequency and the T2\* decay from Chapters 1 and 2. This chapter uses complex numbers and the Fourier transform for the first time; the second section introduces what is needed from scratch.

- Write how the precession frequency changes with position in a gradient, and compute the frequency difference per millimetre.
- Derive from the phase integral that the coil signal is the Fourier transform of the water distribution, and define k.
- Compute the field of view and the pixel from the receiver bandwidth, the gradient and the number of samples, and predict where folding and mirroring put an object.

## A gradient makes the field depend on position

On top of $B_0$ add a gradient field so that the $z$ field changes linearly along $x$ with slope $G_x$, measured in mT/m. The MIT handout writes the two-dimensional case as $B_z=B_0+xG_x+yG_y$. The added field is far smaller than $B_0$: a 5 mT/m gradient adds only 0.5 mT at 10 cm.

The precession frequency is proportional to the field, so every position has its own frequency. Remove the part $\gamma B_0$ that all positions share and the remaining offset is proportional to position. Measure the frequency of a signal component and you know where it came from.

$$
\Delta f(x)=\bar\gamma\,G_x\,x,\qquad \bar\gamma=\frac{\gamma}{2\pi}=42.576\,\mathrm{MHz/T}
$$

The offset from $f_0$. At 5 mT/m each millimetre is worth 212.9 Hz.

A gradient makes the field, and so the precession frequency, rise along $x$. Water at each position sounds its own tone, $\Delta f=\bar\gamma G_x x$: 212.9 Hz per millimetre at 5 mT/m. Original schematic, not to scale.

Source: MIT 6.3000 Signal Processing · J. Hrabe

## The coil signal is a Fourier transform

First a little about complex numbers. Draw the transverse magnetization as an arrow in a plane and describe it by one complex number: the real part is the $x$ component, the imaginary part the $y$ component. A unit arrow turned through $\varphi$ is $e^{-i\varphi}=\cos\varphi-i\sin\varphi$. The receiver measures with two channels 90° apart and so records exactly the real and imaginary parts of this number.

The phase of the water at $x$ at time $t$ is the time integral of its frequency. The coil adds the arrows of all positions, weighted by the water density $\rho(x)$. With the common $\gamma B_0t$ removed, the MIT handout arrives at the result below: the signal is the Fourier transform of $\rho(x)$ under a new name, $k$.

$k$ is $\bar\gamma$ times the time integral of the gradient. Its unit is 1/m and it is called the spatial frequency. How long and how strongly the gradient has been on decides which spatial frequency is measured at that moment.

$$
s(t)=\int\rho(x)\,e^{-i2\pi k(t)\,x}\,dx,\qquad k(t)=\bar\gamma\int_0^t G_x(\tau)\,d\tau
$$

Relaxation and noise are left out for now. The sign convention is that of the MIT handout.

$$
\rho(x_p)\approx\Delta k\sum_n s_n\,e^{+i2\pi k_n x_p}
$$

The inverse discrete Fourier sum of the samples $s_n=s(k_n)$ gives the water density at position $x_p$.

Source: MIT 6.3000 Signal Processing · J. Hrabe

## Sampling sets the field of view and the pixel

A real sequence first plays a reversed prephasing gradient that drives $k$ to its most negative value, then a readout gradient that sweeps $k$ steadily through zero to its largest value. When the gradient area returns to zero all arrows line up: this is the gradient echo, in the middle of the readout.

The receiver takes a sample every $\Delta t=1/\mathrm{BW}$, where BW is the receiver bandwidth. Neighbouring samples are $\Delta k=\bar\gamma G\Delta t$ apart. The discrete Fourier sum gives an image that repeats with period $1/\Delta k$; that period is the field of view, and $N$ samples divide it into $N$ pixels.

Put another way, the field of view is the distance the bandwidth can hold. The bandwidth covers offsets of $\pm\mathrm{BW}/2$; divide by the frequency difference per metre and you have the field of view.

$$
\mathrm{FOV}=\frac{1}{\Delta k}=\frac{\mathrm{BW}}{\bar\gamma G},\qquad \Delta x=\frac{\mathrm{FOV}}{N}
$$

A stronger gradient or a narrower bandwidth shrinks the field of view; more samples make the pixels finer.

Source: MIT 6.3000 Signal Processing · J. Hrabe

## Three ways to spoil the profile

Reversed gradient: the reconstruction assumes a positive gradient and orders the samples by positive $k$. If the gradient was actually negative, every $k$ has the wrong sign and the image is mirrored: a tube at $+35\,\mathrm{mm}$ appears at $-35\,\mathrm{mm}$.

Sampling too slow: water outside the field of view has an offset beyond $\pm\mathrm{BW}/2$. Once sampled it cannot be told apart from some frequency inside, so it is moved into the field of view by a whole number of fields of view. This is folding.

Decay too fast: the record is weighted by $e^{-t/T_2^*}$, heavily at the start of the readout and lightly at the end. In frequency this smears every point into a Lorentzian of width $1/(\pi T_2^*)$ and blurs the edges. The benchmark program of the frequency-encoding experiment checks mirroring, folding and the discrete point spread function, and verifies Parseval’s theorem: the total energy of the samples equals the total energy of the reconstructed image.

Source: MIT 6.3000 Signal Processing · J. Hrabe

## Worked example: reading out two tubes

Problem: a gradient $G=5\,\mathrm{mT/m}$, a 50 kHz receiver bandwidth and 128 samples. One tube is centred at −45 mm, the other at +35 mm. Find the frequency offsets, the field of view, the pixel width and the echo time. Then lower the bandwidth to 25 kHz and find where a tube at +70 mm appears. These are the default settings and the “Slow sampling folds the image” preset of the frequency-encoding experiment.

The frequency difference per millimetre is $\bar\gamma G=42.576\times10^6\times0.005\,\mathrm{Hz/m}=212.9\,\mathrm{Hz/mm}$. The tube at −45 mm is offset by −9.58 kHz and the one at +35 mm by +7.45 kHz, both inside $\pm25\,\mathrm{kHz}$.

The field of view is $\mathrm{FOV}=50\,000/212.88\,\mathrm{mm}=234.9\,\mathrm{mm}$ and the pixel $234.9/128=1.83\,\mathrm{mm}$. Samples are 20 µs apart and the readout lasts 2.56 ms; the prephasing gradient takes 1 ms, so the echo comes $1+1.28=2.28\,\mathrm{ms}$ after excitation.

At 25 kHz the field of view halves to 117.4 mm and holds only $\pm58.7\,\mathrm{mm}$. Water at +70 mm is offset by 14.9 kHz, beyond the 12.5 kHz limit, and is moved to $70-117.4=-47.4\,\mathrm{mm}$. In the experiment the reconstructed image puts it at −47.403 mm, within a pixel of the −47.437 mm the folding formula gives.

Source: MIT 6.3000 Signal Processing · J. Hrabe

## Try it in the Lab

### [Drag a tube and hear its pitch change](https://sandboxphysics.com/labs/mri-frequency-encoding/)

1. In the default preset read the “Frequency offset of the selected tube” and compare it with $\bar\gamma Gx$.
2. Drag a tube along the gradient and watch the frequency offset and the position in the image change together.
3. Choose the “Slow sampling folds the image” preset. Predict with the method of the worked example where the right-hand tube will appear, then check the reconstructed profile.
4. Choose the “A reversed gradient mirrors” preset and confirm that the two tubes have swapped sides.

## Exercises with explained answers

1. Double the gradient to 10 mT/m and keep the bandwidth and the number of samples. What are the field of view and the pixel width now?

   Show the answer

   The field of view is $50\,000/(42.576\times10^6\times0.01)\,\mathrm m=117.4\,\mathrm{mm}$ and the pixel $117.4/128=0.917\,\mathrm{mm}$. Doubling the gradient doubles the frequency difference per millimetre, so the same bandwidth covers half the distance.

2. A gradient of +2 mT/m runs for 1 ms, then −1 mT/m for 2 ms. What is k at the end of each part, and when does the echo appear?

   Show the answer

   After the first part $k=42.576\times10^6\times0.002\times0.001=85.15\,\mathrm{m^{-1}}$. The second part removes 42.58 per millisecond and brings $k$ back to zero after 2 ms. The echo comes at 3 ms, when the gradient area returns to zero.

3. A tube sits at +80 mm and the field of view is 117.4 mm. Where does it appear? And with a 234.9 mm field of view?

   Show the answer

   A 117.4 mm field of view holds only $\pm58.7\,\mathrm{mm}$, so the tube moves to $80-117.4=-37.4\,\mathrm{mm}$. With 234.9 mm it is inside the field of view and appears at +80 mm, unfolded.

[Previous: How a spin echo recovers a signal that seemed lost](https://sandboxphysics.com/stories/mri-spatial-encoding/spin-echo-and-t2/) [Next: k-space: measuring the Fourier transform of an image line by line](https://sandboxphysics.com/stories/mri-spatial-encoding/k-space-and-fourier-imaging/)

## Sources and what we recomputed

1. [MIT 6.3000 Signal Processing, Magnetic Resonance Imaging lecture handout (6 May 2025), data and examples from E. Adalsteinsson](https://sigproc.mit.edu/_static/spring25/lectures/MRI-handout.pdf)

   Read in full. Page 9: the proton gyromagnetic ratio rounded to 42.58 MHz/T. Pages 11–13: gradient fields, the phase integral and the definition of k as the time integral of the gradient. Pages 15–18: k-space data, the complex image and its magnitude. Page 19: 256 lines at 2 s each, about 8.5 minutes. Pages 20–21: keeping only even columns of k-space. Pages 24–36: two-coil unfolding, including the coil pair whose sensitivities cannot separate the folded pixels. The handout uses the sign convention of the Fourier kernel that this course follows.

2. [J. Hrabe, G. Kaur and D. N. Guilfoyle, Principles and limitations of NMR diffusion measurements, Journal of Medical Physics 32(1), 34–42 (2007), doi:10.4103/0971-6203.31148](https://pmc.ncbi.nlm.nih.gov/articles/PMC3003887/)

   Read in full (PubMed Central). Introduction: Hahn’s 1950 observation, the Stejskal–Tanner pulsed gradients and Eqs. 1–3. Eqs. 4–10 (the binomial random walk, D from Eq. 7, Einstein’s relation in Eqs. 8 and 10). Eq. 11 (Larmor frequency, with 2π × 42.576 MHz/T for the proton). Eqs. 12–14 (signal of the lattice walk, the b-value of Eq. 13 and the discrete Stejskal–Tanner form) and Eqs. 15–17 (the continuous limit). The pitfalls section: imaging gradients, local gradients, dependence on the diffusion time and tissue compartments. The 1950 and 1965 papers it cites were not opened.
