# Hilbert Transform

Hilbert Transform is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Runs Ehlers' Hilbert transform cycle engine on the bar midpoint: a homodyne discriminator measures the dominant cycle period, clamped to 6-50 bars, and the pane plots either the sinewave with its 45-degree lead line or the period estimate itself. A 6 dB signal-to-noise gate dims output when cycle amplitude is noise, a background flags trend mode, and a dashboard reports period, phase, amplitude, SNR and mode.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Feb 15, 2026.
- Access: free.
- Concepts: [Hilbert Transform](https://www.luxalgo.com/library/concept/hilbert-transform/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=jyqod10pgky38mx5agvwcz1f
- Page: https://www.luxalgo.com/library/indicator/hilbert-transform/

**Hilbert Transform** packages the [Hilbert transform](https://www.luxalgo.com/library/concept/hilbert-transform/) cycle engine as an honestly guarded pane tool. The source is smoothed, detrended and run through Ehlers' published quadrature filters; a homodyne discriminator turns per-bar phase advance into a dominant cycle period, clamped to the measurable 6-50 bar band. From the measured phase come two pane views: the sinewave with a lead line running 45 degrees ahead, or the period estimate itself. Two guards keep the output honest: a signal-to-noise gate that dims everything when cycle amplitude is too small to trust, and a trend-mode background flagging when phase stops advancing at the cycle rate.

## How to Trade the Hilbert Transform?

- **Lead crosses above the sinewave**: an anticipated cycle trough, covered by the Cycle Turn Up alert.
- **Lead crosses under the sinewave**: the anticipated crest, mirrored by Cycle Turn Down.
- **Trend-mode background on**: phase has stalled against the expected rate. Ignore sinewave crossings and switch to trend tactics.
- **Dimmed pane**: SNR sits below the threshold; phase readings are noise, so cycle tactics go on hold.

The Dominant Cycle Period view is the lookback an adaptive tool would inherit.

## Hilbert Transform Settings

- **Source** (default hl2): the bar midpoint the published designs assume.
- **Min Period** (default 6) and **Max Period** (default 50): clamps of the measured period.
- **Dim Output Below SNR Threshold** (default enabled) with **SNR Threshold (dB)** (default 6.0): the amplitude gate; SNR alerts fire whether or not dimming is on.
- **Pane Output** (default Sinewave): sinewave plus lead line, or the dominant cycle period.
- **Display & style toggles**: turn markers off, trend-mode highlight on, dashboard on, gradient fill on.

## Frequently Asked Questions

### How does this compare with the Even Better Sinewave?
The [Even Better Sinewave](https://www.luxalgo.com/library/indicator/even-better-sinewave/), a later Ehlers design, shapes its wave through a fixed filter chain rather than measuring the cycle first. This build measures the dominant period explicitly and exposes it, so the pane doubles as a cycle-length instrument.

### Why is the period clamped to 6-50 bars?
Under roughly 6 bars the short quadrature filters see too few samples per cycle to resolve its phase; past roughly 50 the approximation drifts. Longer rhythms are better measured on a higher timeframe than by stretching the clamp.

### What does trend mode mean?
The discriminator expects phase to advance about 360 degrees over one measured period. When that advance stalls with no recent sinewave crossing, the market is trending rather than cycling, the mode where acting on cycle turns is the classic mistake.

## Related indicators

- [Spline Quantile Regression Channel](https://www.luxalgo.com/library/indicator/spline-quantile-regression-channel/) (Polynomial Regression): markdown at https://www.luxalgo.com/library/indicator/spline-quantile-regression-channel.md
- [Bitcoin Power Law](https://www.luxalgo.com/library/indicator/bitcoin-power-law/) (Linear Regression): markdown at https://www.luxalgo.com/library/indicator/bitcoin-power-law.md
- [Recursive Least Squares Forecast](https://www.luxalgo.com/library/indicator/recursive-least-squares-forecast/) (Linear Regression): markdown at https://www.luxalgo.com/library/indicator/recursive-least-squares-forecast.md
- [Adaptive Harmonic Forecast](https://www.luxalgo.com/library/indicator/adaptive-harmonic-forecast/) (FFT/spectral Analysis): markdown at https://www.luxalgo.com/library/indicator/adaptive-harmonic-forecast.md
- [Kalman Filter](https://www.luxalgo.com/library/indicator/kalman-filter/) (Statistics): markdown at https://www.luxalgo.com/library/indicator/kalman-filter.md
- [Bitcoin Expectile Model](https://www.luxalgo.com/library/indicator/bitcoin-expectile-model/) (Quantile Regression): markdown at https://www.luxalgo.com/library/indicator/bitcoin-expectile-model.md
- [Rolling Segment](https://www.luxalgo.com/library/indicator/rolling-segment/) (Linear Regression): markdown at https://www.luxalgo.com/library/indicator/rolling-segment.md
- [Daily Polynomial Regressions](https://www.luxalgo.com/library/indicator/daily-polynomial-regressions/) (Polynomial Regression): markdown at https://www.luxalgo.com/library/indicator/daily-polynomial-regressions.md

---

Source: https://www.luxalgo.com/library/indicator/hilbert-transform/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
