Dave thank you for your positive comment.

Charlie if you read more carefully my introduction, you will note that I am refering to UNWANTED NOISE, some thing you want to remove from your measurement.
The algorithm posted will return the true MEDIAN of 15 ADC reading, nothing to do with the mode, even if in some cases MEDIAN; MODE and MEAN can coincide.

If you are interested in oversampling than the algorithm posted is not sutable since it will remove all the noise you are after, and very likely the sampling time will not respect the Nyquist theorem requirement

Thank you for your comment

Cheers

Al