Hampel filter (built-in) in matlab 2016b way faster than the one from the file exchange
2 次查看(过去 30 天)
显示 更早的评论
Hi all,
I am using a 32 bit pc for my analysis, which limits me to matlab 2015. The hampel filter is introduced in matlab 2016.
There is a hampel filter in the file exchange which produced the same results compared to 2016.
https://nl.mathworks.com/matlabcentral/fileexchange/34795-outlier-detection-and-removal--hampel-
However, this filter needs to have the input of the time as well. Not a real problem, but for some reason this filter lasts about 100 seconds (1500000 points) while in matlab 2016 it only lasts a few seconds.
due to privacy I can't use the 2016 pc so I hope there is a solution for this! :)
Greetings Martijn
3 个评论
Greg Dionne
2017-3-22
OK. Have you tried the MEX file FEX submission that does the uniformly-sampled version? Put it in a directory and do "mex hampelFilter.cpp" and try running it. Hopefully it will compile and work ok.
It seemed to work fine for me:
>> mex hampelFilter.cpp
Building with 'Microsoft Visual C++ 2015 Professional'.
MEX completed successfully.
>> data=[1 2 3 15 5 6 7 8 9 10];
>> hampelFilter(data, 3, 3)
ans =
1 2 3 5 5 6 7 8 9 10
回答(1 个)
Jan
2017-3-22
编辑:Jan
2017-3-22
The main work inside Matlab's hampel function is done in movmad.mexw64, a compiled executable for Windows 64. There is no chance to run it on a 32 bit system.
There is some potential to improve the FEX version. Most of all replacing the moving median filter by a C-mex function. To check if more simplifications are possible:
- Is your x always 1:numel(data)?
- Do you use the 'standard' or the 'adaptive' method?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital and Analog Filters 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!