The Detrended Synthetic Price (DSP) is a cycle analysis indicator developed by John Ehlers that isolates the cyclical component of price action by subtracting a slower-period EMA from a faster-period EMA. Introduced in his work on digital signal processing for traders, DSP creates a band-pass filter effect that removes both long-term trends and short-term noise, revealing the dominant market cycle.
Unlike traditional detrending methods that use high-pass filters, Ehlers' DSP uses the difference between a quarter-cycle EMA and a half-cycle EMA relative to the dominant cycle period. This creates an in-phase output that oscillates around zero, with the amplitude and frequency revealing information about cycle strength and timing. The quarter-cycle smoother responds quickly to price changes while the half-cycle smoother provides the baseline reference, and their difference creates the band-pass effect.
DSP serves as both a standalone cycle indicator and a foundational component for more advanced Ehlers indicators. By isolating the dominant cycle component, it provides a clearer view of market rhythms without the contamination of longer-term trends or higher-frequency noise.
## Core Concepts
* **Dual-EMA Structure:** Uses two independent EMAs at quarter-cycle (P/4) and half-cycle (P/2) periods derived from the dominant cycle
* **Band-Pass Effect:** Quarter-cycle minus half-cycle creates a filter that passes the dominant cycle while attenuating trends and noise
* **In-Phase Output:** The resulting oscillator is in-phase with the dominant cycle, providing clear timing signals
* **Zero-Crossing Analysis:** Oscillations around zero line reveal cycle phase and potential reversal points
* **Cycle Isolation:** Mathematically isolates the periodic component that matches the specified dominant cycle period
## Common Settings and Parameters
| Parameter | Default | Function | When to Adjust |
| Dominant Cycle Period | 40 | Period used to calculate quarter-cycle and half-cycle EMAs | Should match actual market cycle: 20-30 for faster cycles, 40-50 for standard, 60-80 for slower cycles |
**Pro Tip:** The Dominant Cycle Period should ideally be obtained from HT_DCPERIOD or other cycle measurement tools for adaptive behavior. For fixed analysis, 40 bars works well for daily charts (approximates a 2-month cycle). The quarter-cycle EMA (P/4 = 10) responds to short-term moves while the half-cycle EMA (P/2 = 20) provides the baseline, creating the band-pass effect.
## Calculation and Mathematical Foundation
**Simplified explanation:**
DSP calculates two EMAs at periods that are fractions of the dominant cycle (quarter and half), then subtracts the slower from the faster to create an oscillator that isolates the cyclical component.
**Technical formula:**
1. Calculate quarter-cycle and half-cycle periods from dominant cycle:
```
Fast_Period = round(Period / 4)
Slow_Period = round(Period / 2)
```
2. Calculate alpha values for both EMAs:
```
Alpha_Fast = 2 / (Fast_Period + 1)
Alpha_Slow = 2 / (Slow_Period + 1)
```
3. Apply exponential smoothing with warmup compensation:
```
EMA_Fast = EMA(Price, Fast_Period)
EMA_Slow = EMA(Price, Slow_Period)
```
4. Calculate DSP as the difference:
```
DSP = EMA_Fast - EMA_Slow
```
> 🔍 **Technical Note:** The implementation uses unified warmup compensation to ensure both EMAs produce valid outputs from bar 1. The quarter-cycle EMA provides rapid response to price changes while the half-cycle EMA establishes the reference baseline. Their difference creates a band-pass filter centered on the dominant cycle period, effectively removing both low-frequency trends (longer than the cycle) and high-frequency noise (shorter than the cycle).
## Interpretation Details
DSP provides cycle-focused market analysis through the isolated cyclical component:
| Batch parallelism | ❌ | Sequential dependency on previous EMA state |
**FMA Optimization:** Each EMA can use single FMA instruction: `fma(α, price, (1-α) × prev)`, reducing 2 MUL + 1 ADD to 1 FMA + 1 MUL (~11 cycles total).