Programmer Guide/SPU Reference/MASKABC: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 45: Line 45:
|-
|-
|<code>3</code> or <code>&ge;</code>
|<code>3</code> or <code>&ge;</code>
|<math>Y_i=\begin{cases}
C_{[i]} & \mbox{if }A_i \geqslant B_{[i]} \\
A_i & \mbox{otherwise}
\end{cases}
</math>
|}
|}



Revision as of 13:56, 6 May 2011

Data masking / thresholding.

[SPU MASKABC A B SEL OUT Y]

input description data type value type default value
A input data number, vector variable
B masker or threshold number, vector variable
C replacement data number, vector variable
COND condition number (int.), string variable 0
output description data type value type comment
Y masked data same type as A variable
Description

If the condition defined by COND is true, Ci is assigned to Yi, otherwise Yi is set to Ai. If A is a vector, the inputs B and C can be numbers or vectors with the same length as A.

COND Assignment
0 or < Yi={C[i]if Ai<B[i]Aiotherwise
1 or > Yi={C[i]if Ai>B[i]Aiotherwise
2 or Yi={C[i]if Ai⩽B[i]Aiotherwise
3 or Yi={C[i]if Ai⩾B[i]Aiotherwise
See also

<SP-atoms>

Navigation menu

Personal tools