Programmer Guide/SPU Reference/PPM: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
{{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 | |||
|- | |||
|<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> (= | |||
|- | |||
|<var>REF</var>||reference value for <var>UNIT</var> <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>||selected data ||same type as <var>A</var> ||variable | |||
|} | |||
;Description: | |||
{|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> | |||
|<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> | |||
|<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> | |||
|<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> | |||
|<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 ≤ i < length of <var>A<sub>vector</sub></var> | |||
;See also: | |||
<[[../#Signal Processing Atoms|SP-atoms]]> | |||
<!-- AN, 2.5.2011 --> | |||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
====PPM - signal peak measurement==== | ====PPM - signal peak measurement==== |
Revision as of 08:09, 9 May 2011
Level meter (PPM). This atom is used for the level display in the recorder application.
Contents
[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 (=
|
REF | reference value for UNIT 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 | selected data | same type as A | variable |
- Description
SEL | Ynumber=f(Anumber,Bnumber) | Yvector=f(Avector,Bnumber) | Ynumber=f(Avector,Bvector) |
---|---|---|---|
0 or A
|
Y = A | Y[i] = A[i] | Y[i] = A[i] |
1 or B
|
Y = B | Y[i] = B | Y[i] = B[i] |
2 or minimum
|
Y = min(A,B) | Y[i] = min(A[i],B) | Y[i] = min(A[i],B[i]) |
3 or maximum
|
Y = max(A,B) | Y[i] = max(A[i],B) | Y[i] = max(A[i],B[i]) |
with: 0 ≤ i < length of Avector
- See also
<SP-atoms>
PPM - signal peak measurement
Usage:
PPM X TYPE T UNIT REF
Inputs:
X | signal (sample or frame) |
TYPE | type of measurement |
T | measurement interval, integration time (in samples) |
UNIT | output unit/mode |
REF | reference value for relative output units/modes |
Outputs:
Y | current peak value |
M | maximum peak value |
Function:
This function implements a set of magnitude measurement methods. If input X is a number, a peak value for each sample is computed. If input X is a vector, only one peak value for the vector is computed.
The computed peak value is converted to the selected unit/mode before it is written to the output. For the relative output modes (UNIT equal 2 or 3) the value of input REF (>0) is used as the reference value.
The output M is set to the maximum of all computed Y values (M(t) = max(Y(0), Y(1), .., Y(t)).
Table: Peak magnitude measurement methods selected by input TYPE{|
|-
|value of TYPE
|method (P = peak value)
|-
|0
or HOLD
|The absolute peak magnitude is measured using a sample/hold circuit:if |X(t)| > P(t-1) or holdtime > T:P(t) = |X(t)|; holdtime is set to zerootherwise:P(t) = P(t-1); holdtime is incremented
|-
|1
or EXPONENTIAL
|Use an exponential decay for peak measurement:P(t) = max(k . P(t-1), |X(t)|)The factor k is set to k=0.51/T . This means the ppm value falls to 50% after T samples, if input values are lower than the ppm output.
|-
|2
or RMS
|Pseudo ppm measurement based on running rms magnitude (just for test purposes):(1) r(t) = ((T-1).r(t-1) + X2(t)) / T(2) P(t) = (2.r(t))1/2
|}
Table: Peak magnitude output formats selected by input UNIT{|
|-
|value of UNIT
|conversion
|-
|0
or VALUE
|Y(t) = P(t)
|-
|1
or SQUARE
|Y(t) = P(t)2
|-
|2
or RATIO
|Y(t) = P(t) / REF
|-
|3
or DB
|Y(t) = 20.log10(P(t) / REF)
|}