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

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 11: Line 11:
:::{|class="keinrahmen"
:::{|class="keinrahmen"
|''np'' || ||number of detected periodes
|''np'' || ||number of detected periodes
|''ifirst'' || sample index of the begin of the first periode
|''ifirst'' || || sample index of the begin of the first periode
|''ilast'' || sample index of the end of the last periode
|''ilast'' || || sample index of the end of the last periode
|}





Revision as of 14: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:

{\displaystyle xs[i]={\frac {\sum _{j=-m}^{m}{x[i+j].w[j]}}{\sum _{j=-m}^{m}{w[j]}}}}
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

<function list>

Navigation menu

Personal tools