Programmer Guide/SPU Reference/LIMITER: Difference between revisions
From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import) |
|||
(24 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
Apply a non-linear limiter function to a signal. | |||
==<code>[SPU LIMITER <var>X TYPE MAX LIM</var> OUT <var>Y Q</var>]</code>== | |||
{|class="einrahmen" | |||
!input !!description !!data type !!value type!!default value | |||
|- | |||
|<var>X</var>||input signal||number, vector ||variable | |||
|- | |||
|<var>TYPE</var>||limiter function<BR>(<code>RECTANGLE, ATAN, EXPONENTIAL</code>)||number (int.), string||constant ||<code>0</code> (= <code>RECTANGLE</code>) | |||
|- | |||
|<var>MAX</var>||maximum value; 0 < <var>MAX</var>||number||constant ||<code>1</code> | |||
|- | |||
|<var>LIM</var>||limiter start value; 0 < <var>LIM</var> ≤ <var>MAX</var>||number||constant ||<code>1</code> | |||
|- | |- | ||
!output !!description !!data type !!value type!!comment | |||
|- | |- | ||
| | |<var>Y</var>||limited signal||same type as <var>A</var>||variable | ||
| | |||
|- | |- | ||
| | |<var>Q</var>||relative number of limited samples||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 <var>LIM</var>. For the limiter function, the following algorithm is used: | |||
| | :<math>y_i = \begin{cases} | ||
x_i & \mbox{ if }|x_i| \leqslant LIM \\ | |||
| | sign(x_i).f \left ( \frac{|x_i|}{MAX} \right ) & \mbox{ otherwise} | ||
\end{cases} | |||
</math> | |||
The absolute magitude of the limited signal is always lower than <var>MAX</var>. The limiter function is selected by the input <var>TYPE</var>. | |||
:{|class="einrahmen" | |||
!<var>TYPE</var> !!limiter function ''f''(''z''<sub>i</sub>) | |||
|- | |- | ||
|0 or RECTANGLE | |<code>0</code> or <code>RECTANGLE</code> | ||
| | |<math>k\!</math> | ||
|- | |- | ||
|1 or ATAN | |<code>1</code> or <code>ATAN</code> | ||
| | |<math>k+(1-k) \cdot \frac{2}{\pi} \cdot atan\left ( \frac{z-k}{1-k} \cdot \frac{\pi}{2} \right )</math> | ||
|- | |- | ||
|2 or EXPONENTIAL | |<code>2</code> or <code>EXPONENTIAL</code> | ||
| | |<math>1-(1-k) \cdot e^{-\frac{z-k}{1-k}}</math> | ||
|} | |} | ||
:with: <math>z_i = \frac{|x_i|}{MAX}, k = \frac{LIM}{MAX}</math> | |||
The output <var>Q</var> is set to the relative number of limited (changed) samples. | |||
:<math>Q = \frac{changedSamples}{processedSamples}</math> | |||
: | ;See also: | ||
<[[../#Signal Processing Atoms|SP-atoms]]> | |||
<!-- AN, 2.5.2011 --> |
Latest revision as of 10:54, 9 May 2011
Apply a non-linear 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 < LIM ≤ MAX | number | constant | 1
|
output | description | data type | value type | comment |
Y | limited signal | same type as A | variable | |
Q | relative number of limited samples | 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:
The absolute magitude of the limited signal is always lower than MAX. The limiter function is selected by the input TYPE.
TYPE limiter function f(zi) 0
orRECTANGLE
1
orATAN
2
orEXPONENTIAL
- with:
The output Q is set to the relative number of limited (changed) samples.
- See also
<SP-atoms>