Programmer Guide/Command Reference/EVAL/zcross: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
Compute zero crossing density.
Compute zero crossing density.
;Usage:  
;Usage:  
:<code>qinterp(<var>x</var> {<var>type</var>, {, <var>sr</var>}})</code>
:<code>zcross(<var>x</var> {<var>type</var> {, <var>sr</var> {, <var>xth</var>}}})</code>
:;<var>x</var>:data vector (signal)
:;<var>x</var>:data vector (signal)
:;<var>type</var>:selects the type of result; 0 <= ''type'' <= 3 (default=0)
:;<var>type</var>:selects the type of result; 0 &le; ''type'' &le; 3 (default=0)
:;<var>sr</var>: sampling rate in Hz (default=1)
:;<var>sr</var>: sampling rate in Hz (default=1)
;Result: The function counts the number of zero crossings ''nz'' of the function ''x''[i]. The returned result is a scalar depending on ''nz'' and the argument ''type''.
:;<var>xth</var>: threshold value (default=0); if ''xth'' is a value greater than 0, fluctuations of the function in the range ''-xth'' < ''x''[i] < ''xth'' are ignored
The scalar ''z'' with following meaning:
;Result: The function counts the number of zero crossings ''z'' of the function <code>''x''[i] = f(i)</code>. The returned result is a scalar depending on ''z'' and the argument ''type''.
:{|class="einrahmen"
:{|class="einrahmen"
!''type'' !! description
!''type'' !! description !! result
|-
|-
|'''0''' || the number of zero crossing ''nz''
|'''0''' || the number of zero crossing  
|''z''
|-
|-
|'''1''' || the zero crossing density ''dz'' = ''nz'' / ( '''ncol'''(''x'') * ''sr'')<BR>(number of zero crossings / second)
|'''1''' || the zero crossing density<BR>(number of zero crossings / second)
|''d'' = ''z'' / ('''ncol'''(''x'') * ''sr'')
|-
|-
|'''2''' || the average zero crossing frequenzy (in Hz) ''f'' = ''dz'' / 2
|'''2''' || the average zero crossing frequenzy (in Hz)  
|''f'' = ''d'' / 2
|-
|-
|'''3''' || the average zero crossing periode length (in seconds) ''t'' = 2 / ''dz''
|'''3''' || the average zero crossing periode length (in seconds)  
|''t'' = 1 / ''f'' = 2 / ''d''
|}
|}
;See also: [[../f0ac|f0ac]]


 
[[../#Functions|<function list>]]
;See also: [[Programmer_Guide/Command_Reference/EVAL/ipeak|ipeak]], [[Programmer_Guide/Command_Reference/EVAL/formants|formants]]
 
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]
 
 
=====zcross=====
 
=====Usage:=====
 
<code>zcross(<var>x</var> [, <var>type</var>=0 {0..3}, <var>xmin</var>=0, <var>srate</var>=1])</code>
 
=====Parameters:=====
 
;<var>type</var>
 
:The type of result to return (see Result)
 
;<var>xmin</var>
 
:The minimum x value.
 
;<var>srate</var>
 
:The sampling rate.
 
=====Result:=====
 
Returns a scalar:
 
If <var>type</var>=<code>0</code>, the number of zero-crossings.
 
If <var>type</var>=<code>1</code>, the density of zero-crossings (number of zero-crossings / seconds).
 
If <var>type</var>=<code>2</code>, the frequency of zero-crossing (density / 2).
 
If <var>type</var>=<code>3</code>, the period length (1 / frequency = 2 / density).
 
=====Description:=====
 
Count the number of zero-crossings in the vector <var>x</var>. This is a subcommand of the <code>[[Programmer Guide/Command Reference/EVAL/EVAL|EVAL]]</code> command.

Latest revision as of 19:01, 21 April 2011

Compute zero crossing density.

Usage
zcross(x {type {, sr {, xth}}})
x
data vector (signal)
type
selects the type of result; 0 ≤ type ≤ 3 (default=0)
sr
sampling rate in Hz (default=1)
xth
threshold value (default=0); if xth is a value greater than 0, fluctuations of the function in the range -xth < x[i] < xth are ignored
Result
The function counts the number of zero crossings z of the function x[i] = f(i). The returned result is a scalar depending on z and the argument type.
type description result
0 the number of zero crossing z
1 the zero crossing density
(number of zero crossings / second)
d = z / (ncol(x) * sr)
2 the average zero crossing frequenzy (in Hz) f = d / 2
3 the average zero crossing periode length (in seconds) t = 1 / f = 2 / d
See also
f0ac

<function list>

Navigation menu

Personal tools