Programmer Guide/SPU Reference/PPM: Difference between revisions
From STX Wiki
Jump to navigationJump to search
m (1 revision: Initial import) |
No edit summary |
||
(32 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
Level meter (PPM). This atom is used for the level display in the recorder application. | |||
==<code>[SPU PPM <var>X TYPE T UNIT REF SIZE</var> OUT <var>Y M P</var>]</code>== | |||
== | {|class="einrahmen" | ||
!input !!description !!data type !!value type!!default value | |||
<code>PPM <var>X</var> <var> | |- | ||
|<var>X</var>||input signal||number, vector ||variable | |||
|- | |||
|<var>TYPE</var>||measurement method<BR>(<code>HOLD, EXPONENTIAL, RMS</code>)||number (int.), string||constant ||<code>0</code> (= <code>HOLD</code>) | |||
|- | |||
|<var>T</var>||measurement time constant in samples||number||constant ||<code>100</code> | |||
|- | |- | ||
| | |<var>UNIT</var>||output value and unit<BR>(<code>VALUE, SQUARE, RATIO, DB</code>)||number (int.), string||constant ||<code>0</code> (=<code>VALUE</code>) | ||
| | |||
|- | |- | ||
| | |<var>REF</var>||reference value, used for <var>UNIT</var> values <code>RATIO</code> and <code>DB</code>||number||constant ||<code>0</code> | ||
| | |||
|- | |- | ||
| | |<var>SIZE</var>||length of bar (graph) used for ppm display||number||constant ||<code>100</code> | ||
| | |||
|- | |- | ||
!output !!description !!data type !!value type!!comment | |||
|- | |- | ||
| | |<var>Y</var>||ppm value ||number||variable | ||
| | |||
| | |||
|- | |- | ||
|<var>Y</var> | |<var>M</var>||maximum <var>Y</var>||number||variable | ||
| | |||
|- | |- | ||
| | |<var>P</var>||ppm bar position, always computed for the ppm value in dB (independent of <var>UNIT</var>)||number||variable | ||
| | |||
|} | |} | ||
;Description: | |||
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" | |||
!<var>TYPE</var> !! computation of ''v''<sub>t</sub> | |||
The | |||
|- | |- | ||
|<code>0</code> or <code>HOLD</code> | |<code>0</code> or <code>HOLD</code> | ||
| | |<math>v_t = \max(|x_t|, |x_{t-1}|, .., |x_{t-T+1}|)\!</math> | ||
|- | |- | ||
|<code>1</code> or <code>EXPONENTIAL</code> | |<code>1</code> or <code>EXPONENTIAL</code> | ||
| | |<math>v_t = max(|x_t|, v_{t-1}.k)\mbox{, with: }k = \frac{1}{\sqrt[T]{2}}</math> | ||
|- | |- | ||
|<code>2</code> or <code>RMS</code> | |<code>2</code> or <code>RMS</code> | ||
| | |<math>r_t = \frac{(r_{t-1}.(T-1)+x^2)}{T}</math><BR><math>v_t = \sqrt{2.r_t}</math> | ||
|} | |} | ||
The last value ''v''<sub>t</sub> of an evaluation cycle is converted to the selected <var>UNIT</var> and stored in the output <var>Y</var>. | |||
:{|class="einrahmen" | |||
!<var>UNIT</var> !! <var>Y</var> | |||
|- | |- | ||
|<code>0</code> or <code>VALUE</code> | |<code>0</code> or <code>VALUE</code> || <math>v_t\!</math> | ||
| | |||
|- | |- | ||
|<code>1</code> or <code>SQUARE</code> | |<code>1</code> or <code>SQUARE</code> || <math>v_t^2</math> | ||
| | |||
|- | |- | ||
|<code>2</code> or <code>RATIO</code> | |<code>2</code> or <code>RATIO</code> || <math>\frac{v_t}{REF}</math> | ||
| | |||
|- | |- | ||
|<code>3</code> or <code>DB</code> | |<code>3</code> or <code>DB</code> ||<math>20.\log_{10}{\frac{v_t}{REF}}</math> | ||
| | |||
|} | |} | ||
The output <var>P</var> is set to a value in range 0 to <var>SIZE</var> and can be used to display a level bar. For <var>P</var> always the logarithmic value (level in dB) is used. The level interval -140dB to 0dB is mapped to the position interval 0 to <var>SIZE</var> using a non-linear mapping function. | |||
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 --> |
Latest revision as of 09:51, 9 May 2011
Level meter (PPM). This atom is used for the level display in the recorder application.
[SPU PPM X TYPE T UNIT REF SIZE OUT Y M P]
input | description | data type | value type | default value |
---|---|---|---|---|
X | input signal | number, vector | variable | |
TYPE | measurement method ( HOLD, EXPONENTIAL, RMS ) |
number (int.), string | constant | 0 (= HOLD )
|
T | measurement time constant in samples | number | constant | 100
|
UNIT | output value and unit ( VALUE, SQUARE, RATIO, DB ) |
number (int.), string | constant | 0 (=VALUE )
|
REF | reference value, used for UNIT values RATIO and DB |
number | constant | 0
|
SIZE | length of bar (graph) used for ppm display | number | constant | 100
|
output | description | data type | value type | comment |
Y | ppm value | number | variable | |
M | maximum Y | number | variable | |
P | ppm bar position, always computed for the ppm value in dB (independent of UNIT) | number | variable |
- Description
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
orHOLD
1
orEXPONENTIAL
2
orRMS
The last value vt of an evaluation cycle is converted to the selected UNIT and stored in the output Y.
UNIT Y 0
orVALUE
1
orSQUARE
2
orRATIO
3
orDB
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.
- See also
<SP-atoms>