Skip to main content

m05 · Time–frequency tools: dominant frequency, Hilbert phase, wavelets

Warning

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

In 60 seconds

Fibrillation maps built from dominant frequency, organization and phase (m29) rest on a few signal tools, and each has a limit worth knowing. A spectrum from a record of length \(T\) resolves frequencies about \(1/T\) apart, and zero padding does not change that. The window trades a wider peak for less leakage of strong components into weak ones. A single spectrum of a noisy signal is as uncertain as its own value at every frequency; averaging segments reduces that at the cost of resolution. A train of sharp, zero-mean deflections puts its largest spectral line at a harmonic far above the activation rate, which is why electrograms are preprocessed before their dominant frequency is read. The analytic signal gives an instantaneous phase that turns once per cycle for a sinusoid, but counts deflections, not activations, for electrogram-like signals. Finally, no signal is both short and narrowband: wavelets sit at that limit and track rates that change over time.

From the field

  • Raw electrograms need preprocessing before dominant frequency. Raw bipolar electrograms are sharp, so most of their power sits far above the activation rate; preprocessing is a necessary step (Ng et al. 2007). The pulse-train spectrum (Equation 4) shows why.
  • Record length matters. In one technical study, records longer than 2 s were needed for reliable dominant frequency (Ng et al. 2007). Resolution (Equation 1) and variance (Equation 3) both improve with length.
  • The peak is not always the rate. Dominant frequency tracks the activation rate only when its assumptions hold; other features of the signal can move the peak (Ng and Goldberger 2007).
  • Phase from contact electrograms is fragile. For unipolar atrial electrograms, the Hilbert phase depends on whether a deflection is one- or two-phased, on its R and S waves, and on noise (Kuklik et al. 2015); optical voltage signals, smoother and nearly periodic, gave phase maps with phase singularities during fibrillation (Gray et al. 1998). Lab part E and demo m05-d2 show both behaviors.

Derivations

Symbols used throughout. \(x(t)\) or \(x[n]\) a signal; \(f_s\) sampling rate (Hz); \(N\) samples; \(T = N/f_s\) record length (s). \(X(f)\) Fourier transform, \(P(f)\) power spectrum. \(w[n]\) window. \(K\) number of averaged segments. \(T_0\) cycle length, \(p(t)\) one deflection. \(z(t)\) analytic signal, \(\mathcal H\) Hilbert transform, \(\varphi\) phase. \(\sigma_t\), \(\sigma_f\) RMS duration and bandwidth. \(\psi\) wavelet, \(s\) scale, \(\omega_0\) wavelet frequency parameter.

Spectra from finite records

The DFT of \(N\) samples evaluates the spectrum at frequencies

\[ f_k = \frac{k f_s}{N} = \frac{k}{T}, \qquad \Delta f = \frac{1}{T} \tag{1}\]

Two tones closer than about \(\Delta f\) merge into one peak: tones 1 Hz apart need about a 1-s record. Zero padding evaluates the same smeared spectrum on a finer grid; it interpolates, it does not resolve (lab part A).

Cutting out \(N\) samples multiplies the signal by a window, so the spectrum is convolved with the window’s transform:

\[ X_w(f) = \int X(\nu)\,W(f - \nu)\,d\nu \tag{2}\]

Each spectral line is smeared into the window’s main lobe and leaks into its sidelobes. The rectangular window has the narrowest main lobe (first null at one bin) but sidelobes only 13.3 dB down; the Hann window’s main lobe is twice as wide and its highest sidelobe 31.5 dB down, falling quickly further out. A tone 40 dB weaker than a neighbor 15 Hz away is hidden by rectangular leakage in a 2-s record and stands 40 dB clear with a Hann window (lab part B).

Exact

Assumptions

  • Model: the periodogram of two equal tones (6 Hz and a second tone you choose) sampled at 200 Hz, rectangular or periodic Hann window (Equation 1, Equation 2). Tested against epml.timefreq and scipy.
  • Parameters: record length 0.25–4 s and tone spacing 0.2–3 Hz, free choices for illustration.
  • What it ignores: noise, nonstationary rates and preprocessing.

Variance. For noise, each periodogram bin comes from one complex Fourier coefficient, so its standard deviation equals its mean however long the record is. Averaging \(K\) independent segments (Welch’s method) gives

\[ \frac{\operatorname{std}\hat P(f)}{\operatorname{E}\hat P(f)} = \frac{1}{\sqrt K}, \qquad \Delta f = \frac{K}{T} \tag{3}\]

so smoothness is bought with resolution: eight segments cut the spread to 0.35 and make the bins eight times wider (lab part C).

Key takeaways

  • Resolution is one over the record length; zero padding does not change it.
  • Windows trade main-lobe width for leakage; averaging trades resolution for variance.

Pulse trains and the dominant frequency

A periodic train of identical deflections \(p(t)\) every \(T_0\) has a line spectrum:

\[ x(t) = \sum_k p(t - kT_0) \quad\Longrightarrow\quad X(f) = \frac{1}{T_0}\sum_m P\!\left(\frac{m}{T_0}\right)\delta\!\left(f - \frac{m}{T_0}\right) \tag{4}\]

The lines sit at the activation rate and its harmonics, weighted by the deflection’s own spectrum. A sharp, zero-mean biphasic deflection (the derivative of a Gaussian of width \(w\)) has \(P(0) = 0\) and \(\lvert P(f)\rvert \propto f\,e^{-2\pi^2 f^2 w^2}\), largest at \(1/(2\pi w)\): about 40 Hz for \(w\) = 4 ms. A train every 180 ms (5.6 Hz) therefore has its largest line at the seventh harmonic. Band-pass filtering, rectifying and low-pass filtering turn each deflection into one smooth, positive bump, and the peak moves to \(1/T_0\) (lab part D). The dominant frequency of m29 (eq-m29-df) is read after this step.

Key takeaways

  • The spectrum of a regular train is the activation rate’s harmonics times the deflection’s spectrum.
  • Sharp, zero-mean deflections push the largest peak to a harmonic; preprocessing brings it back to the rate.

The analytic signal and instantaneous phase

The analytic signal adds the Hilbert transform as an imaginary part, which removes negative frequencies:

\[ z(t) = x(t) + j\,\mathcal H[x](t), \qquad \varphi(t) = \arg z(t), \qquad f_i(t) = \frac{1}{2\pi}\frac{d\varphi}{dt} \tag{5}\]

For \(x = \cos\omega t\), \(\mathcal H[x] = \sin\omega t\) and \(z = e^{j\omega t}\): the phase turns once per period. For a carrier \(a(t)\cos\omega t\) whose envelope varies slowly compared with the carrier, \(\lvert z\rvert\) recovers \(a(t)\) and \(f_i\) the carrier frequency. Electrogram-like signals are not narrowband. In lab part E, a train with one biphasic deflection per cycle gives one phase turn per activation, a train with two deflections per cycle gives two, and modest noise gives hundreds. That is why m29 rebuilds the signal with sinusoidal recomposition before taking its phase (eq-m29-recomposition) (Kuklik et al. 2015).

Exact

Assumptions

  • Model: Equation 5 computed by the FFT (padded to 4096 samples, as scipy.signal.hilbert), applied to synthetic signals sampled at 1 kHz for 4 s: a sinusoid, one or two biphasic deflections (4-ms Gaussian derivative) per cycle, or one deflection plus Gaussian noise of standard deviation 0.15. Tested against scipy.
  • Parameters: cycle length 120–300 ms; deflection shapes and noise level are illustrative.
  • What it ignores: real electrogram shapes, far-field signals, filtering and recomposition (m29).

Key takeaways

  • Hilbert phase turns once per cycle only for narrowband signals.
  • For electrograms it counts deflections and noise; rebuild the signal first if you need activation phase.

Time and frequency together

A signal cannot be both short and narrowband. With \(\sigma_t\) the RMS duration of \(\lvert x\rvert^2\) and \(\sigma_f\) the RMS bandwidth of \(\lvert X\rvert^2\),

\[ \sigma_t\,\sigma_f \ge \frac{1}{4\pi} \tag{6}\]

with equality only for a Gaussian. A short-time Fourier transform fixes one window length for all frequencies; a wavelet transform scales its window with frequency. The Morlet wavelet is a Gaussian-windowed complex sinusoid,

\[ \psi(t) = \pi^{-1/4}\,e^{j\omega_0 t}\,e^{-t^2/2}, \qquad W(s, \tau) = \frac1s\int x(t)\,\psi^*\!\left(\frac{t - \tau}{s}\right)dt, \qquad f = \frac{\omega_0}{2\pi s} \tag{7}\]

where \(s\) is the scale in seconds and \(\omega_0 = 6\) is a common choice (the small admissibility correction is neglected). With the \(1/s\) normalization used here, a sinusoid of frequency \(f\) gives the same peak magnitude at every scale, exactly at \(s = \omega_0/(2\pi f)\). In lab part F the wavelet ridge of a preprocessed train follows its rate as the cycle length shortens from 200 to 150 ms.

Key takeaways

  • Duration times bandwidth is at least \(1/(4\pi)\); Gaussians reach the bound.
  • Wavelets use short windows for high frequencies and long ones for low frequencies, and track changing rates.

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. Dominant-frequency maps built from electroanatomic points have been used to locate sites of high-frequency activity during atrial fibrillation (Sanders et al. 2005). Frequency-domain measures of organization were proposed to quantify how regular fibrillation is (Everett et al. 2001), and phase maps from optical recordings showed phase singularities during fibrillation (Gray et al. 1998). Each of these depends on the tools in this module: record length, window, preprocessing and the phase method.

What the evidence is. Technical and methods papers (Ng et al. 2007; Ng and Goldberger 2007; Kuklik et al. 2015; Everett et al. 2001), experimental optical mapping (Gray et al. 1998) and a clinical mapping study (Sanders et al. 2005). m29 discusses their use; this module explains the signal processing behind them.

What a reader should ask:

  • How long were the records, and how was the spectrum estimated? Resolution and variance follow (Equation 1, Equation 3).
  • What preprocessing came before the dominant frequency? Raw sharp signals peak at harmonics (Equation 4).
  • How was phase computed? Hilbert phase of a raw electrogram counts deflections (Equation 5).

Visual summary

Schematic

resolution Δf = 1/T window and leakage pulse train: harmonics × P(f) analytic signal: one turnper cycle if narrowband
Figure 1: Four limits behind fibrillation maps: resolution, leakage, harmonics of sharp deflections, and phase that counts deflections.

Assumptions

How experts think

Before trusting a frequency or phase map, ask:

  1. How long is each record? That sets the resolution (Equation 1).
  2. Which window and how many averages? Leakage and variance follow (Equation 2, Equation 3).
  3. Is the signal sharp and zero-mean? Then its raw peak is a harmonic; check the preprocessing (Equation 4).
  4. Is the signal narrowband enough for Hilbert phase? If not, phase counts deflections (Equation 5).
  5. Does the rate change during the record? Use a time–frequency method and know its trade-off (Equation 6, Equation 7).

One sentence to keep: every spectrum and phase is a property of the record and the method as much as of the tissue.

Cheat sheet

Quantity Result
Resolution (Equation 1) \(\Delta f = 1/T\); zero padding interpolates only
Leakage (Equation 2) Rectangular: first null 1 bin, sidelobe −13.3 dB; Hann: 2 bins, −31.5 dB
Welch (Equation 3) spread \(1/\sqrt K\), resolution \(K/T\)
Pulse train (Equation 4) lines at \(m/T_0\) weighted by \(P(m/T_0)\); biphasic Gaussian derivative peaks at \(1/(2\pi w)\)
Analytic signal (Equation 5) \(z = x + j\mathcal H[x]\); one turn per cycle for narrowband signals only
Uncertainty (Equation 6) \(\sigma_t\sigma_f \ge 1/(4\pi)\), equality for a Gaussian
Morlet (Equation 7) \(f = \omega_0/(2\pi s)\); \(\omega_0 = 6\) common

Values used in this module

Value Source
Records longer than 2 s needed for reliable dominant frequency (one technical study) Ng et al. (2007)
Sidelobe levels, variance ratios, harmonic positions, phase-turn counts 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. You need to separate peaks 0.5 Hz apart. How long must the record be?

Model answer

About 2 s or more, since \(\Delta f = 1/T\) (Equation 1); a window widens the peaks further.

Q2. Does zero padding improve resolution?

Model answer

No. It samples the same spectrum more finely; separating peaks needs a longer record (Equation 1; lab part A).

Q3. Why use a Hann window instead of a rectangular one?

Model answer

Its sidelobes are about −31.5 dB instead of −13.3 dB and fall faster, so strong components leak less onto weak ones; the price is a main lobe twice as wide (Equation 2).

Q4. A longer record does not make your noise spectrum smoother. Why?

Model answer

Each periodogram bin is still one complex coefficient, so its spread equals its mean; only averaging (Welch) reduces it, as \(1/\sqrt K\) (Equation 3).

Q5. Why is the largest spectral peak of a raw bipolar electrogram train usually not the activation rate?

Model answer

Its lines are the rate’s harmonics weighted by the deflection’s spectrum; a sharp zero-mean deflection has no DC and peaks near \(1/(2\pi w)\), so a harmonic wins (Equation 4) (Ng et al. 2007).

Q6. What does band-pass, rectify, low-pass do to the spectrum?

Model answer

It turns each deflection into one positive bump, whose spectrum is largest at low frequency, so the line at the activation rate dominates (Equation 4; lab part D).

Q7. When does the Hilbert phase turn once per cycle?

Model answer

When the signal is narrowband, a carrier with a slowly varying envelope (Equation 5). Extra deflections or noise add turns.

Q8. How does m29 get usable phase from electrograms?

Model answer

It rebuilds the signal from one sine period per downstroke (sinusoidal recomposition) and takes the Hilbert phase of that (Kuklik et al. 2015); see eq-m29-recomposition.

Q9. State the time–frequency uncertainty relation.

Model answer

\(\sigma_t\sigma_f \ge 1/(4\pi)\), with equality for a Gaussian (Equation 6).

Q10. Why use wavelets rather than a short-time Fourier transform for a changing rate?

Model answer

Wavelets scale their window with frequency, keeping a constant number of cycles per window, so they track changes without one fixed trade-off for all frequencies (Equation 7).

Q11. What scale of a Morlet wavelet (ω0 = 6) matches 6 Hz?

Model answer

\(s = \omega_0/(2\pi f) = 6/(2\pi \cdot 6) \approx 0.16\) s (Equation 7).

Q12. Two dominant-frequency maps of the same patient disagree. What would you compare?

Model answer

Record lengths, windows and averaging, preprocessing, the search band and unipolar versus bipolar recording (Equation 1, Equation 3, Equation 4) (Ng et al. 2007).

Code lab

The lab tests each tool on signals whose answer is known.

Part What you do Data
A Resolution and zero padding (Equation 1) synthetic
B Windows and leakage: a weak tone next to a strong one (Equation 2) synthetic
C Periodogram variance and Welch averaging (Equation 3) synthetic
D Pulse trains: harmonics and preprocessing (Equation 4) synthetic
E Analytic signal: sinusoids, envelopes and electrogram-like trains (Equation 5) synthetic
F Uncertainty, the Morlet wavelet and a changing rate (Equation 6, Equation 7) 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 4-s record. Frequency resolution?

Answer

0.25 Hz (Equation 1).

S2. You average 16 segments. Spread of the spectrum relative to one periodogram?

Answer

A quarter (Equation 3).

S3. Cycle length 200 ms. Where are the spectral lines?

Answer

At 5 Hz and its multiples (Equation 4).

S4. A biphasic deflection of width 2 ms. Where does its spectrum peak?

Answer

Near \(1/(2\pi \cdot 0.002) \approx 80\) Hz (Equation 4).

S5. Hilbert transform of sin(ωt)?

Answer

\(-\cos\omega t\) (Equation 5).

S6. A Gaussian pulse’s RMS duration halves. Its RMS bandwidth?

Answer

Doubles (Equation 6).

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.

  • Dominant-frequency preprocessing. Ng and colleagues show raw and preprocessed electrograms with their spectra (Ng et al. 2007). This module: pulse trains.
  • Hilbert phase of contact electrograms. Kuklik and colleagues compare the phase of raw and recomposed signals (Kuklik et al. 2015). This module: the analytic signal.

Further reading

References

Everett, T H, L C Kok, R H Vaughn, et al. 2001. “Frequency Domain Algorithm for Quantifying Atrial Fibrillation Organization to Increase Defibrillation Efficacy.” IEEE Transactions on Biomedical Engineering 48 (9): 969–78. https://doi.org/10.1109/10.942586.
Gray, R A, A M Pertsov, and J Jalife. 1998. “Spatial and Temporal Organization During Cardiac Fibrillation.” Nature 392 (6671): 75–78. https://doi.org/10.1038/32164.
Kuklik, Pawel, Stef Zeemering, Bart Maesen, et al. 2015. “Reconstruction of Instantaneous Phase of Unipolar Atrial Contact Electrogram Using a Concept of Sinusoidal Recomposition and Hilbert Transform.” IEEE Transactions on Biomedical Engineering 62 (1): 296–302. https://doi.org/10.1109/TBME.2014.2350029.
Ng, Jason, and Jeffrey J Goldberger. 2007. “Understanding and Interpreting Dominant Frequency Analysis of AF Electrograms.” Journal of Cardiovascular Electrophysiology 18 (6): 680–85. https://doi.org/10.1111/j.1540-8167.2007.00832.x.
Ng, Jason, Alan H Kadish, and Jeffrey J Goldberger. 2007. “Technical Considerations for Dominant Frequency Analysis.” Journal of Cardiovascular Electrophysiology 18 (7): 757–64. https://doi.org/10.1111/j.1540-8167.2007.00810.x.
Sanders, Prashanthan, Omer Berenfeld, Mélèze Hocini, et al. 2005. “Spectral Analysis Identifies Sites of High-Frequency Activity Maintaining Atrial Fibrillation in Humans.” Circulation 112 (6): 789–97. https://doi.org/10.1161/CIRCULATIONAHA.104.517011.