Programmer Guide/SPU Reference/SSIGIN: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
 
(11 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}__NOTOC__
{{DISPLAYTITLE:{{SUBPAGENAME}}}}__NOTOC__
Read/Write signal from/to a wave item.
Read/write signal from/to a wave item.
{|class="keinrahmen"
==<code>[SPU RSIGIN <var>SIG REV L POS K D TYP</var> OUT <var>X1 .. X8 SR XMAX</var>]</code>==
|==<code>[SPU RSIGIN <var>SIG REV L POS K D TYP</var> OUT <var>X1 .. X8 SR XMAX</var>]</code>==
|}
:'''Random read''': Read signal frames from selected position <var>POS</var>. The frame addresses the signal from <var>POS</var>-<var>L</var>/2 to <var>POS</var>+<var>L</var>/2-1
==<code>[SPU ASIGIN <var>SIG REV L K D TYP</var> OUT <var>X1 .. X8 SR N I XMAX</var>]</code>==
==<code>[SPU ASIGIN <var>SIG REV L K D TYP</var> OUT <var>X1 .. X8 SR N I XMAX</var>]</code>==
:'''Absolute read''': Read signal frames without overlap. Frame <var>I</var> addresses the signal from <var>I</var>*<var>L</var> to (<var>I</var>+1)*<var>L</var>-1.
==<code>[SPU CSIGIN <var>SIG REV L S K D TYP</var> OUT <var>X1 .. X8 SR N I XMAX</var>]</code>==
==<code>[SPU CSIGIN <var>SIG REV L S K D TYP</var> OUT <var>X1 .. X8 SR N I XMAX</var>]</code>==
:'''Centered read''': Read overlapping signal frames. Frame I addresses the signal from <var>I</var>*<var>S</var>-<var>L</var>/2 to <var>I</var>*<var>S</var>+<var>L</var>/2-1. All samples outside the address range of the wave item are set to 0.
==<code>[SPU SSIGIN <var>SIG REV L S K D TYP</var> OUT <var>X1 .. X8 SR N I XMAX</var>]</code>==
==<code>[SPU SSIGIN <var>SIG REV L S K D TYP</var> OUT <var>X1 .. X8 SR N I XMAX</var>]</code>==
:'''Shifted read''': Read overlapping signal frames. Frame I addresses the signal from <var>I</var>*<var>S</var>-(<var>L</var>-<var>S</var>) to <var>I</var>*<var>S</var>+<var>L</var>/2-1. All samples outside the address range of the wave item are set to 0.
==<code>[SPU SIGOUT <var>SIG X1 .. X8</var> OUT <var>SR I XMAX</var>]</code>==
==<code>[SPU SIGOUT <var>SIG X1 .. X8</var> OUT <var>SR I XMAX</var>]</code>==
:'''Shifted read''': Read overlapping signal frames. Frame I addresses the signal from <var>I</var>*<var>S</var>-(<var>L</var>-<var>S</var>) to <var>I</var>*<var>S</var>+<var>L</var>/2-1. All samples outside the address range of the wave item are set to 0.
 
{|class="einrahmen"
|
!description !!frame position
|-
!RSIGIN
|random read &rarr; read frame centered around position <var>POS</var>
|<var>POS</var>-<var>L</var>/2 .. <var>POS</var>+<var>L</var>/2-1<BR>0 &le; <var>POS</var> &lt; <var>SIG</var>[!length]
|-
!ASIGIN
|absolute read &rarr; read frames (blocks) without overlap
|<var>I</var>*<var>L</var>/2 .. <var>POS</var>+<var>L</var>/2-1<BR>0 &le; <var>POS</var> &lt; <var>SIG</var>[!length]
|}
 
 


{|class="einrahmen"
{|class="einrahmen"
Line 132: Line 140:
[[File:1310.png]]
[[File:1310.png]]


Frame partitioning method used by SSIGIN=====Notes:=====
Frame partitioning method used by SSIGIN
 
=====Notes:=====


This read function is currently not used, because specialized signal-I/O (analysis/re-synthesis) atoms for the filter methods have been implemented. The values of the outputs <var>SR</var> and <var>N</var> are set during the initialization. The output <var>I</var> is initialized to 0 and incremented by 1 after each read cycle. The input <var>REV</var> can be used to reverse the signal in time.
This read function is currently not used, because specialized signal-I/O (analysis/re-synthesis) atoms for the filter methods have been implemented. The values of the outputs <var>SR</var> and <var>N</var> are set during the initialization. The output <var>I</var> is initialized to 0 and incremented by 1 after each read cycle. The input <var>REV</var> can be used to reverse the signal in time.

Latest revision as of 19:43, 10 May 2011

Read/write signal from/to a wave item.

[SPU RSIGIN SIG REV L POS K D TYP OUT X1 .. X8 SR XMAX]

[SPU ASIGIN SIG REV L K D TYP OUT X1 .. X8 SR N I XMAX]

[SPU CSIGIN SIG REV L S K D TYP OUT X1 .. X8 SR N I XMAX]

[SPU SSIGIN SIG REV L S K D TYP OUT X1 .. X8 SR N I XMAX]

[SPU SIGOUT SIG X1 .. X8 OUT SR I XMAX]

description frame position
RSIGIN random read → read frame centered around position POS POS-L/2 .. POS+L/2-1
0 ≤ POS < SIG[!length]
ASIGIN absolute read → read frames (blocks) without overlap I*L/2 .. POS+L/2-1
0 ≤ POS < SIG[!length]


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. The output Y has always the same type as A.

COND Assignment
0 or < {\displaystyle Y_{i}={\begin{cases}C_{[i]}&{\mbox{if }}A_{i}<B_{[i]}\\A_{i}&{\mbox{otherwise}}\end{cases}}}
1 or > {\displaystyle Y_{i}={\begin{cases}C_{[i]}&{\mbox{if }}A_{i}>B_{[i]}\\A_{i}&{\mbox{otherwise}}\end{cases}}}
2 or {\displaystyle Y_{i}={\begin{cases}C_{[i]}&{\mbox{if }}A_{i}\leqslant B_{[i]}\\A_{i}&{\mbox{otherwise}}\end{cases}}}
3 or {\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>



SSIGIN - read signal (for filters, ...)

Usage:

SSIGIN SIG REV L S K D

Inputs:
SIG name of shell-wave-item no default
REV 0, YES|1) def.=NO
L frame length in samples (>=4) def.=1024
S frame shift in samples (1 <= S <= L) def.=L/4
K amplification factor def.=1
D differentiation factor (0..1) def.=0
Outputs:
Xi signal of channel i (L samples)
SR sampling rate in Hz
N number of frames
I frame counter (0..N)
Function:

This atom implements an alternative signal-frame read function that can be used instead of CSIGN. The frame-splitting method is designed to be used for filter or other frequency-domain processing methods. The partitioning of the signal is similar to the method used by the phase vocoder, but no windowing or other processing is applied to the frames. The picture below shows the frame partitioning method:

1310.png

Frame partitioning method used by SSIGIN

Notes:

This read function is currently not used, because specialized signal-I/O (analysis/re-synthesis) atoms for the filter methods have been implemented. The values of the outputs SR and N are set during the initialization. The output I is initialized to 0 and incremented by 1 after each read cycle. The input REV can be used to reverse the signal in time.

Navigation menu

Personal tools