Hi,
I am making a Shortt Free Pendulum clock and record the time error. When making changes to the tuning of the pendulum you must stop it from moving. This creates artifacts in the time data which are a nuisance when plotting trends. To get rid of these artifacts I made a median filter class with a variable window. I use a list as the window as this makes sorting a breeze. However a median filter is a blunt instrument so I added a couple of side salads.
The first of these applies exception limits to the data and whilst the data is within these limits the data is smoothed with a moving average of the window size.
The second one simply outputs the input when the data is within the exception limits, but if the data goes out side the limits the median filter is sued to produce the output.
I hope someone finds this useful.
Best regards
Rob
PS
Kim Studio found a nasty bug which I have fixed along with some other equally nasty bugs.
I am not happy with the data last end case for the median with moving average and median with limits. It works OK for a single exceptio, but witjh a positive and negative exception in close proximity; not so good. I will have another look at this when I have time.
Any ideas would be appreciated.
I have updated the attached file.
A library class is included in the zip.
I am making a Shortt Free Pendulum clock and record the time error. When making changes to the tuning of the pendulum you must stop it from moving. This creates artifacts in the time data which are a nuisance when plotting trends. To get rid of these artifacts I made a median filter class with a variable window. I use a list as the window as this makes sorting a breeze. However a median filter is a blunt instrument so I added a couple of side salads.
The first of these applies exception limits to the data and whilst the data is within these limits the data is smoothed with a moving average of the window size.
The second one simply outputs the input when the data is within the exception limits, but if the data goes out side the limits the median filter is sued to produce the output.
I hope someone finds this useful.
Best regards
Rob
PS
Kim Studio found a nasty bug which I have fixed along with some other equally nasty bugs.
I am not happy with the data last end case for the median with moving average and median with limits. It works OK for a single exceptio, but witjh a positive and negative exception in close proximity; not so good. I will have another look at this when I have time.
Any ideas would be appreciated.
I have updated the attached file.
A library class is included in the zip.
Attachments
Last edited: