Programmer Guide/SPU Reference/PPM: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 7: Line 7:
|<var>X</var>||input signal||number, vector ||variable  
|<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>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>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>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>REF</var>||reference value, used for <var>UNIT</var> values <code>RATIO</code> and <code>DB</code>||number||constant ||<code>0</code>
Line 28: Line 28:


;Description:
;Description:
{|class="einrahmen"
 
!SEL
The output <var>M</var> is the maximum of all <var>Y<var> values since the spu creation.
! <var>Y<sub>number</sub></var>=f(<var>A<sub>number</sub></var>,<var>B<sub>number</sub></var>)
:<var>M</var> = max(<var>Y</var><sub>0</sub>, <var>Y</var><sub>1</sub>, ..)
! <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 &le; i &lt; length of <var>A<sub>vector</sub></var>
;See also:
;See also:
<[[../#Signal Processing Atoms|SP-atoms]]>
<[[../#Signal Processing Atoms|SP-atoms]]>

Revision as of 08:39, 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 output M is the maximum of all Y values since the spu creation.

M = max(Y0, Y1, ..)


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) |}

Navigation menu

Personal tools