ZEROCROSS

From STX Wiki
Jump to navigationJump to search

Compute zero crossing rate.

[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
output NORM=0 NORM=1 description
M1 μ μ mean: μ=∑i=0N−1xipxi∑i=0N−1pxi
M2 V variance: σ2=V=∑i=0N−1(xi−μ)2pxi∑i=0N−1pxi
M3 S SV3 skewness: S=∑i=0N−1(xi−μ)3pxi∑i=0N−1pxi
M4 K KV2 kurtosis: K=∑i=0N−1(xi−μ)4pxi∑i=0N−1pxi
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.

Navigation menu

Personal tools