Programmer Guide/Command Reference/EVAL/zcross: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
m (1 revision: Initial import) |
No edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
Compute zero crossing density. | |||
;Usage: | |||
:<code>qinterp(<var>x</var> {<var>type</var>, {, <var>sr</var>}})</code> | |||
:;<var>x</var>:data vector (signal) | |||
:;<var>type</var>:selects the type of result; 0 <= ''type'' <= 3 (default=0) | |||
:;<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''. | |||
The scalar ''z'' with following meaning: | |||
:{|class="einrahmen" | |||
!''type'' !! description | |||
|- | |||
|'''0''' || the number of zero crossing ''nz'' | |||
|- | |||
|'''1''' || the zero crossing density ''dz'' = ''nz'' / ( '''ncol'''(''x'') * ''sr'')<BR>(number of zero crossings / second) | |||
|- | |||
|'''2''' || the average zero crossing frequenzy (in Hz) ''f'' = ''dz'' / 2 | |||
|- | |||
|'''3''' || the average zero crossing periode length (in seconds) ''t'' = 2 / ''dz'' | |||
|} | |||
;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===== | =====zcross===== | ||
Revision as of 10:53, 11 April 2011
Compute zero crossing density.
- Usage
qinterp(x {type, {, sr}})
- x
- data vector (signal)
- type
- selects the type of result; 0 <= type <= 3 (default=0)
- sr
- 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.
The scalar z with following meaning:
type description 0 the number of zero crossing nz 1 the zero crossing density dz = nz / ( ncol(x) * sr)
(number of zero crossings / second)2 the average zero crossing frequenzy (in Hz) f = dz / 2 3 the average zero crossing periode length (in seconds) t = 2 / dz
Contents
zcross
Usage:
zcross(x [, type=0 {0..3}, xmin=0, srate=1])
Parameters:
- type
- The type of result to return (see Result)
- xmin
- The minimum x value.
- srate
- The sampling rate.
Result:
Returns a scalar:
If type=0
, the number of zero-crossings.
If type=1
, the density of zero-crossings (number of zero-crossings / seconds).
If type=2
, the frequency of zero-crossing (density / 2).
If type=3
, the period length (1 / frequency = 2 / density).
Description:
Count the number of zero-crossings in the vector x. This is a subcommand of the EVAL
command.