Extract RPM signal from tachometer pulses
tachorpm(___) with no output
arguments plots the generated RPM signal and the tachometer signal
with the detected pulses.
Load a simulated tachometer signal sampled at 300 Hz.
Compute and visualize the RPM signal using
tachorpm with the default values.
Increase the number of fit points to capture the RPM peak. Too many points result in overfitting. Verify this result by zooming in on the area around the peak.
tachorpm(Yn,fs,'FitPoints',600) axis([0.47 0.65 1320 1570])
Choose a moderate number of points to obtain a better result.
Add white Gaussian noise to the tachometer signal. The default pulse-finding mechanism misses pulses and returns a jagged signal profile. Verify this result by zooming in on a two-second time interval.
rng default wgn = randn(size(Yn))/10; Yn = Yn+wgn; [rpm,t,tp] = tachorpm(Yn,fs,'FitPoints',100); figure plot(t,Yn,tp,mean(interp1(t,Yn,tp))*ones(size(tp)),'+') hold on sl = statelevels(Yn); plot(t,sl(1)*ones(size(t)),t,sl(2)*ones(size(t))) hold off xlim([9 10])
Adjust the state levels to improve the pulse finding.
sl = [0 0.75]; [rpm,t,tp] = tachorpm(Yn,fs,'FitPoints',100,'StateLevels',sl); plot(t,Yn,tp,mean(interp1(t,Yn,tp))*ones(size(tp)),'+') hold on plot(t,sl(1)*ones(size(t)),t,sl(2)*ones(size(t))) hold off xlim([9 10])
x— Tachometer pulse signal
Tachometer pulse signal, specified as a row or column vector.
a tachometer signal, sampled for three seconds at 200 Hz,
and obtained during a quadratic run-up/coast-down test.
fs— Sample rate
Sample rate, specified as a positive scalar expressed in Hz.
comma-separated pairs of
the argument name and
Value is the corresponding value.
Name must appear inside quotes. You can specify several name and value
pair arguments in any order as
'PulsesPerRev',3,'OutputFs',1e3specifies that there are three tachometer pulses per revolution and that the returned RPM signal is to be sampled at 1 kHz.
PulsesPerRev— Number of tachometer pulses per revolution
1(default) | real scalar
Number of tachometer pulses per revolution, specified as the
comma-separated pair consisting of
a real scalar.
StateLevels— State levels used to identify pulses
State levels used to identify pulses, specified as the comma-separated
pair consisting of
'StateLevels' and a two-element
real vector. The first element of the vector corresponds to the low-state
level and the second element corresponds to the high-state level.
Choose the state levels so that all pulse edges cross within 10% of
both of them. If this option is not specified, then
the levels automatically using the histogram method, as in the
OutputFs— Output sample rate
fs(default) | real scalar
Output sample rate, specified as the comma-separated pair consisting
'OutputFs' and a real scalar.
FitType— Fitting method
Fitting method, specified as the comma-separated pair consisting
'FitType' and one of either
'smooth' — Fit a least-squares
B-spline to the pulse RPM values.
'linear' — Interpolate linearly
between pulse RPM values.
FitPoints— B-spline breakpoints
10(default) | real scalar
B-spline breakpoints, specified as the comma-separated pair
'FitPoints' and a real scalar. The
number of breakpoints is a trade-off between curve smoothness and
closeness to the underlying data. Choosing too many breakpoints can
result in overfitting. This argument is ignored if
rpm— Rotational speeds
Rotational speeds, returned as a vector expressed in revolutions per minute.
rpm has the same length as
t— Time vector
Time vector, returned as a vector of positive values expressed in seconds.
tp— Pulse locations
Pulse locations, returned as a vector of positive values expressed in seconds.
tachorpm function performs these steps:
determine the low and high states of the tachometer signal.
determine the time intervals between pulse centers and computes the
RPM values at the interval midpoints using RPM = 60 / Δt.
'FitType' is specified as
'smooth', then the function
performs least-squares fitting using splines. If
'linear', then the function performs linear
 Brandt, Anders. Noise and Vibration Analysis: Signal Analysis and Experimental Procedures. Chichester, UK: John Wiley & Sons, 2011.
 Vold, Håvard, and Jan Leuridan. “High Resolution Order Tracking at Extreme Slew Rates Using Kalman Tracking Filters.” Shock and Vibration. Vol. 2, 1995, pp. 507–515.