Programmer Guide/Command Reference/EVAL/ticks2f1: 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}}}} | |||
Extracts the ''rps'' (= the number of '''r'''otations '''p'''er '''s'''econd) value or track from the tick-signal <var>x</var>. | |||
---- | |||
;Usage:<code>ticks2f1(<var>x</var>, <var>sr, <var>o</var> {, <var>l</var>, <var>s</var>})</code> | |||
:;<var>x</var>:the tick signal vector | |||
:;<var>sr</var>:sampling rate of the tick signal in Hz | |||
:;<var>type</var>:the order of the tick signal | |||
;Description: The function counts the periods of the tick signal and computes the ''rps'' value according to the sampling rate ''sr'' and the order of the tick signal ''o''. The tick signal ''x'' must be a periodic signal (sine wave, triangle, rectangle, sawtooth or pulse) with <var>o</var> periods per rotation. | |||
::<code>''rps'' = ''sr'' / ''o'' * ''np'' / (''ilast''-''ifirst'')</code> | |||
::with: | |||
:::{|class="keinrahmen" | |||
|''np'' || ||number of detected periodes | |||
|''ifirst'' || sample index of the begin of the first periode | |||
|''ilast'' || sample index of the end of the last periode | |||
smoothed value ''xs''[i] is computed from the data values ''x''[i-m] to ''x''[i+m]. The general form of the smoothing function is: | |||
::<math>xs[i] = \frac{ \sum_{j=-m}^m{x[i+j].w[j]} }{ \sum_{j=-m}^m{w[j]} }</math> | |||
:The weighting coefficients ''w''[i] depend on the value of the argument ''type'' | |||
::{|class="einrahmen" | |||
!''type'' !! ''w''[j] !! | |||
|- | |||
|'''0''' ||1 ||average | |||
|- | |||
|'''1''' |||<nowiki>1 / (|j|+1)</nowiki> ||''distance'' weighted average | |||
|} | |||
;Result: A vector ''r'' with <code>nrow(''x'')/s</code> elements. The value ''r''[j] is set to the value ''xs''[j*s] of the smoothed data vector. | |||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
=====ticks2f1===== | =====ticks2f1===== | ||
Line 38: | Line 66: | ||
=====Notes:===== | =====Notes:===== | ||
;See also: [[Programmer_Guide/Command_Reference/EVAL/optmm|optmm]] | |||
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]] |
Revision as of 13:45, 13 April 2011
Extracts the rps (= the number of rotations per second) value or track from the tick-signal x.
- Usage
ticks2f1(x, sr, o {, l, s})
- x
- the tick signal vector
- sr
- sampling rate of the tick signal in Hz
- type
- the order of the tick signal
- Description
- The function counts the periods of the tick signal and computes the rps value according to the sampling rate sr and the order of the tick signal o. The tick signal x must be a periodic signal (sine wave, triangle, rectangle, sawtooth or pulse) with o periods per rotation.
rps = sr / o * np / (ilast-ifirst)
- with:
np number of detected periodes ifirst sample index of the begin of the first periode ilast sample index of the end of the last periode
smoothed value xs[i] is computed from the data values x[i-m] to x[i+m]. The general form of the smoothing function is:- The weighting coefficients w[i] depend on the value of the argument type
type w[j] 0 1 average 1 1 / (|j|+1) distance weighted average
- Result
- A vector r with
nrow(x)/s
elements. The value r[j] is set to the value xs[j*s] of the smoothed data vector.
ticks2f1
Usage:
ticks2f1(x, sr, xo {, lfrm, sfrm})
Function:
Extracts the rpm value/track (rpm = the number of rotations per second) from the tick-signal x.
Parameters:
- x
- The tick signal.
- sr
- The sampling rate of x.
- xo
- The order of the tick signal.
- lfrm
- The frame length. The default is
nrow(x)
.
- sfrm
- The frame shift. The default is the value of lfrm.
Result:
The rpm value or track (a number or a vector).
Notes:
- See also
- optmm