SIN 算子

Operator Library: Arithmetics

该算子用于计算输入值的正弦值。

正弦函数的输入范围为 [-\u221e, \u221e]。\n \t\t\t由于正弦函数的周期性,VisualApplets 算子的输入范围被限制在 [-\u03c0, \u03c0] 内\n \t\t\t即输入的最小值为 -\u03c0,输入的最大值加 1 为 \u03c0。\n \t\t\t因此,输入端不可能出现 +\u03c0 的值。

因此,正弦函数的自变量 x 由以下公式确定

其中

是输入 link 上的 Bit Width。

正弦函数的结果范围为 [-1, 1]。\n \t\t\t该算子在 VisualApplets 中的输出值范围映射为

其中

is the bit width at the output link. Thus the output value is

下图显示了正弦函数的曲线图。

In the next figure, the VisualApplets operator implementation is shown. Note the input and output bit widths.

我们来看一个输入像素值。例如 -50。\n \t\t\t在给定的 Bit Width 为 8 的情况下,像素值的实际值表示形式为 -50 * pi / 128。\n \t\t\t随后的正弦计算结果将为 -0.94。\n \t\t\t在像素值表示中,该结果变为 -121,这与曲线图中显示的一致。

I/O Property

Property 值
Operator Type O
Input Link I,数据输入
Output Link O,数据输出

Supported Link Format

Link Parameter Input Link I Output Link O
Bit Width [8, 12] [8, 32]
Arithmetic signed signed
Parallelism any as I
Kernel Columns 1 as I
Kernel Rows 1 as I
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} as I
Color Format VAF_GRAY as I
Color Flavor FL_NONE as I
Max. Img Width any as I
Max. Img Height any as I

参数

无

使用示例

以下示例展示了 SIN 算子的使用方法: