Jump to content

Sum signals with missing values


Ivan Berry

Recommended Posts

Posted

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.

 

  • Seeq Team
Posted

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())))

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...