Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

developer001

Member

09-10-2014 03:55 PM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

I have a problem that I will describe:

I am receiving a continous stream of data, in the form of an array.

however I want to do some processing on a smaller subset of the array, and obtain similar results to as if i was using the whole array.

the processing is:

1) recevie data: 10 points

2) take mean of these 10 points

3) divide array/mean

and more processing which is not important.

the original array can have up to thousands of points. I know I can use a moving average, which i have done. so the average of the points 1:10 and 11:20 is the same as points 1:20.

however the problem is the third step, dividing each data by the mean.

in the end i want to plot the subset outputs, and i want it to be similar to processing the enitre data set.

Im not an expert in filters and all, but is there a good way to do this?

because the result i am getting now is quite choppy and unsmooth.

thanks!

Inertia

Member

09-10-2014 04:01 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hooovahh

Proven Zealot

09-10-2014 04:06 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

If you are averaging data, and it is choppy, there are likely multiple things wrong. The data is only going to be as good as the the sensor can measure. And if you are getting crappy data at the sensor, then software should not be the one to fix it. Fix the environment so the sensor gets the best data it can before software has to be involved.

That being said some times software filtering is needed and that's okay. Try to post what an example of your code. It is hard to understand what you are trying to do. Do you want a moving window of data to average? Or are you trying to understample where 10 values are now 1?

Unofficial Forum Rules and Guidelines

Get going with G! - LabVIEW Wiki.

14 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord

altenbach

Knight of NI

09-10-2014 04:10 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

try the mean ptbypt function in a FOR loop with a useful sample lenght, then autoindex your array into it.

09-10-2014 04:21 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

the data is good.what i meant by choppy was the results of the subarray processing compared to the whole-array processing.

basically i want to perform the 3 steps for a whole data set(thousands of points) and for subarrays(7-10 points) and be able to get similar results.

right now the results arent very similar, it gets better if i increase the size of my subset array (obviously!). but the problem is since i only receive the data in small subsets(7-10) points, i want to process them right away, and not have to wait to get more points.

I have the whole array in advance, but just as a reference. the real problem is assuming i only have access to the smaller subset of data points.

thanks a lot!!

09-10-2014 04:43 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Im not sure how this solves the problem...i;ve attached a vi that uses pt by pt mean.

altenbach

Knight of NI

09-10-2014 05:50 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Your VI contains no data in the array control.

09-11-2014 07:00 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Oh sorry, but u can assume any input array, lets assume 1:10.

altenbach

Knight of NI

09-11-2014 09:26 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

So why do you think it does not work? What result do you expect instead?

09-11-2014 09:54 AM - edited 09-11-2014 09:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

ok lets say A = [1 2 3 4 5 6 7 8 9 10];

but I actually recevie it as B1 = [ 1 2 3 4 5] and B2 = [ 6 7 8 9 10]

the mean of B1 :3

mean of B2: 8

so the ouptuts would be C1 = B1/ meanB1 = [ 1/3 2/3 3/3 4/3 5/3]

and C2 = B2/ meanB2= [6/8 7/8 8/8 9/8 10/8]

the origianl array A would be: C3 = A/meanA = [1/5.5, 2/5.5 ,3/5.5, 4/5.5, 5/5.5, 6/5.5 ,7/5.5, 8/5.5 , 9/5.5, 10/5.5]

so obviously plotting C1 and C2 (one after another) is not the same as C3.

my goal is to make C1 and C2 as similar as possible to C3.

I hope this is more clear!