"bubble sort" method code

Hello to all,
I have a question about coding in IgorPro. I am trying to filter an experimental signal contained in a wave. I'm trying to smooth out this signal.

I would like to use the "bubble sort" method. I do not know how to code it as I am a beginner on this software. Anyone know how to translate this code?

Thank you


Here is a zoom on the signal I want to filter

Do you just want the data sorted in numerical order?

Sort myWave, myWave // ascending
Sort/R myWave, myWave // descending

Try these inbuilt operations, a quick read about Bubble sort suggests it is very inefficient.

I suggest you look at the median filtering provided by Igor's built-in Smooth operation.