Operator COS

Operator Library: Arithmetics

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

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

因此,余弦函数的参数 x 由下式决定:

其中

是输入 link 上的 Bit Width。

余弦函数的结果在 [-1, 1] 范围内。 算子在 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。 在给定的 8 Bit Width 输入下,该像素值的实际值表示为 -50 * pi / 128。 然后余弦结果将为 0.33。 在像素值表示中,该结果变为 43,这与图表中显示的一致。

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

参数

无

使用示例

以下示例展示了 COS 算子的使用: