Convert
- class npdsp.Convert(dtype: DTypeLike, name: str | None = None)[source]
Convert the data type of a signal.
- Parameters:
dtype (numpy.typing.DTypeLike) – NumPy data type to convert the input signal to.
name (str, optional) – Optional name used to identify the block within a pipeline.
Notes
Conversion uses
numpy.ndarray.astype()withcopy=False. NumPy may still create a copy when the requested data type differs from the input data type.Examples
>>> block = Convert(np.float32) >>> block([1, 2, 3]).dtype dtype('float32')