Hi,
I had a look this morning and thought it might be to do with the way you are using the shared variables, but I have had another look and your usage looks fine.
From what I can see, the peaks are always positive, a problem in variable handling would usually generate some negative peaks as well.
This makes me think that at some point you are blocking interrupts for too long and a pulse edge is getting missed, your pulse will then be as long as the entire frame - does that look consistent with the full graph ?
Duane B