# complex_pwc_signal¶

static OperationNamespace.complex_pwc_signal(moduli, phases, duration, *, name=None)

Creates a complex piecewise-constant signal from moduli and phases.

Use this function to create a complex piecewise-constant signal from moduli and phases defined for each segment, in which the constant segments all have the same duration.

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

• phases (np.ndarray(real) or Tensor(real)) – The phases $$\{\phi_n\}$$ of the complex segment values. Must have the same length as moduli (or same shape, if you’re providing a batch).

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

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

Returns

The piecewise-constant function of time $$v(t)$$, satisfying $$v(t)=\Omega_n e^{i\phi_n}$$ for $$t_{n-1}\leq t\leq t_n$$, where $$t_n=n\tau/N$$ (where $$N$$ is the number of values in $$\{\Omega_n\}$$ and $$\{\phi_n\}$$). If you provide a batch of moduli and phases, the returned TensorPwc represents a corresponding batch of $$B_1 \times \ldots \times B_n$$ functions $$v(t)$$.

Return type

TensorPwc(complex)

pwc_signal()