Looking at the oscilloscope image it appears that some of the spikes are only one pixel wide. Do you want to follow those peaks or do you want to do some smoothing?
If I ignore the peaks, it looks like your signal ramps up to about 400 mV over a few hundred milliseconds, remains approximately constant for 2 seconds, and then ramps back down again. Is that the kind of envelope you want?
I cnanot answer your question about the number of loop iterations until I understand your process better.
Lynn