キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

skip data points

Hi there,

In attached VI one can see a dataset from which I want to remove some data points.

I already removed the points far away from the shape I'm interested in but I struggle with some others スマイリー 悲しい

 

When you zoom the XY graph in region (X: 0 to 25 and Y: 47 to 75) or (X: 80 to 120 and Y: -5 to -30) one can see that the data points doesn't form a smooth line. It's just like if there are some "bulge" in those area's. I want to get rid of those “bulges”!

Basically I want to keep the data points that forms the smooth inner shape and remove the outer ones.

They can be deleted, no need to replace them by something else.

 

Any idea how I can do that ?

 

Thanks for any reaction.

 

Please note that I’m using LV8.6.

0 件の賞賛
メッセージ1/6
4,808件の閲覧回数

I can think of two ways to do this.  I'm assuming you can "identify" the points that need to be removed, that is, you can form an array "RemoveMe" with indices (plural of index) of the X and Y points that you do not want to display.

 

Since X and Y are arrays, one solution is to simply use the Delete from Array function to remove the unwanted points.  The caveat here is that if you remove, say, point 1, then all the indices of the higher points will change (i.e. old point 2 will become new point 1).  The solution to this is to reverse your RemoveMe list of indices so you remove points from the end of the array first, thereby not messing up the index of earlier points.

 

A simpler solution (when you have Dbl data, as you do here) is to, instead, use Replace Array Subset and replace the "bad" X and Y values with NaN (Not a Number).  This simply doesn't plot.  The advantage here is that your array stays the same size, making indexing simple.

 

Let us know if this fixes your problem.

0 件の賞賛
メッセージ2/6
4,777件の閲覧回数

The problem is to identify the points that makes the shape un-smooth.

Deleting is not an issue, there are "50 ways to delete elements from arrays", you gave us 2 スマイリー ハッピー

In attached VI; use the "Idx" control to scroll manually through the data points or press the "Auto" button to do it automatically.

You will se that there is almost no difference in both X and Y data between the datapoints I want to keep and those who un-smooth the shape.

0 件の賞賛
メッセージ3/6
4,762件の閲覧回数

Hello Alain,

 

The first thing that popped into my mind when reading your post was curve fitting.

 

This gives you the curve y=curve(x)

 

The second thing was eliminating the elements with an absolute deviation from the curve that is bigger than a certain percentage (eg. 5%).

 

In dummy code:

 

Delete sample(x) if  ( |sample(x) - curve(x)| / |Curve(x)| > 0.05)

 

How you do the curve fitting is something else 🙂

 

There are alot of options.

An overview of some of those options can be found over here:

http://www.ni.com/white-paper/6954/en

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 件の賞賛
メッセージ4/6
4,751件の閲覧回数

Hi Thierry,

 

I already tried the cubic spline fit but since all data points are changed I was not satisfied.

So I will give you're "Compare & Delete" step a try... ...

What troubles me more is the "Balance" parameter for the cubic spline, it influences the result enormously.

I had rather good results with the factor 1e-7, try to explain that to the final user of the software スマイリー 悲しい

 

I started this thread in the hope of a parameter-free-solution... ... ...

Maybe I'm a dreamer スマイリー ハッピー

0 件の賞賛
メッセージ5/6
4,730件の閲覧回数

Hello Alain S,

 

With an averaged measurement you might be able to get a looser fit.

 

With a single set of values it's quite difficult to get "nice and smooth" graphs.

Noise (amongst all kinds of influences) can quite often be a big source of "peaks"...

 

Please let me know if I can help you with anything.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 件の賞賛
メッセージ6/6
4,725件の閲覧回数