Smoothing only peaks in a Curve
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
The curve I have is shown in the image. Is there a way I could smooth only the peak, which is around the X=800 mark, ideally keeping the rest of the data as the raw signals.
In case I decide to join a raw and a smoothed curve (using a filter), the problem then I face is the joining point of the raw curve and the smoothed curve, which shows a step (undesired).
I would like to ideally keep the raw data till X=720 (point where constant rise starts), then continue with the raw data through the constant slope, i.e from x=720 to the point where smoothing of the peak starts, perform a smoothing with a factor and rejoin back with the raw data once the smoothing is done (keeping that step in mind again).
I was talking to one of the correspondents and it was nice of him to help me out on this thread, http://www.mathworks.com/matlabcentral/answers/116391-smoothing-only-a-part-of-a-curve#answer_124995 but I'm kinda needing an urgent answer, and if possible today.
Could anyone out there help me out on this one?
Regards,
Anirudh
Respuestas (2)
Image Analyst
el 22 de Feb. de 2014
Just smooth the whole thing, say with conv() to do a sliding average or with sgolay to so a sliding polynomial Savitzky-Golay filter. Then replace the original pixels with the smoothed one in the range you want
smoothedSignal = conv(originalSignal, ones(1,9), 'same'); % or whatever
newSignal = originalSignal; % Initialize
% Replace region of interest with smoothed values.
newSignal(index1:index2) = smoothedSignal(index1:index2); % You determine the indexes in some way.
4 comentarios
Image Analyst
el 28 de Feb. de 2014
Anirudh, what's the status of this? Are we done? Do you need a more comprehensive demo? Did I answer your question?
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!