I wrote this to detect shapes that I know before hand (like sawtooth and steps). So if your "peak" shapes are consistent, it could find those two without changing the original signal. You need to play with parameters, but I think it will work:
And then I've always had success with peakfinder: https://www.mathworks.com/matlabcentral/fileexchange/25500-peakfinder-x0-sel-thresh-extrema-includeendpoints-interpolate