Jump to content

Creating Average for sample length of data


Recommended Posts

There are lots of different ways to process the data in an array this way.  One way is to reshape the data in the file, which is a 1D array of points, to a 2D array.  The rows of the 2D array is auto-indexed using a FOR loop, and the points in each row averaged together, as show in the snippet I have attached.  This code places the original points, and the averaged data into Waveform data for comparison in a waveform graph.  I read your data in and it looks to be SGL data points.  I also noticed that averaging 50 points severely degrades the features of your data, so you might want to use a smaller number.  This code writes the averaged data back to a binary file that is the same type as the input.  Also, if the number of points to average is not an even divisor of the number of points in the set, the data is truncated.  Hope this helps.

 

Average_array.png

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.