Hello,
It would be very nice if somebody could give me some suggestions how to accomplish the following:
I have a 1D-raw data array with e.g. 10 data elements. First, I need to determine the average (nu) and the standard deviation (sigma) of all array elements. After that, I need to calculate the absolute difference (delta) for each single array element (i.e.: array element - nu = delta(normalized)). For each array element I have now the corresponding absolute difference (delta). Please see attached example.
Now, I have to delete all array elements (out of the 1D-raw data array) which meet the following expression: (array element - delta) > 3x sigma. The result will be an improved 1D-array without the "bad" array elements.
How do I do this kind of data rejection in the fastest and most efficient way? I have attached my first steps in this procedure, but I do not know how to realize the comparison: (array element - delta) > 3x sigma , for the element rejection.
If somebody could help me with this it would be very much appreciated.
Kind regards,
Beam
p.s. I think that using the "remove from array" function would not be the fastest way, because this function will resize the array after an element is rejected. I think, maybe using a loop structure will be faster? My real life 1D-arrays will have ~256-512 elements.