# pwc_signal¶

Graph.pwc_signal(values, duration, *, name=None)

Creates a piecewise-constant signal (scalar-valued function of time).

Use this function to create a piecewise-constant signal in which the constant segments all have the same duration.

Parameters
• values (np.ndarray or Tensor) – The values $$\{\alpha_n\}$$ of the $$N$$ constant segments. These can represent either a single sequence of segment values or a batch of them. To create a batch of $$B_1 \times \ldots \times B_n$$ signals, represent these values as a tensor of shape $$B_1 \times \ldots \times B_n \times N$$.

• duration (float) – The total duration $$\tau$$ of the signal.

• name (str, optional) – The name of the node.

Returns

The piecewise-constant function of time $$\alpha(t)$$, satisfying $$\alpha(t)=\alpha_n$$ for $$t_{n-1}\leq t\leq t_n$$, where $$t_n=n\tau/N$$ (where $$N$$ is the number of values in $$\{\alpha_n\}$$). If you provide a batch of values, the returned Pwc represents a corresponding batch of $$B_1 \times \ldots \times B_n$$ functions $$\alpha(t)$$.

Return type

Pwc

complex_pwc_signal()

Create complex Pwc signals from their moduli and phases.

pwc()

Corresponding operation with support for segments of different durations.

pwc_operator()

Create Pwc operators.

pwc_sum()

Sum multiple Pwcs.

symmetrize_pwc()

Symmetrize Pwcs.