Rolling median algorithm in C

前端 未结 13 1733
臣服心动
臣服心动 2020-11-27 09:24

I am currently working on an algorithm to implement a rolling median filter (analogous to a rolling mean filter) in C. From my search of the literature, there appear to be t

13条回答
  •  眼角桃花
    2020-11-27 10:09

    If you just require a smoothed average a quick/easy way is to multiply the latest value by x and the average value by (1-x) then add them. This then becomes the new average.

    edit: Not what the user asked for and not as statistically valid but good enough for a lot of uses.
    I'll leave it in here (in spite of the downvotes) for search!

提交回复
热议问题