CosineRiseFall

Contents

CosineRiseFall#

class iqm.models.playlist.waveforms.CosineRiseFall(n_samples, full_width, rise_time, center_offset=0.0)#

Bases: Waveform

Waveform that has a sinusoidal rise and fall, and a constant part in between.

\[\begin{split}f(t) = \begin{cases} \frac{1}{2}(1 + \cos(\pi (t - c + p / 2) / r)) & t - (c - p / 2) \in [-r, 0]\\ 1 & t - c \in [-p / 2, p / 2]\\ \frac{1}{2}(1 + \cos(\pi (t - c - p / 2) / r)) & t - (c + p / 2) \in [0, r]\\ 0 & \text{otherwise} \end{cases}\end{split}\]

where \(c\) is center_offset, \(r\) is rise_time, and \(p\) is the plateau width, calculated via \(p :=\) full_width - 2 * rise_time.

Its values are in \([0, 1]\).

Parameters:
  • full_width (float) – Duration of the support of the pulse, >= 2 * rise_time.

  • rise_time (float) – Duration of the sinusoidal rise (and fall) part of the waveform, >= 0.

  • center_offset (float) – The waveform is centered at this offset from the midpoint of the sampling window.

  • n_samples (int)

Module: iqm.models.playlist.waveforms

Attributes

center_offset

full_width

rise_time

n_samples

Requested number of samples for the waveform.

Methods