Programmer Guide/SPU Reference/RMSB: Difference between revisions
(initial import) |
m (1 revision: Initial import) |
(No difference)
|
Revision as of 17:31, 18 November 2010
RMSB - frequency band rms
Usage:
RMSB X SR DEF P1 P2 P3 REF TYP TABLE COL WIN DBREF
Inputs:
X | amplitude spectrum vector (linear!!!) |
SR | sampling rate in Hz |
DEF | type of band/frequency definition {Direct , Equal , Geometric }
|
P1,P2,P3 | band definitions parameters (depends on DEF - see table below) |
REF | Absolute , Band |Relative }
|
TYP | type of rms output values {Power , LInear , LOgarithmic }
|
TABLE | name of parameter table |
COL | 1st column for rms values in output table |
WIN | either a number (length of signal window) or a vector (length = length of signal window) |
DBREF | reference value for logarithmic output |
Outputs:
Y | band rms values |
Function:
This function computes the energy in different frequency bands of the spectrum X. The input X must be a magnitude spectrum (linear magnitudes) with an equally spaced frequency scale and a frequency range from 0 to SR/2 (e.g. an fft spectrum). The energy bands are defined by the inputs DEF and P1-P3 in the following manner:
Table 20: Frequency band definitions selected by input DEF{|
|-
|value of DEF
|P1
|P2
|P3
|description
|-
|0
or DIRECT
|fmin1 ...fminn
|fmax1 ...fmaxn
|-
|The energy in the frequency bands [fmin1,fmax1] .. [fminn,fmaxn] is computed. Overlapping bands are possible.
|-
|1
or EQUAL
|fmin
|fmax
|n
|The frequency range [fmin,fmax] is split into n bands with equal bandwidth b=(fmax-fmin)/n. The boundaries of the n frequency bands are set to [fmin+i.b, fmin+(i+1).b] (with: i=0,..,n-1)
|-
|2
or GEOMETRIC
|fmin
|fmax
|n
|The frequency range [fmin,fmax] is split into n bands with constant bandwidth ratio q=(fmax/fmin)1/n. The boundaries of the n frequency bands are set to [fmin.qi, fmin.q(i+1)] (with: i=0,..,n-1)
|}
To compute the energy in a frequency band the squared magnitudes inside the band are added. The input REF can be used to compute relative or absolute energy values.
Table 21: Compute relative or absolute rms values{|
|-
|value of REF
|energy computation
|-
|0
, 1
, FULL
orABSOLUTE
|The energy ei is the sum of all aj2 with frequency fj is inside the band i.
|-
|2
, 3
, BAND
orRELATIVE
|The energy ei is computed as described above and than multiplied with k=2/SR.bi. This mode can be used to compute the energy density in a band.
|}
Before the computed energy values are stored in the output Y, they are converted according to the value of input TYP.
Table 22: Type of output values{|
|-
|value of TYP
|value stored in Y (and in the table columns)
|-
|0
or POWER
|energy values ei as computed
|-
|1
or LINEAR
|ei1/2
|-
|2
or LOGARITHMIC
|10.log10(ei)
|}
If a table (defined by TABLE and COL) is specified, the values are also stored in the columns COL to COL+n-1 of the table. In each evaluation cycle the columns of one entry are filled (starting at entry 0).