fSGolayFilt

版本 1.3.0.0 (20.0 KB) 作者: Jan
Fast Savitzky Golay filter as multi-threaded C-Mex
4.5K 次下载
更新时间 2010/6/9

查看许可证

fSGolayFilt is a fast polynomial smoothing filter for uniformly spaced signals. This implementation offers less flexibility than other versions found in the MATLAB Central (eg. from Jianwen Luo, YangQuan Chen or Vassili Pastushenko), but it is optimized for speed by using a C-Mex function for the calculations.

Y = fSGolayFilt(X, K, F, [W], [Dim])
INPUT:
X: Noisy data, real DOUBLE or SINGLE vector or array.
K: Polynomial order.
F: Length of the moving window.
W: Weighting factors, optional.
Dim: Dimension to operate on, optional.
OUTPUT:
Y: Smoothed data, same size and type as X.

Compared to SGOLAYFILT of the Signal Processing Toolbox of Matlab 2009a, this implementation is 70% to 85% faster for short [100 x 1] and large [1E7 x 1] vectors (see screenshot taken on a single threaded machine). Multi-threading can increase the speed remarkably, but Matlab's filter method benefits from multiple cores also.

The C-mex have to be compiled as usual: mex -O fSGolayCore.c
Unfortunately multi-threading is implemented for Windows only. For OS-X and Linux a single-thread version is included. For futher help see fSGolayCore.c, e.g.: how to set the maximum number of threads at compile time and limit the number of used threads at run time.
After compiling run the unit-test TestfSGolayFilt to test validity and speed on your machine. The test does not need the Signal-Processing-Toolbox anymore.

Mar-2009: This new version is compatible with 32 and 64 bit addressing. Now the initial and final phases are computed in the Mex also to improve the performance by about 10%.
Jun-2010: Optimized for MSVC 2008 (30% faster). Multi-threading increases the speed in addition. Input [Dim]. Computes DOUBLE and SINGLE arrays.

I'd appreciate suggestions for improvements and bug reports sent through email - thanks.

引用格式

Jan (2024). fSGolayFilt (https://www.mathworks.com/matlabcentral/fileexchange/5661-fsgolayfilt), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2009a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Smoothing and Denoising 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.3.0.0

SINGLE support, multi-threading, faster execution, Dim can be specified, unit-test does not need SPT anymore.

1.2.0.0

32 and 64 bit addressing, improved performance

1.1.0.0

Inserted a notes for compatibility with Matlab 2009a.

1.0.0.0