  Light curves of astrophysical objects frequently contain strictly periodic
signals. In those cases we can use that property to aid the detrending
algorithm to fully disentangle an unknown periodic signal and an unknown
baseline signal with no power at that period. The periodic signal is modeled as
a discrete probability distribution function (pdf), while the baseline signal
is modeled as a residual timeseries. Those two components are disentangled by
minimizing the length of the residual timeseries w.r.t. the per-bin pdf fluxes.
We demonstrate the use of the algorithm on a synthetic case, on the eclipsing
binary KIC 3953981 and on the eccentric ellipsoidal variable KIC 3547874. We
further discuss the parameters and the limitations of the algorithm and
speculate on the two most common use cases: detrending the periodic signal of
interest and measuring the dependence of instrumental response on controlled
instrumental variables. A more sophisticated version of the algorithm is
released as open source on github and available via pip.
