Programmer Guide/SPU Reference/UCONV: Difference between revisions

From STX Wiki
Jump to navigationJump to search
Line 62: Line 62:
|<code>20</code>
|<code>20</code>
|Convert from logarithmic to linear scale. Parameter <var>A</var> is used as reference value and <var>B</var> as factor.<BR>
|Convert from logarithmic to linear scale. Parameter <var>A</var> is used as reference value and <var>B</var> as factor.<BR>
<math>Y=A \cdot 10^{\frac{A}{B}}</math>
<math>Y=A \cdot 10^{\frac{X}{B}}</math>
|-
|-
|<code>7 or HZ2MEL</code>
|<code>7 or HZ2MEL</code>

Revision as of 13:24, 9 May 2011

Apply amplitude or frequency scale conversion.

[SPU UCONV X TYP A B OUT Y]

input description data type value type default value
X input date number, vector variable
TYP conversion (see description) number (int.), string constant 0
A, B conversion parameters (see description) number variable
output description data type value type comment
Y converted input data same type as A variable
Description

This atom performs a conversion of the input X (containing physical data) into another unit or domain. The type of conversion is controlled by the selection input TYPE and the parameter inputs A and B. The input data can be stored in a number or vector. If the input is a vector, the conversion is applied to all elements.

TYPE default
A
default
B
applied transformation /conversion
0 or LINEAR 1 0 Linear transformation. Parameter A is used as slope and parameter B as offset

Y=A.X+B

1 or HZ2CENT 1 0 Convert frequency from Hertz to Cents. Parameter A is used as reference frequency and B as offset in Cents.

Y=1200⋅log2(XA)+B

2 or CENT2HZ 1 0 Convert frequency from Cents to Hertz. Parameter A is used as reference frequency and B as offset in Cents.

Y=A⋅2X−B1200

3 or HZ2BARK - - Convert frequency from Hertz to Barks. Uses the transformation published by Zwicker and Fastl (1990). The parameters A and B are ignored.
4 or BARK2HZ - - Convert frequency from Barks to Hertz. Uses an iteration method that minimizes the distance to the forward conversion algorithm. The parameters A and B are ignored.
5 or LIN2LOG 1 20 Convert from linear to logarithmic scale. Parameter A is used as reference value and B as factor.

Y=B⋅log10(XA)

6 or LOG2LIN 1 20 Convert from logarithmic to linear scale. Parameter A is used as reference value and B as factor.

Y=A⋅10XB

7 or HZ2MEL - - Convert from Hertz to Mel. The parameters A and B are ignored.
8 or MEL2HZ - - Convert from Mel to Hertz. The parameters A and B are ignored.
9 or HZ2ERB - - Convert from Hertz to ERB (Equivalent Rectangular Bandwidth). The parameters A and B are ignored.
10 or ERB2HZ - - Convert from ERB (Equivalent Rectangular Bandwidth) to Hertz. The parameters A and B are ignored.
See also

<SP-atoms>

Navigation menu

Personal tools