TimePhasor§

class typed_lisa_toolkit.types.TimePhasor[AxisT: AnyAxis][source]§

Time-domain phasor representation.

Note

To construct a TimePhasor, use the factory function time_phasor().

A phasor is a couple of amplitude and phase that represent a complex number. This class encapsulates a sequence of phasors at different times, which can be used to represent a waveform. This representation is useful for interpolating waveforms generated on a sparse grid of times to a dense grid of times.

The input phases are expected to be smooth, without zigzags, so as the real and imaginary parts of the amplitudes. This is crucial for the interpolation to work properly.

Note

The so-called amplitude is itself complex number in general.

classmethod make(*, axis: Axis[Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]] | Linspace, ModuleType], amplitudes: Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]], phases: Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]])§

Create a phasor from amplitudes and phases.

create_like(entries: Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]])§

Create a new instance with the same grid as the current one.

get_embedded(embedding_grid: Grid1D, *, known_slices: tuple[slice, ...] | None = None) Self§

Return the phasor embedded in a new 1D grid.

get_interpolated(axis_: AT, interpolator: Callable[[Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]], Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]]], Callable[[Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]]], Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]]]]) TimePhasor[AT][source]§
get_interpolated(axis_: Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]], interpolator: Callable[[Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]], Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]]], Callable[[Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]]], Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]]]]) TimePhasor[Axis[Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]], ModuleType]]

Get the phasors interpolated to the given times.

get_kernel() Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]]§

Return the entries of the representation.

get_subset(*, interval: tuple[float, float] | None = None, slice: slice | None = None, copy: bool = True) Self§

Return the subset as a new instance.

to_series()[source]§

Alias for to_time_series().

to_time_series()[source]§

Convert to a TimeSeries or UniformTimeSeries.

This method returns a TimeSeries or UniformTimeSeries by applying the formula:

\[X(t) = A(t) \cdot \exp(1j \cdot \phi(t))\]
property amplitudes: Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]]§

The amplitudes of the phasors.

property domain: Literal['time']§

The physical domain of the representation.

property kind: Literal['phasor']§

The semantic kind of the representation.

property n_batches: int | None§

Return the number of batches.

property n_channels: int | None§

Return the number of channels.

property n_features: int | None§

Return the number of features.

property n_harmonics: int | None§

Return the number of harmonics.

property phases: Array[Any, ModuleType] | ndarray[tuple[Any, ...], dtype[Any]]§

The phases of the phasors.

property t_end: float§

The end time of the series.

property t_start: float§

The onset time of the series.

property times: AxisT§

The times of the phasors.