dnvgl / qats

Python library and GUI for efficient processing and visualization of time series.
MIT License
38 stars 10 forks source link

Integration of time series #80

Closed ogabrielsen closed 3 years ago

ogabrielsen commented 4 years ago

From time to time I process time series of acceleration measurements. Accelerations can be integrated to obtain velocities and velocities can again be integrated to obtain displacements. I propose to implement a feature in qats for integration of the time series specifically for this type of use. For each integration it should also be possible to apply either a high-pass or a low-pass filter to the signal to remove numerical issues during integration.

Say that acceleration data for a sensor is imported as signal S1, then it should be possible to define a new signal S2 which is the integration of S1, application of a high-pass filter and offset removed. See attached example.

Processing of accelerations.pdf

eneelo commented 4 years ago

As far as I can see, you are asking for functionality that is mostly available already. A fair approach could be for example:

  1. Integrate the signal using scipy.integrate (as done in the example).
  2. Filter the integrated time series using qats.signal.highpass (link to docs), or initiate a TimeSeries instance and filter using the TimeSeries.filter() method (link to docs).
  3. Remove the mean of the filtered signal.

An idea could of course be to merge these steps into a single function, to obtain functionality somewhat similar to that implemented for numerical differentiation (see qats.motions).

Please correct me if I have misunderstood.

ogabrielsen commented 4 years ago

I see that I missed one important point in my first entry: My suggestion is to include the proposed feature in the GUI. I understand that the library has functionality for doing so, but I liked the idea of being able to do operations on the time series from the GUI. However, the GUI is nice and clean as it is and perhaps it is best not to clutter it with more buttons - unless there could be a toggle that turns on advanced features which are normally hidden.

eneelo commented 4 years ago

I see that I missed one important point in my first entry: My suggestion is to include the proposed feature in the GUI.

Noted - that makes sense.

However, the GUI is nice and clean as it is and perhaps it is best not to clutter it with more buttons - unless there could be a toggle that turns on advanced features which are normally hidden.

I agree, and that has been one of the main strategies; make simple and commonly used operations (time series plotting, filtering, spectrum, statistics) easily available and refer to the underlying library for more advanced operations. However, I like the idea so I think we should leave the issue open for now in case we decide to implement something along this line at a later stage.

tovop commented 3 years ago

Closing this. Can be reopened once we have a clearer idea on how to generically implement this in the GUI.