Interpolating random values to smoothen a curve

조회 수: 7 (최근 30일)
Abhiraj Gupta
Abhiraj Gupta 2019년 7월 22일
댓글: TADA 2019년 7월 23일
I need to smoothen curve on this graph and remove the noise in it.I can either use interpolation or curve fitting. I am not able to do it using curve fitting toolbox.How can I do it..??
  댓글 수: 1
KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 7월 22일
Please do share the code. so that members can try on it.

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

채택된 답변

TADA
TADA 2019년 7월 22일
you can implement the stavisky golay filter
basically the idea is to iterate through the data and on each point perform a polynomial fit on a window of several data points arround it, then each point is reoplaced with the value of the polynomial fit in that same point.
  댓글 수: 2
Abhiraj Gupta
Abhiraj Gupta 2019년 7월 23일
Thank you !
order=1;
framelen =3;
for i=1:100
if(i==1)
y = sgolayfilt(data,order,framelen);
else
y = sgolayfilt(y,order,framelen);
end
end
this is giving perfect and smooth curve
TADA
TADA 2019년 7월 23일
In that code you apply the smoothing 100 times on the entire data
This is very intense and it will probably damage your signal
I would apply the smoothing once, but I would use a larger frame
I would also use a higher order fit

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

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by