Smoothing data with sgolay filter

조회 수: 10 (최근 30일)
Prayander Sahatma Siahaan
Prayander Sahatma Siahaan 2022년 9월 27일
답변: Star Strider 2022년 9월 27일
Hi i have a question, if i have a code like this before,
smootheddata = smoothdata(z,"sgolay", "SmoothingFactor",0.25 );
how i exprese it in sgolay function ? Thank you

답변 (2개)

Chunru
Chunru 2022년 9월 27일
편집: Chunru 2022년 9월 27일
framelen = 11; order = 3; % adjust these values
smootheddata = sgolayfilt(z, order, framelen);

Star Strider
Star Strider 2022년 9월 27일
The default order for the 'sgolay' option is 2 (quadratic), however the 'SmoothingFactor' controls the window length (framelen in the sgolayfilt documentation), it has no exact definition, so an exact translation to sgolayfilt parameters is not possible for it.
For sgolayfilt I generally choose an order of 3 and an initial framelen value of 5% of the signal length. I then adjust the framelen value to get the result I want. It is possible to control these in the smoothdata function by setting the 'Degree' and window parameters.

카테고리

Help CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by