Programmer Guide/SPU Reference/MASKABC: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 19: Line 19:


;Description:
;Description:
If the condition defined by <var>COND</var> is true, <var>C</var><sub>i</sub> is assigned to <var>Y</var><sub>i</sub>, otherwise <var>Y</var><sub>i</sub> is set to <var>A</var><sub>i</sub>
If the condition defined by <var>COND</var> is true, <var>C</var><sub>i</sub> is assigned to <var>Y</var><sub>i</sub>, otherwise <var>Y</var><sub>i</sub> is set to <var>A</var><sub>i</sub>. If <var>A</var> is a vector, the inputs <var>B</var> and <var>C</var> can be numbers or vectors with the same length as <var>A</var>.
 
:{|class="einrahmen"
 
!COND !!Assignment
{|class="einrahmen"
!SEL
! <var>Y<sub>number</sub></var>=f(<var>A<sub>number</sub></var>,<var>B<sub>number</sub></var>)
! <var>Y<sub>vector</sub></var>=f(<var>A<sub>vector</sub></var>,<var>B<sub>number</sub></var>)
! <var>Y<sub>number</sub></var>=f(<var>A<sub>vector</sub></var>,<var>B<sub>vector</sub></var>)
|-
|-
|<code>0</code> or <code>A</code>
|<code>0</code> or <code>&lt;</code>
|<var>Y</var> = <var>A</var>
|<var>Y</var>[i] = <var>A</var>[i]
|<var>Y</var>[i] = <var>A</var>[i]
|-
|-
|<code>1</code> or <code>B</code>
|<code>1</code> or <code>&gt;</code>
|<var>Y</var> = <var>B</var>
|<var>Y</var>[i] = <var>B</var>
|<var>Y</var>[i] = <var>B</var>[i]
|-
|-
|<code>2</code> or <code>minimum</code>
|<code>2</code> or <code>&le;</code>
|<var>Y</var> = min(<var>A</var>,<var>B</var>)
|<var>Y</var>[i] = min(<var>A</var>[i],<var>B</var>)
|<var>Y</var>[i] = min(<var>A</var>[i],<var>B</var>[i])
|-
|-
|<code>3</code> or <code>maximum</code>
|<code>3</code> or <code>&ge;</code>
|<var>Y</var> = max(<var>A</var>,<var>B</var>)
|<var>Y</var>[i] = max(<var>A</var>[i],<var>B</var>)
|<var>Y</var>[i] = max(<var>A</var>[i],<var>B</var>[i])
|}
|}
with: 0 &le; i &lt; length of <var>A<sub>vector</sub></var>
 
;See also:
;See also:
<[[../#Signal Processing Atoms|SP-atoms]]>; [[../MASKABC]]
<[[../#Signal Processing Atoms|SP-atoms]]>
<!-- AN, 2.5.2011 -->
<!-- AN, 2.5.2011 -->

Revision as of 14:47, 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 <
1 or >
2 or
3 or
See also

<SP-atoms>

Navigation menu

Personal tools