フィルターのクリア

Question regarding the smooth filter function when using the Savitzky-Golay method

5 ビュー (過去 30 日間)
Alberto Paredes
Alberto Paredes 2021 年 8 月 17 日
回答済み: Star Strider 2021 年 8 月 19 日
When using the following line of code what is my polynomial order and frame width for my Savitzky-Golay filter? What are these default settings?
Y = smoothdata(X,'sgolay');

回答 (2 件)

Jan
Jan 2021 年 8 月 19 日
According to the documentation, the degree can be determined and the window size is replied as 2nd output:
% SMOOTHDATA(...,'sgolay',...,'Degree',D) specifies the degree for the
% Savitzky-Golay filter.
% [B, WINSIZE] = SMOOTHDATA(...) also returns the moving window length.
You can set a breakpoint in the code of smoothdata to see, how the parameters are determined. In Matlab R2018b this line would be my point to start:
[dim,method,winsz,nanflag,t,sgdeg,dvars] = parseInputs(A, varargin{:});

Star Strider
Star Strider 2021 年 8 月 19 日
From the documentation:
‘... a fixed window length that is determined heuristically
This can be returned as the second output from smoothdata if requested.
and for 'Degree' (see Smoothing Options):
The value of 'Degree' corresponds to the degree of the polynomial in the Savitzky-Golay filter that fits the data within each window, which is 2 by default.
(I prefer 'Degree',3, so I always specify it.)

カテゴリ

Help Center および File ExchangeSmoothing and Denoising についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by