Phase functions of frequency sweeps (chirps), used by fastmath.signal/chirp.
Every constructor takes an options map and returns a function of time t giving the phase in cycles; sin(2 pi phase(t)) is the chirp, the instantaneous frequency is the derivative of the phase. The sweeps are the ones of scipy.signal.chirp (which uses cosine and a phase in degrees):
:time - time t1 at which the frequency reaches :f1 (default 1.0), must be positive:f0 - frequency at t = 0, :f1 - frequency at t = t1:phase0 - phase offset in cycles (default 0.0)Throws ex-info for a non-positive :time and for non-positive frequencies of logarithmic and hyperbolic sweeps.
Phase functions of frequency sweeps (chirps), used by `fastmath.signal/chirp`. Every constructor takes an options map and returns a function of time `t` giving the phase in cycles; `sin(2 pi phase(t))` is the chirp, the instantaneous frequency is the derivative of the phase. The sweeps are the ones of `scipy.signal.chirp` (which uses cosine and a phase in degrees): * `:time` - time `t1` at which the frequency reaches `:f1` (default 1.0), must be positive * `:f0` - frequency at `t = 0`, `:f1` - frequency at `t = t1` * `:phase0` - phase offset in cycles (default 0.0) Throws `ex-info` for a non-positive `:time` and for non-positive frequencies of logarithmic and hyperbolic sweeps.
(->constant)(->constant {:keys [f0 phase0] :or {f0 0.0 phase0 0.0}})Constant frequency :f0 (default 0.0): phase phase0 + f0 t.
Constant frequency `:f0` (default 0.0): phase `phase0 + f0 t`.
(->hyperbolic)(->hyperbolic {:keys [time f0 f1 phase0]
:or {time 1.0 f0 1.0E-10 f1 5.0 phase0 0.0}})Hyperbolic sweep, frequency f0 f1 t1 / ((f0 - f1) t + f1 t1); constant f0 when f0 = f1. Beyond the singularity t = f1 t1 / (f1 - f0) the phase uses the absolute value of the logarithm argument, as scipy. Frequencies must be positive. Defaults: :f0 1e-10, :f1 5.0, :time 1.0.
Hyperbolic sweep, frequency `f0 f1 t1 / ((f0 - f1) t + f1 t1)`; constant `f0` when `f0 = f1`. Beyond the singularity `t = f1 t1 / (f1 - f0)` the phase uses the absolute value of the logarithm argument, as scipy. Frequencies must be positive. Defaults: `:f0` 1e-10, `:f1` 5.0, `:time` 1.0.
(->linear)(->linear {:keys [time f0 f1 phase0] :or {time 1.0 f0 0.0 f1 5.0 phase0 0.0}})Linear sweep, frequency f0 + (f1 - f0) t / t1. Defaults: :f0 0.0, :f1 5.0, :time 1.0.
Linear sweep, frequency `f0 + (f1 - f0) t / t1`. Defaults: `:f0` 0.0, `:f1` 5.0, `:time` 1.0.
(->logarithmic)(->logarithmic {:keys [time f0 f1 phase0]
:or {time 1.0 f0 1.0E-10 f1 5.0 phase0 0.0}})Exponential (geometric) sweep, frequency f0 (f1/f0)^(t/t1); constant f0 when f0 = f1. Frequencies must be positive. Defaults: :f0 1e-10, :f1 5.0, :time 1.0.
Exponential (geometric) sweep, frequency `f0 (f1/f0)^(t/t1)`; constant `f0` when `f0 = f1`. Frequencies must be positive. Defaults: `:f0` 1e-10, `:f1` 5.0, `:time` 1.0.
(->quadratic-down)(->quadratic-down {:keys [time f0 f1 phase0]
:or {time 1.0 f0 0.0 f1 5.0 phase0 0.0}})Quadratic sweep with the parabola vertex at t = t1 (scipy vertex_zero=False), frequency f1 + (f0 - f1) (t1 - t)^2 / t1^2. Defaults: :f0 0.0, :f1 5.0, :time 1.0.
Quadratic sweep with the parabola vertex at `t = t1` (`scipy` `vertex_zero=False`), frequency `f1 + (f0 - f1) (t1 - t)^2 / t1^2`. Defaults: `:f0` 0.0, `:f1` 5.0, `:time` 1.0.
(->quadratic-up)(->quadratic-up {:keys [time f0 f1 phase0]
:or {time 1.0 f0 0.0 f1 5.0 phase0 0.0}})Quadratic sweep with the parabola vertex at t = 0 (scipy vertex_zero=True), frequency f0 + (f1 - f0) t^2 / t1^2. Defaults: :f0 0.0, :f1 5.0, :time 1.0.
Quadratic sweep with the parabola vertex at `t = 0` (`scipy` `vertex_zero=True`), frequency `f0 + (f1 - f0) t^2 / t1^2`. Defaults: `:f0` 0.0, `:f1` 5.0, `:time` 1.0.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |