RE: Process the part of a wave with meaningful data for RMS

I have some measurement results from accelerometers for which I would like to calculate the RMS value of acceleration. The measurement result is obtained with a train. That means before and after the train passing the sensor the measurement values are zero. I am looking for a method to calculate RMS value of G and remove those data without the train (or else the RMS value is diluted). Can this be done automatically? I am thinking if a method to detect the useful range and copy it into another wave and only calculate the RMS of the wave using Wavestats. Is that possible?

THanks.
If your wave containing the values is "val", you could do:

Duplicate/O val val_tmp        // make a copy
val_temp = val == 0 ? NaN : val    // set all zeros to NaN
WaveTransform zapNaNs val_tmp  //clip wave to values only
Wavestats val_tmp
ChrLie wrote:
If your wave containing the values is "val", you could do:

Duplicate/O val val_tmp        // make a copy
val_temp = val == 0 ? NaN : val    // set all zeros to NaN
WaveTransform zapNaNs val_tmp  //clip wave to values only
Wavestats val_tmp



Thank you very much. So this will calculate those data points with non-zero value and those zero value data points within the train will also be converted to NaN and will not be processed, isn't it?

I am wondering if this will affect the RMS value as those NaN points within the train passing time are not considered.
Also, after applying wavestats to different waves, the V_rms value keep updating and at the mean time those existing textbox display using "\{V_rms}" also changed accordingly. How can I keep those existing textbox with variable values unchanged? Do I need to assign each V_rms result from each wave to a new variable? How can I do that?