MATLAB: Imagine processing, elimination of oscillations

image processing

Hi,
I need to follow only the max peacks of the figure shown. I want a figure without oscillations. How can I do?
Regards, Nello

Best Answer

You can use imdilate() which gives the max value inside a sliding window. Or just scan the data replacing with the max if it ever falls below the prior value.
out = inputSignal % Make copy.
for k = 2 : length(out)
if out(k) < out(k-1)
out(k) = out(k-1);
end
end