Extreme estimation. Notice I didn't say filtering.
I like Dr Watson's idea, but I would take it to the limit.
If I knew the wave action was sinusoidal then I could subtract out the sinewave leaving only the offset or water level to be filtered.
Amplitude = (max-min)/2
Period = time between maximums or time between minimums.
Current reading = amplitude*sin(2*PI*t/period)+ mean water level
or
mean water level = current read - amplitude*sin(2*PI*t/period)
Now one can estimate the mean water level for any time t between the waves.
Now I would filter mean water level to get an average.
The filtered average water level will be more accurate and will update faster.
I bet I can find some algorithms that do what I propose but I doubt they would run on a PLC. A S7-317 using ST may work if the waves are very slow. How does one fit a sine wave to a set of points?
Hey, did any catch the fact that when time t = 0 the value of the sine is 0. It would be better to use a cosine so one could count the time from the highest point of the wave. I am just checking to make sure you guys are paying attention.