Menu

Dev Blog 29.06.203

Hello,

at the moment I am working on the interpolation feature of pyMdfParser.
With that feature it is possible to perfomr calculations with signals that were measured in different sample times.

I have implemented the following concept:

Added a module mdf_operations with a class MDFOps and an interpolation method "interp".
Interface of "interp": A signal list and a desired interpolation rate.
"interp" determines the latest starting time points and the earliest stop time of all time vectors of the signals given in the signal list.

Then a new time vector wit the given sample rate is generated between these time boundaries.

Then the data vector of all signals given in signal list are interpolated to this new time vector.

Interpolation is done by bisectioning followed by a simple linear interpolation.

For each interpolated signal a CNBlock object is instantiated and added to the cn_blocks attribute of a CGBlock object.
This CGBlock object is returned to the caller of "interp".

In order to have a good usablilty the CGBlock class had to be enhanced:

  • added a method add --> interface is a CNBlock objects
  • added a method get --> interfcae is a signal name
  • added an attribute hash_table for a fast finding of the signals

The "add" methods does everything to add a CNBlock object to a CGBlock object.
E.g. build the hashtable append the signal name to a signal list.

get wirks in the same way as the get methods of MDFParser class but on CGBlock level.

As usual I am open for hints a improvements ....

Regs

Marcus

Posted by bowie 2013-06-28 Labels: pyMdfParser DevBlog

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.