Jump to content

Sum signals with missing values


Ivan Berry

Recommended Posts

I need to add signals together that have missing values, if some values are missing in one of the signals, the rest should sum together, and the missing signal is zero.

This link below was a helpful discussion, essentially I would like to do the same thing, but with a sum, instead of a max.

Thanks for any pointers.

 

Link to comment
Share on other sites

  • Seeq Team

Hi Ivan,

There was a post similar to this referring to averaging signals with gaps in the data, which requires both summation and counting of the number of signals (prior to the new .average() operator in R21.0.43). The link to the post is below:
 


Therefore, an equation that could give you the sum of the samples would be the following:

$Zero = 0.tosignal(1min) // creates a scalar value of 0 to splice in when the values are invalid
(($a.splice($Zero,$a.tocapsules().inverse()))+($b.splice($Zero,$b.tocapsules().inverse()))+($c.splice($Zero,$c.tocapsules().inverse()))+($d.splice($Zero,$d.tocapsules().inverse())))
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...