MASKABC
From STX Wiki
Jump to navigationJump to search
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<
Y i = { C [ i ] if A i < B [ i ] A i otherwise {\displaystyle Y_{i}={\begin{cases}C_{[i]}&{\mbox{if }}A_{i}<B_{[i]}\\A_{i}&{\mbox{otherwise}}\end{cases}}} 1
or>
Y i = { C [ i ] if A i > B [ i ] A i otherwise {\displaystyle Y_{i}={\begin{cases}C_{[i]}&{\mbox{if }}A_{i}>B_{[i]}\\A_{i}&{\mbox{otherwise}}\end{cases}}} 2
or≤
Y i = { C [ i ] if A i ⩽ B [ i ] A i otherwise {\displaystyle Y_{i}={\begin{cases}C_{[i]}&{\mbox{if }}A_{i}\leqslant B_{[i]}\\A_{i}&{\mbox{otherwise}}\end{cases}}} 3
or≥
Y i = { C [ i ] if A i ⩾ B [ i ] A i otherwise {\displaystyle Y_{i}={\begin{cases}C_{[i]}&{\mbox{if }}A_{i}\geqslant B_{[i]}\\A_{i}&{\mbox{otherwise}}\end{cases}}}
- with: 0 ≤ i < length of A; [i] means: index is used only if the input is a vector
- See also
<SP-atoms>