nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
vibration.hpp
Go to the documentation of this file.
1
3// toolboxes/signal/include/nk/signal/measurements/vibration.hpp
4//
5// Vibration analysis — envelope spectrum, tachometer → RPM, rainflow
6// cycle counting, time-synchronous averaging.
7
8#pragma once
9
10#include <memory_resource>
11#include <nk/value/value.hpp>
12
13#include <tuple>
14
15namespace nk::signal {
16
19
20
35std::tuple<Value, Value>
37 double fs = 0.0,
38 std::pmr::memory_resource * mr = nullptr);
39
55std::tuple<Value, Value>
56tachorpm(const Value & x,
57 double fs,
58 const Value & threshold = Value::Empty,
59 int ppr = 1,
60 std::pmr::memory_resource * mr = nullptr);
61
74 std::pmr::memory_resource * mr = nullptr);
75
93std::tuple<Value, Value>
94tsa(const Value & x,
95 double fs,
96 const Value & rpm,
97 double fs_rpm,
98 int n_per_rev = 1024,
99 std::pmr::memory_resource * mr = nullptr);
100
101
103} // namespace nk::signal
Core MATLAB-compatible multidimensional array and scalar value type.
Definition value.hpp:61
static const Value Empty
MATLAB-style empty matrix sentinel — a 0×0 DOUBLE value.
Definition value.hpp:136
Value rainflow(const Value &x, std::pmr::memory_resource *mr=nullptr)
Rainflow cycle counting (ASTM E1049-85).
std::tuple< Value, Value > tachorpm(const Value &x, double fs, const Value &threshold=Value::Empty, int ppr=1, std::pmr::memory_resource *mr=nullptr)
Convert a tachometer pulse signal to an RPM trace.
std::tuple< Value, Value > tsa(const Value &x, double fs, const Value &rpm, double fs_rpm, int n_per_rev=1024, std::pmr::memory_resource *mr=nullptr)
Time-synchronous average (TSA).
std::tuple< Value, Value > envspectrum(const Value &x, double fs=0.0, std::pmr::memory_resource *mr=nullptr)
Envelope spectrum: magnitude FFT of the AC-coupled analytic-signal envelope.