-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
const double PI = 3.14159265358979323846;
const double frequency = 20.0; // Hz
const double samplingRate = 1000.0; // Hz
const double duration = 1.0; // seconds
const size_t sampleCount = static_cast<size_t>(samplingRate * duration);
std::vector<double> data;
data.reserve(sampleCount);
for (size_t i = 0; i < sampleCount; ++i) {
double t = i / samplingRate;
double value = std::abs(std::sin(2.0 * PI * frequency * t));
series.push_back(value);
}
// RainFlow::Series series { -2, 1, -3, 5, -1, 3, -4, 4, -2 };
auto counts = RainFlow::countCycles( series);
double countAll;
double rangAll;
for(auto count:counts)
{
countAll +=count.second;
rangAll+=count.first;
}
qDebug()<<counts;
qDebug()<<"countAll"<<countAll;
qDebug()<<"rang"<<rangAll/counts.size();
when you use auto counts = RainFlow::countCycles( series,1);
we can get 1,40.
when you set binSize=2
then we can get 2,40
Metadata
Metadata
Assignees
Labels
No labels