Smoothing only peaks in a Curve

조회 수: 1 (최근 30일)
Anirudh
Anirudh 2014년 2월 21일
댓글: Anirudh 2014년 3월 31일
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

답변 (2개)

Nitin
Nitin 2014년 2월 22일
Did you check the smooth function?

Image Analyst
Image Analyst 2014년 2월 22일
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
Image Analyst
Image Analyst 2014년 2월 28일
Anirudh, what's the status of this? Are we done? Do you need a more comprehensive demo? Did I answer your question?
Anirudh
Anirudh 2014년 3월 31일
Image Analyst, Thanks for writing back :).
I used the conv() function, smoothed the curve and replaced only a certain smoothed part (say X=750 to X=820), in the raw signals. I then smoothed this entire curve once again to eliminate the steps at X=750 and X=820.
But this is not a very convincing method as I'm deviating from the original values by more, so I'm still on the lookout for a better solution to this.
Thanks, Anirudh

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by