05-20-2011 02:46 PM
@altenbach wrote:
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! 😄
Ok, I'll try but can u how to realize this C code in labview? Can I check the difference between original and filtered signal by simple subtract? but it must be done also in this for loop right? or search values bigger than x in resulted array but I require second for loop?
C code:
for (i=1; i < size ; i++) { if ( Y[i]>Y[i-1] && Y[i]>Y[i+1] ) { if(Y[i]>1.5*Y[i-1] && Y[i]>1.5*Y[i+1]) { Y[i] = (Y[i+1]+Y[i-1])/2; i1++; } else Y[i]=Y[i]; } else { if(Y[i]<Y[i-1] && Y[i]<Y[i+1]) { if(Y[i]<0.5*Y[i-1] && Y[i]<0.5*Y[i+1]) {Y[i] = (Y[i+1]+Y[i-1])/2; i2++;} else Y[i]=Y[i]; } else Y[i]=Y[i]; } }
05-20-2011 03:01 PM
05-20-2011 03:32 PM
@altenbach wrote:
try this:
Looks really nice but I don't understand why it's not working with some signals? I attached them.Is it depends of Y scale?
With the others works great!
05-20-2011 04:01 PM
You probably need to tune the threshold. Haven't looked at your data....