Sorry, I don't really understand what you are trying to do, or better said, what the requirement is and which logic should be applied.
Using subfield() may be a reasonable way to do what you want, but without knowing what you need, it's hard to say.
Why don't you just post your current script and explain a bit more what you need to do in a more abstract way (how do you determine the noise values, for example? What are fields A, B for? do you need to concatenate the C values again after removing the noise?).
So maybe someone can suggest a more 'elegant' way or at least some alternative implementation.