12  Practice Problems

The last few sections built a second instrument out of a second idea. Where the pressure submodule metered the heart as a pump, this one meters it as an electrical machine. It began one level below the whole organ, in a single cell holding a voltage across its membrane: the \(\text{Na}^+/\text{K}^+\) pump charges the battery, selective permeability to potassium sets the resting potential near \(-70\) mV, and the Nernst equation (\(\approx 61.5\) mV per tenfold concentration ratio) fixes each ion’s equilibrium voltage. Excitable cells discharge that battery in an all-or-nothing spike, and — wired together and driven by the self-firing SA node — turn it into a traveling wave of voltage that sweeps the heart 60–100 times a minute. The EKG reads that wave from the skin as P–QRS–T, and yields rate and rhythm directly from the paper through the 300 and 1500 rules. Then signals and systems established that this analog voltage must be converted into numbers: sampled fast enough to obey Nyquist (\(f_s > 2f_{\max}\)) or it aliases, rounded onto a ladder of \(2^n\) levels, and recovered from noise by averaging (\(\sqrt{n}\)) — every step measured in decibels.

This section closes the electricity submodule. The problems below are deliberately integrated: few of them are confined to a single section. One problem computes an ion’s equilibrium voltage and then asks how fast an amplifier must sample the spike it produces; another reads a heart rate from the paper and checks whether the digitizer’s clock is fine enough to trust it; a third folds an undersampled artifact down into the diagnostic band; and a final one runs the whole submodule end to end, from a pacemaker cell’s drift to the paper trace to the sampled numbers in memory. Each problem is best approached from the underlying physics rather than from recall. Every answer is worked in full behind a fold, and the reader is encouraged to attempt the problem before consulting it.

NoteToolkit — the electricity submodule on one page

The problems in this section are built from the relations below. Body temperature is \(37\,^\circ\)C, where the Nernst slope is \(61.5\) mV/decade; the EKG paper standard is \(25\) mm/s (a big box is \(0.2\) s, a small box \(0.04\) s, and \(10\) mm \(= 1\) mV); a normal resting heart runs \(60\)–\(100\) bpm.

  • Membrane potential: \(V_m = V_\text{in} - V_\text{out}\); resting \(\approx -70\) mV, firing threshold \(\approx -55\) mV.
  • Nernst (equilibrium) potential, at body temperature, for an ion of charge number \(z\): \[E_\text{ion} \approx \frac{61.5\ \text{mV}}{z}\,\log_{10}\!\frac{[\text{ion}]_\text{out}}{[\text{ion}]_\text{in}},\] i.e. about \(\pm 61.5\) mV for every tenfold (one-decade) concentration ratio (Chrysafides et al. 2023).
  • Pacemaker drift: time to threshold \(=\Delta V / (\text{slope})\); firing rate \(=60/(\text{interval in s})\) bpm.
  • Heart rate from the trace: \(\text{rate} = \dfrac{300}{\#\text{big boxes}} = \dfrac{1500}{\#\text{small boxes}}\) between R waves (Sattar and Chhabra 2023); and \(\text{rate} = 60/T_{RR}\) for an R–R interval \(T_{RR}\) in seconds.
  • Cardiac output: \(\text{CO} = \text{HR}\times\text{SV}\).
  • Sampling interval: \(\Delta t = 1/f_s\).
  • Nyquist–Shannon: capture a signal with content up to \(f_{\max}\) only if \(f_s > 2 f_{\max}\); the Nyquist frequency is \(f_s/2\) (Shannon 1949; Baraniuk and contributors 2009). (Diagnostic ECG: bandwidth \(\approx 150\) Hz, so the AHA specifies \(f_s \geq 500\) Hz (Kligfield et al. 2007).)
  • Aliasing: a signal at \(f\) sampled at \(f_s\) appears at \(f_\text{apparent} = |\,f - n f_s\,|\), with \(n\) the nearest integer to \(f/f_s\).

From the cell to the trace

TipProblem 1

Begin at the single cell where the whole submodule began, and follow its voltage to the amplifier. A neuron holds the gradients from the membrane section: potassium \([\text{K}^+]_\text{out}=4\) mM, \([\text{K}^+]_\text{in}=155\) mM, and sodium \([\text{Na}^+]_\text{out}=145\) mM, \([\text{Na}^+]_\text{in}=12\) mM (both \(z=+1\); use \(61.5\) mV/decade).

  1. Compute the equilibrium potentials \(E_K\) and \(E_{Na}\) — the two voltages the cell swings between when it fires.
  2. Assume the resulting action potential is a fast spike lasting about \(2\) ms whose sharp upstroke carries frequency content up to roughly \(1\) kHz. What sampling rate must an intracellular amplifier exceed to avoid aliasing?
  3. Suppose the recording is sampled at \(f_s = 10\) kHz (a typical intracellular rate). How many samples does that place across the \(2\) ms spike — and why is this rate so much higher than the \(500\) Hz used for a surface EKG?
  1. Nernst, \(E = 61.5\log_{10}([\text{out}]/[\text{in}])\) mV: \[E_K = 61.5\log_{10}\!\frac{4}{155} = 61.5(-1.588) \approx \mathbf{-98\ mV}, \qquad E_{Na} = 61.5\log_{10}\!\frac{145}{12} = 61.5(+1.082) \approx \mathbf{+67\ mV}.\] Potassium (concentrated inside) sits far negative; sodium (concentrated outside) far positive. These are the two poles the spike travels between — resting near \(E_K\), overshooting toward \(E_{Na}\).

  2. Nyquist demands \(f_s > 2 f_{\max} = 2 \times 1\ \text{kHz} = \mathbf{2\ kHz}\). Sampling the spike any slower than twice its fastest content causes that content to alias into a lower-frequency artifact.

  3. At \(f_s = 10\) kHz the sampling interval is \(\Delta t = 1/10\,000 = 0.1\) ms, so across a \(2\) ms spike there are \(2\ \text{ms}/0.1\ \text{ms} = \mathbf{20\ samples}\) — enough to trace the shape, not merely detect it. The intracellular spike is a fast event (content to \(\sim 1\) kHz), whereas the surface EKG is the smeared, summed, tissue-filtered echo of millions of such spikes, with content only up to \(\sim 150\) Hz; Nyquist then asks for just \(>300\) Hz there, and \(500\) Hz suffices (Kligfield et al. 2007). Faster signals need faster clocks — that is the whole content of Nyquist.

TipProblem 2

A monitor prints a resting rhythm strip on standard paper (\(25\) mm/s), and the R waves sit 4 big boxes apart. Inside, the same monitor is sampling the trace at \(f_s = 500\) Hz.

  1. Use the \(300\) rule to find the heart rate, and confirm it with the \(1500\) (small-box) rule.
  2. What is the R–R interval in seconds, and how many samples does the monitor take across one such interval?
  3. The monitor locates each R peak only to the nearest sample. By about how many bpm could its rate estimate be off from this timing alone — and is the sampling clock the thing limiting the accuracy here?
  1. \(\text{rate} = 300/4 = \mathbf{75\ bpm}\). Four big boxes is \(4\times 5 = 20\) small boxes, and \(1500/20 = 75\) bpm — the two rules are the same statement at five-times-finer resolution (Sattar and Chhabra 2023). A comfortably normal rate.

  2. One big box is \(0.2\) s, so \(T_{RR} = 4\times 0.2 = 0.8\) s (check: \(60/0.8 = 75\) bpm). At \(f_s = 500\) Hz the interval is \(\Delta t = 1/500 = 2\) ms, so the interval spans \(0.8\ \text{s}/0.002\ \text{s} = \mathbf{400\ samples}\).

  3. A one-sample (\(2\) ms) error on an \(0.8\) s interval shifts the rate to \(60/(0.8\pm 0.002)\), i.e. between \(74.8\) and \(75.2\) bpm — only about \(\mathbf{\pm 0.2\ bpm}\). The sampling clock is not the bottleneck: \(400\) samples per beat pin the timing far more tightly than the reading itself (beat-to-beat variability and noise dominate the real uncertainty). This is why \(500\) Hz, chosen to satisfy Nyquist for the \(150\) Hz signal bandwidth, is already generous for merely timing the beats.

Digitizing the signal honestly

TipProblem 3

Consider the choice of sampling rate for two EKG devices. The clinically meaningful content of an EKG reaches up to about \(f_{\max}=150\) Hz.

  1. What is the Nyquist rate for this signal? The AHA specifies \(500\) Hz for a diagnostic ECG — what is its Nyquist frequency, and does it safely cover the band?
  2. A budget wearable cuts corners and samples at only \(f_s = 200\) Hz. What is its Nyquist frequency, and is the full \(150\) Hz EKG band safe from aliasing?
  3. On that wearable, a \(180\) Hz muscle-tremor artifact contaminates the trace. Using \(f_\text{apparent}=|f-nf_s|\) with \(n\) the nearest integer to \(f/f_s\), find the frequency it appears at. Why is this especially insidious?
  1. Nyquist requires \(f_s > 2 f_{\max} = 2\times 150 = \mathbf{300\ Hz}\). At \(500\) Hz the Nyquist frequency is \(f_s/2 = 250\) Hz, which is above \(150\) Hz, so the whole diagnostic band is captured cleanly, with margin to spare (Kligfield et al. 2007; Shannon 1949).

  2. At \(f_s=200\) Hz the Nyquist frequency is only \(f_s/2 = \mathbf{100\ Hz}\). That is below \(150\) Hz, so the top of the EKG band itself (everything between \(100\) and \(150\) Hz — including the sharp edges of the QRS) is not safe: it folds back down into the lower frequencies and corrupts the trace.

  3. \(f/f_s = 180/200 = 0.9\), so the nearest integer is \(n=1\) and \[f_\text{apparent} = |\,180 - 1\times 200\,| = \mathbf{20\ Hz}.\] The \(180\) Hz artifact masquerades as a \(20\) Hz oscillation — and \(20\) Hz lies squarely within the real EKG band, coinciding with genuine cardiac signal. Unlike an out-of-band interferer, which could be filtered away, an alias is indistinguishable from real signal after the fact (signals section): the only remedy is to sample faster (or filter before sampling), never after.

Building the whole front end

TipProblem 4

One last chain, running the whole submodule end to end — from a single pacemaker cell, to the paper trace, to the numbers in memory. In an SA-node cell the membrane sits after each beat at a maximum diastolic potential of \(-60\) mV and drifts upward (the pacemaker potential) at a steady \(20\) mV/s until it hits the firing threshold of \(-40\) mV and fires the next beat.

  1. How long is one beat-to-beat interval, and what heart rate (bpm) does this pacemaker set? (membrane section)
  2. On a standard EKG strip, how many big boxes apart will the R waves fall at this rate? (EKG section)
  3. A cheap recorder digitizes this EKG at \(f_s = 250\) Hz. Given the \(150\) Hz signal bandwidth, is that safe from aliasing — and what standard rate would you specify instead? (signals section)
  1. The drift covers \(\Delta V = -40-(-60) = 20\) mV at \(20\) mV/s, so the interval is \(t = 20/20 = 1.0\) s. A beat every second is \[\text{rate} = 60/1.0 = \mathbf{60\ bpm},\] the low end of the normal \(60\)–\(100\) bpm sinus range set by the SA node (Kashou et al. 2022).

  2. Invert the \(300\) rule: \(\#\text{big boxes} = 300/\text{rate} = 300/60 = \mathbf{5\ big\ boxes}\). (Check: \(5\times 0.2\ \text{s} = 1.0\) s per beat — the same interval as in (a).)

  3. At \(f_s = 250\) Hz the Nyquist frequency is \(f_s/2 = 125\) Hz, which is below the \(150\) Hz bandwidth — so the top of the EKG spectrum aliases; not safe. Specify the standard \(\mathbf{500\ Hz}\) (Nyquist frequency \(250\) Hz \(>150\) Hz), the AHA rate that covers the band with margin (Kligfield et al. 2007). Three sections in a single chain: a cell’s slow voltage drift set the rate, the paper turned that rate into a spacing that can be counted, and Nyquist decided how fast to sample it — the whole electrical instrument, from ion gradient to stored number.

NoteFurther reading

References

Baraniuk, Richard, and contributors. 2009. Signals and Systems. OpenStax CNX / Rice University. https://eng.libretexts.org/Bookshelves/Electrical_Engineering/Signal_Processing_and_Modeling/Signals_and_Systems_(Baraniuk_et_al.)/10\%3A_Sampling_and_Reconstruction.
Chrysafides, Steven M., Stephen J. Bordes, and Sandeep Sharma. 2023. “Physiology, Resting Potential.” In StatPearls. StatPearls Publishing, Treasure Island (FL). https://www.ncbi.nlm.nih.gov/books/NBK538338/.
Kashou, Anthony H., Hajira Basit, and Lovely Chhabra. 2022. “Physiology, Sinoatrial Node.” In StatPearls. StatPearls Publishing, Treasure Island (FL). https://www.ncbi.nlm.nih.gov/books/NBK459238/.
Kligfield, Paul, Leonard S. Gettes, James J. Bailey, et al. 2007. “Recommendations for the Standardization and Interpretation of the Electrocardiogram: Part I.” Circulation 115 (10): 1306–24. https://doi.org/10.1161/CIRCULATIONAHA.106.180200.
Sattar, Yasar, and Lovely Chhabra. 2023. “Electrocardiogram.” In StatPearls. StatPearls Publishing, Treasure Island (FL). https://www.ncbi.nlm.nih.gov/books/NBK549803/.
Shannon, Claude E. 1949. “Communication in the Presence of Noise.” Proceedings of the IRE 37 (1): 10–21. https://doi.org/10.1109/JRPROC.1949.232969.