Programmer Guide/SPU Reference/ZEROCROSS: Difference between revisions
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
In this atom the zero crossings ''Z'' of the signal <var>X</var> are counted and than converted to the value selected by <var>TYPE</var>. If <var>XMIN</var>=0 all zero crossings, i.e. changes of signs, are counted. If <var>XMIN</var>>0 the absolute signal magnitude has to exceed this value between two zero crossings. | In this atom the zero crossings ''Z'' of the signal <var>X</var> are counted and than converted to the value selected by <var>TYPE</var>. If <var>XMIN</var>=0 all zero crossings, i.e. changes of signs, are counted. If <var>XMIN</var>>0 the absolute signal magnitude has to exceed this value between two zero crossings. | ||
To compute more exact density, frequency and periode values, also the index (position) of the first (I<sub>1</sub>) and last (I<sub>N</sub>) zero crossing is computed. | |||
{|class="einrahmen" | {|class="einrahmen" | ||
!<var>TYPE</var> !!<var>Y</var> !!description | |||
|- | |- | ||
|< | |<code>0</code> or <code>DENSITY</code> | ||
|<math>SR<\cdot\frac{Z-1}{I_N-I_1+1}</math> | |||
|<math>\ | |density; number of zero crossings per second | ||
|} | |} | ||
;See also: | ;See also: |
Revision as of 12:17, 9 May 2011
Compute zero crossing rate.
Contents
[SPU ZEROCROSS X SR XMIN TYPE OUT Y]
input | description | data type | value type | default value |
---|---|---|---|---|
X | signal vector | vector | variable | |
SR | sampling rate in Hz | number | constant | 1 |
XMIN | signal amplitude threshold | number | constant | 0
|
TYPE | type of output value ( DENSITY, FREQUENCY, PERIODE, COUNT ) |
number (int.), string | 0 (= DENSITY )
| |
output | description | data type | value type | comment |
Y | zero crossing rate converted to the selected value | number | variable |
- Description
In this atom the zero crossings Z of the signal X are counted and than converted to the value selected by TYPE. If XMIN=0 all zero crossings, i.e. changes of signs, are counted. If XMIN>0 the absolute signal magnitude has to exceed this value between two zero crossings. To compute more exact density, frequency and periode values, also the index (position) of the first (I1) and last (IN) zero crossing is computed.
TYPE | Y | description |
---|---|---|
0 or DENSITY
|
density; number of zero crossings per second |
- See also
<SP-atoms>
ZEROCROSS - zerocrossing rate
Usage:
ZEROCROSS x sr xmin type
Inputs:
x | signal | |
sr | sampling rate in Hz | |
xmin | threshold | 0 (default) |
type | Frequency | Period )
|
Outputs:
y | number of zero crossings |
Function:
In this atom the zero crossings per second are counted, i.e. the points where between the last counted point and the current point, there exists a value xprev >= xmin and the current value xcurr<= 0 or xprev <= xmin and the current value is xcurr >= 0.
So if xmin = 0 all zero crossings, i.e. changes of signs, are counted. If xmin > 0 the signal has to exceed a certain absolute value if another point is to be counted.