From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-18-2011 01:31 PM
I tried to use very simple wave - one period of triangle, with some bad values and there's no good solution;/
I attached this signal, have U got any idea what to do? In my opinion solution with average should work but itsn't 😞
05-18-2011 01:54 PM
edit:
I don;t undertand 2 tihings:.
1. I made this signal by myself, every value is bigger or smaller by 1 than one before and one after so my idea should work...
2. Why it's working for values bigger than neighborhood but isn't working for values smaller?
check this:
what's wrong??
to mods - please join both posts
05-18-2011 02:22 PM - edited 05-18-2011 02:24 PM
It is part of the simple current algorithm which takes the smallest value of the three. Maybe you want to take the average of the two values that are most similar, for example. Can you guarantee that the spikes are never more than a single point wide?
05-18-2011 02:32 PM
@altenbach wrote:
It is part of the simple current algorithm which takes the smallest value of the three. Maybe you want to take the average of the two values that are most similar, for example. Can you guarantee that the spikes are never more than a single point wide?
No, I can't guarantee but I just want to create simply algorithm to eliminate single spikes. I see what's wrongs - I've checked how many times the value of cause was false and it was completely different that I expected: false was about 7 times, true - 9986 should be vice versa...
05-18-2011 06:22 PM
Here's is a modification that, for each set of three, retains the value that is closest to the average. Should work with your triangle wave, but I have not tried.
05-20-2011 08:48 AM
I've got bad news - when we have a signal with less points e.g. 100 instead of 10000 it's look really bad, but I tried to fix it and I wrote it formula node but there's still not enough;/ I think that I miss one condition but which and where?
I attached my vi (converted to LV8.6)
It's look like this:
The values of i1 and i2 should be 3 <- 6 bad values
And I know that the problem is the point before the bad one cause it fits the conditon if(Y[i]<Y[i-1] && Y[i]<Y[i+1]) ... how can I fix it? And how can I convert it to G language?
05-20-2011 10:08 AM
MeeHow wrote:It's look like this: The values of i1 and i2 should be 3 <- 6 bad values
I don't know what you mean by i1 and i2 and "3 <- 6", can you explain? Is this some sort of code?
Please attach the small data file that does not work using my code.
I don't understand why you use a big sequence structure, it has no purpose.
05-20-2011 12:57 PM
@altenbach wrote:
MeeHow wrote:It's look like this: The values of i1 and i2 should be 3 <- 6 bad values
I don't know what you mean by i1 and i2 and "3 <- 6", can you explain? Is this some sort of code?
Please attach the small data file that does not work using my code.
I don't understand why you use a big sequence structure, it has no purpose.
i1 and i2 show how many times runs filter I mean how many times samples fits specified conditions. If there's 6 bad values i1+i2 should be 6. As you can see there'e 2 major parts of conditions, one for values bigger than expected, and the second for lower values. If there's 3 values bigger i1 should be 3, i2=3 means 3 lower values.
The image shows what I'm talking about, I've taken 600 samples from file that I attached, zoom is not so big but you can see that signals are different;/ Is it possible to fix it? I mean that the only difference between signals are bad values? Your code is working great but it replace all values, and I wanted to replace only bad values... is it possible?
05-20-2011 01:20 PM
edit:
same result as your code u can receive when using median filter, it won't work when signals changes really fast, this is the problem
05-20-2011 02:16 PM - edited 05-20-2011 02:20 PM
Of course there is a solution, but it involves more math if you don't want to touch the existing data. Currently we get some smoothing which seemed beneficial to me. It is well within the noise of your data.
You could re-use my last code, but replace the outlier with a linear inter of the two others for positions where the outlier is in the center of the three and ignore otherwise.
You could also do a difference of the current result and only retain the new data for points where the difference is above a certain threshold.
etc. etc.
Try it! 😄