Hello, I've searched a bit but didn't find anything similar to this so I made this thread. If I'm wrong please merge it to the corresponding thread.
I 'm using an Arduino DUE to display an ECG to a LCD screen. In order to have maximum use of the LCD height I calculate max, min and average so I can display it as big as I can in my screen.
My issue is some spikes I occasionally have which ruin my max value. I thought about comparing old max with the new one and if it is much bigger to ignore it or making a matrix which will be updated with the last X measurements and then calculate matrix's max value.
But because of the nature of my signal I think the above solutions aren't the optimal one.
Can anyone suggest me how I can calculate a rolling max so if I get a very high max it will be replaced after a while by another -lower- max when my signal is significantly smaller?