Skip to main content
Sandbox Physics
MRI spatial encoding

L2 · Chapter 3

How a gradient turns position into frequency

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 xx 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.

A gradient makes the field depend on position

On top of B0B_0 add a gradient field so that the zz field changes linearly along xx with slope GxG_x, measured in mT/m. The MIT handout writes the two-dimensional case as Bz=B0+xGx+yGyB_z=B_0+xG_x+yG_y. The added field is far smaller than B0B_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 γB0\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.

Δf(x)=γˉ Gx x,γˉ=γ2π=42.576 MHz/T\Delta f(x)=\bar\gamma\,G_x\,x,\qquad \bar\gamma=\frac{\gamma}{2\pi}=42.576\,\mathrm{MHz/T}
The offset from f0f_0. At 5 mT/m each millimetre is worth 212.9 Hz.
positionfield with gradientlower tonehigher tone
A gradient makes the field, and so the precession frequency, rise along xx. Water at each position sounds its own tone, Δf=γˉGxx\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 xx component, the imaginary part the yy component. A unit arrow turned through φ\varphi is e−iφ=cos⁡φ−isin⁡φ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 xx at time tt is the time integral of its frequency. The coil adds the arrows of all positions, weighted by the water density ρ(x)\rho(x). With the common γB0t\gamma B_0t removed, the MIT handout arrives at the result below: the signal is the Fourier transform of ρ(x)\rho(x) under a new name, kk.

kk 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)=∫ρ(x) e−i2πk(t) x dx,k(t)=γˉ∫0tGx(τ) dτ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.
ρ(xp)≈Δk∑nsn e+i2πknxp\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 sn=s(kn)s_n=s(k_n) gives the water density at position xpx_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 kk to its most negative value, then a readout gradient that sweeps kk 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 Δt=1/BW\Delta t=1/\mathrm{BW}, where BW is the receiver bandwidth. Neighbouring samples are Δk=γˉGΔt\Delta k=\bar\gamma G\Delta t apart. The discrete Fourier sum gives an image that repeats with period 1/Δk1/\Delta k; that period is the field of view, and NN samples divide it into NN pixels.

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

FOV=1Δk=BWγˉG,Δx=FOVN\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 kk. If the gradient was actually negative, every kk has the wrong sign and the image is mirrored: a tube at +35 mm+35\,\mathrm{mm} appears at −35 mm-35\,\mathrm{mm}.

Sampling too slow: water outside the field of view has an offset beyond ±BW/2\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/T2∗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/(πT2∗)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 mT/mG=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 γˉG=42.576×106×0.005 Hz/m=212.9 Hz/mm\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 ±25 kHz\pm25\,\mathrm{kHz}.

The field of view is FOV=50 000/212.88 mm=234.9 mm\mathrm{FOV}=50\,000/212.88\,\mathrm{mm}=234.9\,\mathrm{mm} and the pixel 234.9/128=1.83 mm234.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 ms1+1.28=2.28\,\mathrm{ms} after excitation.

At 25 kHz the field of view halves to 117.4 mm and holds only ±58.7 mm\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 mm70-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

  1. In the default preset read the “Frequency offset of the selected tube” and compare it with γˉGx\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×106×0.01) m=117.4 mm50\,000/(42.576\times10^6\times0.01)\,\mathrm m=117.4\,\mathrm{mm} and the pixel 117.4/128=0.917 mm117.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×106×0.002×0.001=85.15 m−1k=42.576\times10^6\times0.002\times0.001=85.15\,\mathrm{m^{-1}}. The second part removes 42.58 per millisecond and brings kk 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 ±58.7 mm\pm58.7\,\mathrm{mm}, so the tube moves to 80−117.4=−37.4 mm80-117.4=-37.4\,\mathrm{mm}. With 234.9 mm it is inside the field of view and appears at +80 mm, unfolded.

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

    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

    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.

FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy