[CO] Integration of periodic signals + last point + primitive
EmileDvs opened this issue · 1 comments
Hello,
We have implemented integration over time/space using trapz, there are few improvements/corrections that could be further done:
-
"integrate" may be confusing: do we integrate the signal (trapz function) or do we take its primitive (cumtrapz function) ? We could directly use the function name as input argument, e.g. "time=trapz" / "time=cumtrapz".
-
The integration interval is not given as input, probably leading to confusion in case of periodicity: should we integrate on the periodic interval ? on the full interval ? => we can set "time=integrate" as integration of full signal, "time=integrate[smallestperiod]", "time=integrate[oneperiod]", "time=integrate[0, 2*pi]",
-
The last point is systematically neglected so the result is incorrect. The last point should be replicated assuming (anti-)peridodicity so the integration on last interval is considered.
-
The operations "rms" / "rss" should be improved for time/angle axes using integration (trapz) instead of sum so the result is more accurate
Best regards,
Emile
The issue is modified as follow:
- "integration" is in fact similar to "sum", e.g. "time=sum" should in fact perform summation using trapz (integration) instead of calling "sum" but the result is the same => the axis along which summation/integration is performed is squeezed. primitive integral is calculated using "time=antiderivate", by opposition to "time=derivate" command.
- To improve performances operations are always performed on smallest period if it exists, then the (anti-)periodicity factor is included to get the result on the full period. For DataPattern operations are always performed on the full pattern.
- doesn't change
- "integrate" is now merged in "sum" for "time", "angle", "z" axes. A new function to perform sum and mean is implemented depending on axis type.