SteveMyres Posted November 4, 2015 Share Posted November 4, 2015 I want to smooth my graph by using an N-sample rolling average. In a variable value, I'd just enter Mean(MyChannel[0,n-1]) which works fine. Graphs understandably look at channel history differently than variable value components, but I've been unable to find a syntax to generate a rolling average in a graph. In addition to the above, I also tried subsetting by time (unsure of how the graph would interpret systime(), whether in the instantaneous sense or as seen from a certain location on the axis: Mean(MyChannel[Systime(), Systime() - n + 1]) // or whatever the desired sample count converts to delta-T I'm pretty sure it would work to create a second channel, each of whose values is a rolling average of the one I want graphed, but it seems cleaner (though probably less processor-efficient) if there's a way to do it from the original channel on the fly. Link to comment Share on other sites More sharing options...
AzeoTech Posted November 4, 2015 Share Posted November 4, 2015 You want the smooth() function in your graph expression: smooth(myChannel, n) That does a running average where each value is the average of the last n data points. Use one of the boxcar functions if you'd prefer to reduce the number of data points into boxcars instead of a running average. Mean() always returns a scalar for the given dimension. Link to comment Share on other sites More sharing options...
SteveMyres Posted November 4, 2015 Author Share Posted November 4, 2015 Cool -- thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.