Skip to main content

m04 · Sampling, filtering and the EP recording chain

Warning

Education only. Not for diagnosis, treatment or any clinical decision.

In 60 seconds

An electrogram on a mapping screen has passed through a chain: amplifier, analog filters, a converter that samples and quantizes, then digital filters. Every stage changes what you can measure. Sampling at \(f_s\) cannot distinguish frequencies above \(f_s/2\) from lower ones (aliasing), so they must be removed first, and it limits timing to about a sample unless you interpolate. Quantization adds noise of one step over \(\sqrt{12}\), which sets a ceiling of about 6 dB per bit. Filters remove what you do not want, mains interference, baseline wander, far-field activity, but also reshape what you do want: a high-pass removes the slow components of a unipolar signal, and a causal filter shifts features in time by its group delay. Clinical recordings use different bands for unipolar and bipolar signals; the same electrogram looks different in each, and its activation time can move.

From the field

  • Bands differ by signal type. One clinical mapping study recorded minimally filtered unipolar electrograms at 0.5–500 Hz, high-pass filtered unipolar electrograms at 100 Hz and bipolar electrograms at 30–500 Hz, at 205 sites in 40 patients with focal tachycardias (Delacretaz et al. 2001). Demo m04-d2 applies these bands to a model unipolar signal.
  • High-pass filtering trades far field for morphology. It can reduce the far-field part of a unipolar signal but limits what can be inferred from the electrogram’s shape (Stevenson and Soejima 2005). Lab part D shows both effects.
  • Using both signals together. In the same study, the interval from the onset of the minimally filtered unipolar signal to the first peak of the bipolar signal correlated with timing against the surface ECG (r = 0.85), and was shorter at sites where ablation succeeded than where it did not (3.8 ± 3.5 versus 9.2 ± 5.2 ms) (Delacretaz et al. 2001). The filter settings are part of that measurement.
  • Know the converter. The PhysioNet Intracardiac Atrial Fibrillation Database used in m03 and m31 was sampled at 1 kHz with 14-bit resolution (Intracardiac Atrial Fibrillation Database (Version 1.0.0) 2003). At 1 kHz a sharp activation can only be timed to about 0.3 ms without interpolation (lab part A).

Derivations

Symbols used throughout. \(f\) frequency (Hz). \(f_s\) sampling rate (Hz), \(T = 1/f_s\) sampling interval. \(N\) number of bits. \(V_{FS}\) full-scale voltage, \(q = 2V_{FS}/2^N\) the quantization step (LSB). \(f_c\) filter cutoff (Hz), \(n\) filter order. \(H(f)\) frequency response. \(f_0\) notch frequency, \(Q\) quality factor. Signals in relative units.

Sampling

Sampling keeps \(x[n] = x(nT)\). A sinusoid at \(f\) and one at \(f\) shifted by any multiple of \(f_s\) give identical samples, so every frequency folds into \([0, f_s/2]\):

\[ f_{\text{alias}} = \left\lvert f - f_s\,\operatorname{round}\!\left(\frac{f}{f_s}\right)\right\rvert \tag{1}\]

Anything above the Nyquist frequency \(f_s/2\) must be removed by an analog low-pass filter before the converter; no later processing can separate it from real low-frequency content. Sampling also limits timing: locating the steepest downstroke (the m03 activation marker) at the nearest sample has an error spread of \(T/\sqrt{12}\), about 0.29 ms at 1 kHz; fitting a parabola through the slope around its minimum cuts that by more than an order of magnitude for a smooth signal (lab part A).

Exact

Assumptions

  • Model: Equation 1 for an ideal sampler and a pure cosine; the alias drawn is the lowest-frequency cosine through the same samples. Tested against epml.recording.
  • Parameters: signal 5–1500 Hz and sampling rate 100–2000 Hz, free choices for illustration.
  • What it ignores: the anti-aliasing filter, converter noise and clock jitter.

Key takeaways

  • Frequencies above \(f_s/2\) fold down and cannot be removed afterwards.
  • Timing at the nearest sample is uncertain by about \(T/\sqrt{12}\); interpolation helps.

Quantization

An \(N\)-bit converter spanning \(\pm V_{FS}\) rounds to steps of \(q = 2V_{FS}/2^N\). If the error is spread evenly over one step, its variance is \(q^2/12\). For a full-scale sine of amplitude \(V_{FS}\), the signal-to-quantization-noise ratio is

\[ \mathrm{SQNR} = 10\log_{10}\frac{V_{FS}^2/2}{q^2/12} = 20\log_{10}\!\left(2^N\sqrt{3/2}\right) \approx 6.02N + 1.76\ \text{dB} \tag{2}\]

A 14-bit converter gives about 86 dB for a full-scale sine. A signal that uses a fraction of the range loses 6 dB for every halving of its amplitude, so gain before the converter matters.

Key takeaways

  • Quantization noise is one step over \(\sqrt{12}\).
  • About 6 dB per bit for a full-scale signal; less for small signals.

Filters

A first-order RC high-pass has

\[ H(f) = \frac{jf/f_c}{1 + jf/f_c} \tag{3}\]

At \(f_c\) it passes \(1/\sqrt2\) of the amplitude with a 45° phase lead; far below \(f_c\), \(H \approx jf/f_c\), a scaled differentiator. Butterworth filters are maximally flat in the passband:

\[ \lvert H(f)\rvert^2 = \frac{1}{1 + (f/f_c)^{2n}} \tag{4}\]

for a low-pass of order \(n\) (replace \(f/f_c\) by \(f_c/f\) for a high-pass). Digital versions come from the bilinear transform with the cutoff prewarped, which keeps the −3 dB point exactly at \(f_c\); the lab builds first- and second-order sections by hand and checks them against scipy.

Delay. A causal filter delays slowly varying features by its group delay. For analog Butterworth low-passes, at low frequencies,

\[ \tau_g = \frac{1}{2\pi f_c}\ (n = 1), \qquad \tau_g = \frac{\sqrt2}{2\pi f_c}\ (n = 2) \tag{5}\]

so a second-order 100 Hz low-pass delays a 10-ms bump by about 2.3 ms. Filtering forward and then backward cancels the phase (zero phase) and squares the magnitude, but needs the whole record, so it is for offline analysis. A linear-phase FIR filter delays every frequency equally (eq-m34-fir-delay).

Mains interference. A second-order notch at \(f_0\) with quality factor \(Q\),

\[ H(z) = g\,\frac{1 - 2\cos\omega_0\,z^{-1} + z^{-2}}{1 - 2g\cos\omega_0\,z^{-1} + (2g - 1)\,z^{-2}}, \qquad \omega_0 = \frac{2\pi f_0}{f_s}, \qquad g = \frac{1}{1 + \tan(\omega_0/2Q)} \tag{6}\]

removes \(f_0\) exactly, passes DC and the Nyquist frequency unchanged, and has a −3 dB bandwidth of \(f_0/Q\). A narrow notch (large \(Q\)) barely touches the electrogram but rings longer.

Approximate model

Assumptions

  • Model: the m03 unipolar electrogram (eq-m03-unipolar-closed), a simplified model, computed at 20 kHz and passed through second-order Butterworth high-pass and low-pass filters (Equation 4), causally or forward and backward. Tested against epml.recording.
  • Parameters: front at 1 m/s, width 0.3 mm, electrode 1 mm away (m03 defaults); band presets from one clinical study (Delacretaz et al. 2001); other cutoffs are free choices.
  • What it ignores: amplifier noise and gain, the analog anti-aliasing filter, sampling and quantization, filter order and type used by any particular system, and real electrogram shapes.

Key takeaways

  • A high-pass removes slow components and changes shape; it lowers peak-to-peak amplitude.
  • Causal filters shift features in time; zero-phase filtering does not, but only offline.

Clinical correlate

NotePending clinical review

This section describes published findings only. It is not guidance for patient care, and it has not yet been reviewed by an EP physician.

Where this shows up in EP. Every displayed electrogram, voltage and activation time depends on the recording chain. Reviews of recording technique note that high-pass filtering and digital sampling both influence electrogram characteristics (Stevenson and Soejima 2005). One study used minimally filtered unipolar (0.5–500 Hz), high-pass filtered unipolar (100 Hz) and bipolar (30–500 Hz) recordings from the same catheter to judge local prematurity during mapping of focal tachycardias (Delacretaz et al. 2001).

What the evidence is. A review (Stevenson and Soejima 2005) and one clinical study of 40 patients and 205 mapping sites (Delacretaz et al. 2001). Filter settings, sampling rates and resolutions vary between systems; numbers here describe the cited studies and our own models, not any system’s defaults.

What a reader should ask:

  • What band and filter type were used? They set shape, amplitude and timing (Equation 4, Equation 5).
  • Was filtering causal or zero-phase? Live annotation sees the delay (Equation 5).
  • What were the sampling rate and resolution? They limit timing and small-signal fidelity (Equation 1, Equation 2).

Visual summary

Schematic

electrode amplifier +anti-alias filter converterf_s, N bits digital filtersHP, LP, notch display,annotation aliasing above f_s/2noise q/√12 shape changescausal: delay τ_g
Figure 1: The recording chain: each stage changes what reaches the screen. Sampling and quantization set limits that cannot be undone; filters reshape and, if causal, delay.

Assumptions

How experts think

When an electrogram or a measurement looks wrong, walk the chain:

  1. Is anything aliased? Was there an anti-aliasing filter below \(f_s/2\) (Equation 1)?
  2. Is the signal using the converter’s range? Small signals lose 6 dB per halving (Equation 2).
  3. What band was applied? High-pass reshapes and shrinks; low-pass smooths and delays (Equation 4).
  4. Causal or zero-phase? Live timing includes the group delay (Equation 5).
  5. Is there mains interference, and how was it removed? A notch is narrow but rings (Equation 6).

One sentence to keep: the electrogram on the screen is the tissue signal times the chain’s transfer function; know the chain before you trust the shape or the timing.

Cheat sheet

Quantity Result
Aliasing (Equation 1) \(f_{\text{alias}} = \lvert f - f_s\,\mathrm{round}(f/f_s)\rvert\); remove content above \(f_s/2\) before sampling
Timing at the nearest sample error spread \(T/\sqrt{12}\) (0.29 ms at 1 kHz)
Quantization (Equation 2) noise \(q/\sqrt{12}\); SQNR \(\approx 6.02N + 1.76\) dB for a full-scale sine
RC high-pass (Equation 3) \(1/\sqrt2\) and +45° at \(f_c\); differentiator far below \(f_c\)
Butterworth (Equation 4) \(\lvert H\rvert^2 = 1/(1 + (f/f_c)^{2n})\)
Group delay (Equation 5) \(1/(2\pi f_c)\) (order 1), \(\sqrt2/(2\pi f_c)\) (order 2); zero phase removes it offline
Notch (Equation 6) zero at \(f_0\); −3 dB bandwidth \(f_0/Q\)

Values used in this module

Value Source
Unipolar 0.5–500 Hz, high-pass unipolar 100 Hz, bipolar 30–500 Hz; 205 sites, 40 patients Delacretaz et al. (2001)
Unipolar-onset to bipolar-peak interval: r = 0.85 with ECG timing; 3.8 ± 3.5 versus 9.2 ± 5.2 ms Delacretaz et al. (2001)
PhysioNet Intracardiac Atrial Fibrillation Database: 1 kHz, 14 bits Intracardiac Atrial Fibrillation Database (Version 1.0.0) (2003)
Timing error, SQNR, filter delays and distortions our own code

Interview questions

Try each question before you open its model answer. In a real interview, say which assumptions you are making.

Q1. What is aliasing, and why can’t you fix it in software?

Model answer

Content above \(f_s/2\) produces the same samples as content at \(\lvert f - f_s\,\mathrm{round}(f/f_s)\rvert\) (Equation 1). Once sampled the two are indistinguishable, so it must be filtered out in analog form first.

Q2. How precisely can you time an activation sampled at 1 kHz?

Model answer

At the nearest sample, with an error spread of about \(T/\sqrt{12}\) = 0.29 ms; interpolating the slope around its minimum does much better for a smooth signal (lab part A).

Q3. Derive the 6 dB-per-bit rule.

Model answer

Uniform rounding error has variance \(q^2/12\); a full-scale sine has power \(V_{FS}^2/2\) with \(q = 2V_{FS}/2^N\), giving \(20\log_{10}(2^N\sqrt{3/2}) \approx 6.02N + 1.76\) dB (Equation 2).

Q4. Why does a small signal get a worse SQNR?

Model answer

The noise is fixed by the step size, so halving the signal amplitude loses 6 dB (Equation 2).

Q5. What does a first-order high-pass do at its cutoff and far below it?

Model answer

At \(f_c\), gain \(1/\sqrt2\) and a 45° lead; far below, \(H \approx jf/f_c\), a scaled differentiator (Equation 3).

Q6. Why are unipolar and bipolar signals filtered differently?

Model answer

Bipolar signals are already spatially high-passed (m03), so a 30-Hz high-pass mainly removes baseline drift; unipolar signals keep far-field and slow components that a high-pass would remove, along with morphology information (Stevenson and Soejima 2005; Delacretaz et al. 2001).

Q7. A causal filter moved the activation time. Why, and by how much?

Model answer

By its group delay, \(\sqrt2/(2\pi f_c)\) for a second-order Butterworth low-pass at low frequencies (Equation 5), plus shape changes from the high-pass (lab part D).

Q8. When can you use zero-phase filtering?

Model answer

Offline, when the whole record is available: filtering forward then backward cancels the phase and squares the magnitude (Equation 5). Live systems must be causal.

Q9. What does a Butterworth filter’s order change?

Model answer

The steepness of the transition: \(\lvert H\rvert^2 = 1/(1 + (f/f_c)^{2n})\) (Equation 4); higher order also means more delay and more ringing.

Q10. Design a notch for 60 Hz mains. What trade-off do you face?

Model answer

Bandwidth \(f_0/Q\) (Equation 6): a high \(Q\) removes a narrow band and barely changes the electrogram but rings longer after transients; a low \(Q\) settles faster but removes more signal.

Q11. Why prewarp the cutoff in the bilinear transform?

Model answer

The bilinear transform compresses the frequency axis; prewarping places the digital −3 dB point exactly at the intended \(f_c\) (lab part C).

Q12. A signal looks clean on one system and fractionated on another. What would you check first?

Model answer

Band, filter type and order, causal or zero-phase processing, sampling rate and gain: the chain changes shape before any tissue difference (Equation 4, Equation 1; demo m04-d2).

Code lab

The lab builds the recording chain in code and runs the m03 electrogram through it.

Part What you do Data
A Aliasing, and timing error at 1 kHz with and without interpolation (Equation 1) synthetic
B Quantization noise and the 6 dB-per-bit rule (Equation 2) synthetic
C RC high-pass and Butterworth filters by hand, checked against scipy (Equation 3, Equation 4) synthetic
D Three published bands on a unipolar electrogram, causal and zero-phase (Equation 5) synthetic
E Mains interference and the notch (Equation 6) synthetic

Each part ends with checks: lines that pass with the code as given. If you change something and a check fails, that is information, not an error to hide.

Self-check

Short checks you can do in your head. Open each answer after you have tried it.

S1. A 700 Hz sine sampled at 1 kHz appears at what frequency?

Answer

300 Hz (Equation 1).

S2. You add two bits to a converter. SQNR gain for a full-scale sine?

Answer

About 12 dB (Equation 2).

S3. Gain of a first-order high-pass at its cutoff?

Answer

\(1/\sqrt2\), about 0.71 (Equation 3).

S4. Group delay of a first-order 100 Hz low-pass at low frequencies?

Answer

\(1/(2\pi \cdot 100)\) s, about 1.6 ms (Equation 5).

S5. A 50 Hz notch with Q = 25. Bandwidth?

Answer

2 Hz (Equation 6).

S6. Does zero-phase filtering change amplitude?

Answer

Yes: it squares the magnitude response; only the phase is cancelled (Equation 5).

Literature figures

These figures are worth looking at alongside this module. We link to them instead of copying them: some licenses do not allow reuse here, and others we could not confirm. Each entry says what to look for and where this module explains it.

  • Simultaneous unipolar and bipolar recordings. Delacretaz et al. show minimally filtered and high-pass filtered unipolar signals next to bipolar ones from the same catheter (Delacretaz et al. 2001). This module: filters, and demo m04-d2.

Further reading

  • Recording technique. Stevenson and Soejima’s review (Stevenson and Soejima 2005).
  • Unipolar and bipolar together. Delacretaz et al. (Delacretaz et al. 2001).
  • Related modules. m03 (electrograms as spatial filters), m05 (time–frequency analysis), m14 (biopotential front ends), m22 (annotation), m34 (filter delay in software pipelines).

References

Delacretaz, E., K. Soejima, V. K. Gottipaty, C. B. Brunckhorst, P. L. Friedman, and W. G. Stevenson. 2001. “Single Catheter Determination of Local Electrogram Prematurity Using Simultaneous Unipolar and Bipolar Recordings to Replace the Surface ECG as a Timing Reference.” Pacing and Clinical Electrophysiology 24 (4): 441–49. https://doi.org/10.1046/j.1460-9592.2001.00441.x.
Intracardiac Atrial Fibrillation Database (Version 1.0.0). 2003. PhysioNet. https://doi.org/10.13026/C23S33.
Stevenson, William G., and Kyoko Soejima. 2005. “Recording Techniques for Clinical Electrophysiology.” Journal of Cardiovascular Electrophysiology 16 (9): 1017–22. https://doi.org/10.1111/j.1540-8167.2005.50155.x.