EXSTAT
Calculation of statistical moments.
[SPU EXSTAT X PX NORM OUT M1 M2 M3 M4 N]
input | description | data type | value type | default value |
---|---|---|---|---|
X | data vector | number, vector | variable | 0,1,..
|
PX | probability vector | number, vector | variable | 1, 1, ...
|
NORM | normalization flag | number (int.), string | constant | 0 (= NO )
|
output | description | data type | value type | comment |
M1 | 1st moment (mean) | number | variable | |
M2 | 2nd moment (variance or spread) | number | variable | |
M2 | 3rd moment (skewness) | number | variable | |
M4 | 4th moment (kurtosis) | number | variable | |
N | number of data samples | number | constant |
Note:
- At least one of the data vectors X and PX must be supplied!
- The number of data points N is set to the length of the vector X or PX.
- If X is a not connected, the x-data are initialized with xi = i.
- If X is a number, the x-data are initialized with xi = X+i.
- If PX is not a vector, the probabilies pxi are set to 1.
- Description
μ = ∑ i = 0 N − 1 x i p x i ∑ i = 0 N − 1 p x i σ = ∑ i = 0 N − 1 ( x i − M 1 ) 2 p x i ∑ i = 0 N − 1 p x i μ = ∑ i = 0 N − 1 x i p x i ∑ i = 0 N − 1 p x i σ = ∑ i = 0 N − 1 ( x i − M 1 ) 2 p x i ∑ i = 0 N − 1 p x i {\displaystyle {\begin{matrix}\mu ={\frac {\sum _{i=0}^{N-1}x_{i}px_{i}}{\sum _{i=0}^{N-1}px_{i}}}&\sigma ={\frac {\sum _{i=0}^{N-1}(x_{i}-M1)^{2}px_{i}}{\sum _{i=0}^{N-1}px_{i}}}\\\mu ={\frac {\sum _{i=0}^{N-1}x_{i}px_{i}}{\sum _{i=0}^{N-1}px_{i}}}&\sigma ={\frac {\sum _{i=0}^{N-1}(x_{i}-M1)^{2}px_{i}}{\sum _{i=0}^{N-1}px_{i}}}\end{matrix}}}
output | NORM=0 |
NORM=1
|
---|---|---|
M1 | ∑ i = 0 N − 1 x i p x i ∑ i = 0 N − 1 p x i {\displaystyle {\frac {\sum _{i=0}^{N-1}x_{i}px_{i}}{\sum _{i=0}^{N-1}px_{i}}}} | ∑ i = 0 N − 1 x i p x i ∑ i = 0 N − 1 p x i {\displaystyle {\frac {\sum _{i=0}^{N-1}x_{i}px_{i}}{\sum _{i=0}^{N-1}px_{i}}}} |
M1 | ∑ i = 0 N − 1 ( x i − M 1 ) 2 p x i ∑ i = 0 N − 1 p x i {\displaystyle {\frac {\sum _{i=0}^{N-1}(x_{i}-M1)^{2}px_{i}}{\sum _{i=0}^{N-1}px_{i}}}} | 1 M 1 ∑ i = 0 N − 1 ( x i − M 1 ) 2 p x i ∑ i = 0 N − 1 p x i {\displaystyle {\frac {1}{M1}}{\frac {\sum _{i=0}^{N-1}(x_{i}-M1)^{2}px_{i}}{\sum _{i=0}^{N-1}px_{i}}}} |
This SP-atom applies a non-linear magnitude weighting (= limiter function) to the signal. The limiter function is only applied if the absolute value of the signal magnitude is higher than the specified limiter start magnitude LIM. For the limiter function, the following algorithm is used:
- y i = { x i if | x i | ⩽ L I M s i g n ( x i ) . f ( | x i | M A X ) otherwise {\displaystyle y_{i}={\begin{cases}x_{i}&{\mbox{ if }}|x_{i}|\leqslant LIM\\sign(x_{i}).f\left({\frac {|x_{i}|}{MAX}}\right)&{\mbox{ otherwise}}\end{cases}}}
The absolute magitude of the limited signal is always lower than MAX. The limiter function is selected by the input TYPE.
TYPE limiter function f(zi) 0
orRECTANGLE
k {\displaystyle k\!} 1
orATAN
k + ( 1 − k ) ⋅ 2 π ⋅ a t a n ( z − k 1 − k ⋅ π 2 ) {\displaystyle k+(1-k)\cdot {\frac {2}{\pi }}\cdot atan\left({\frac {z-k}{1-k}}\cdot {\frac {\pi }{2}}\right)} 2
orEXPONENTIAL
1 − ( 1 − k ) ⋅ e − z − k 1 − k {\displaystyle 1-(1-k)\cdot e^{-{\frac {z-k}{1-k}}}}
- with: z i = | x i | M A X , k = L I M M A X {\displaystyle z_{i}={\frac {|x_{i}|}{MAX}},k={\frac {LIM}{MAX}}}
The output Q is set to the relative number of limited (changed) samples.
- Q = c h a n g e d S a m p l e s p r o c e s s e d S a m p l e s {\displaystyle Q={\frac {changedSamples}{processedSamples}}}
- See also
<SP-atoms>