Programmer Guide/SPU Reference/LIMITER: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
Level meter (PPM). This atom is used for the level display in the recorder application.
Apply limiter function to a signal.
==<code>[SPU PPM <var>X TYPE T UNIT REF SIZE</var> OUT <var>Y M P</var>]</code>==
==<code>[SPU LIMITER <var>X TYPE MAX LIM</var> OUT <var>Y Q</var>]</code>==
{|class="einrahmen"
{|class="einrahmen"
!input !!description !!data type !!value type!!default value
!input !!description !!data type !!value type!!default value
Line 20: Line 20:
|}
|}
;Description:
;Description:
This SP-atom applies a non-linear magnitude weighting (= limiter function) to the signal. The limiter function is only applied if the absolute value of the signal magnitude is higher than the specified limiter start magnitude <var>LIM</var>. For the limiter function, the following algorithm is used:
<math>y_i = \begin{cases}
x_i  & \mbox{if }|x_i|\leslant LIM \\
3n+1, & \mbox{if }n\mbox{ is odd}
\end{cases}
</math>
The level meter value ''v''<sub>t</sub> (t = sample index) is computed for each value ''x''<sub>t</sub> of the input signal <var>X</var>. The last ''v''<sub>t</sub> of an evaluation cycle is used to update the outputs <var>Y</var> and <var>P</var>.
The level meter value ''v''<sub>t</sub> (t = sample index) is computed for each value ''x''<sub>t</sub> of the input signal <var>X</var>. The last ''v''<sub>t</sub> of an evaluation cycle is used to update the outputs <var>Y</var> and <var>P</var>.
:{|class="einrahmen"
:{|class="einrahmen"
Line 49: Line 56:


The output <var>M</var> is the maximum of all computed ''v''<sub>t</sub> values converted to the selected output unit.
The output <var>M</var> is the maximum of all computed ''v''<sub>t</sub> values converted to the selected output unit.
;See also:
 
<[[../#Signal Processing Atoms|SP-atoms]]>
<!-- AN, 2.5.2011 -->




Line 58: Line 63:
====LIMITER - amplitude limiter (non-linear)====
====LIMITER - amplitude limiter (non-linear)====


The <code>LIMITER</code> spatom applies a non-linear magnitude weighting to the signal. The limiter function is only applied if the absolute value of the signal magnitude is higher than the specified limiter start magnitude <var>LIM</var>. For the limiter function, the following algorithm is used:
 


[[File:1240.png]]
[[File:1240.png]]
Line 130: Line 135:


:The relative number of limited (changed) samples.
:The relative number of limited (changed) samples.
;See also:
<[[../#Signal Processing Atoms|SP-atoms]]>
<!-- AN, 2.5.2011 -->

Revision as of 11:10, 9 May 2011

Apply limiter function to a signal.

[SPU LIMITER X TYPE MAX LIM OUT Y Q]

input description data type value type default value
X input signal number, vector variable
TYPE limiter function
(RECTANGLE, ATAN, EXPONENTIAL)
number (int.), string constant 0 (= RECTANGLE)
MAX maximum value; 0 < MAX number constant 1
LIM limiter start value; 0 < LIMMAX number constant 1
output description data type value type comment
Y limited signal same type as A variable
Q overload ratio number variable
Description

This SP-atom applies a non-linear magnitude weighting (= limiter function) to the signal. The limiter function is only applied if the absolute value of the signal magnitude is higher than the specified limiter start magnitude LIM. For the limiter function, the following algorithm is used: Failed to parse (unknown function "\leslant"): {\displaystyle y_i = \begin{cases} x_i & \mbox{if }|x_i|\leslant LIM \\ 3n+1, & \mbox{if }n\mbox{ is odd} \end{cases} }

The level meter value vt (t = sample index) is computed for each value xt of the input signal X. The last vt of an evaluation cycle is used to update the outputs Y and P.

TYPE computation of vt
0 or HOLD {\displaystyle v_{t}=\max(|x_{t}|,|x_{t-1}|,..,|x_{t-T+1}|)\!}
1 or EXPONENTIAL {\displaystyle v_{t}=max(|x_{t}|,v_{t-1}.k){\mbox{, with: }}k={\frac {1}{\sqrt[{T}]{2}}}}
2 or RMS {\displaystyle r_{t}={\frac {(r_{t-1}.(T-1)+x^{2})}{T}}}
{\displaystyle v_{t}={\sqrt {2.r_{t}}}}

The last value vt of an evaluation cycle is converted to the selected UNIT and stored in the output Y.

UNIT Y
0 or VALUE {\displaystyle v_{t}\!}
1 or SQUARE {\displaystyle v_{t}^{2}}
2 or RATIO {\displaystyle {\frac {v_{t}}{REF}}}
3 or DB {\displaystyle 20.\log _{10}{\frac {v_{t}}{REF}}}

The output P is set to a value in range 0 to SIZE and can be used to display a level bar. For P always the logarithmic value (level in dB) is used. The level interval -140dB to 0dB is mapped to the position interval 0 to SIZE using a non-linear mapping function.

The output M is the maximum of all computed vt values converted to the selected output unit.



LIMITER - amplitude limiter (non-linear)

File:1240.png

with:

x, y input and output signal sample
LIM, MAX limiter start amplitude and maximum signal amplitude
f() limiter function selected by input TYPE

Table: Limiter functions{| |- |The value of TYPE |The limiter function f(z) |- |0 or RECTANGLE |File:1241.png ('cut-off') |- |1 or ATAN |File:1242.png |- |2 or EXPONENTIAL |File:1243.png |}

with:

File:1244.png

The output Q is set to the relative number of processed samples:

Q = number of changed samples / number of processed samples

Usage:

LIMITER X TYPE MAX LIM

Inputs:
X
The signal vector or sample.
TYPE
The type of limiter function (see table above).
MAX
The maximum magnitude (full attenuation).
LIM
The limiter start magnitude. This value must be less than MAX.
Outputs:
Y
The limited signal (the same type as X).
Q
The relative number of limited (changed) samples.
See also

<SP-atoms>

Navigation menu

Personal tools