how to robustly estimate low and up envelope of signal with trend, few level constant steps and noise

1 次查看(过去 30 天)
I am looking for robust estimation method of low and up envelope of the signal consisting from smooth trend component, constant steps between few fixed levels and additive noise (+ outliers of course). This question raised during my current research work on real life signal processing.
Typical example of signal is produced by following script:
%%signal definition
% number of samples
Ns = 10000;
% sampling period [secs]
Ts = 1;
time = (1:Ns)*Ts;
% trend component
a = 2;
b = 0;
T = 1e4;
slope = time/Ts * 0.0005;
trend = a * sin(2*pi*time/T) + b + slope;
% steps component (4 constant levels)
step = [zeros(1,1000),linspace(0,1,6),1*ones(1,500),linspace(1,0,6),zeros(1,500),linspace(0,-2,10), -2*ones(1,1200),linspace(-2,1,15),1*ones(1,3000),linspace(1,0,6), zeros(1,3000),linspace(0,-1,6), -1*ones(1,751)];
% noise component (normal noise)
noise = 0.2*randn(1,Ns);
% noise = 0.5*(rand(1,Ns)-0.5);
%
%%show signals component
close all
figure
plot(time,trend,'r-')
hold on
plot(time,trend+step,'g-')
plot(time,trend - 2, 'b--')
plot(time,trend + 1, 'k--')
plot(time,trend+step+noise,'mo')
legend('trend','trend+steps','lowenvelope', 'upenvelope','trend+steps+noise')
title('smooth trend signal with constant steps between 4 levels and noise')
xlabel('time [sec]')
ylabel('value [-]')
hold off
See the following image
The separate signal components are unknown! Steps are always constant and between small number of fixed levels (typically < 4 or 5), so the estimated envelopes should be parallel to the trend signal. Noise is approximated by normal distribution with sigma ~0.1
Any idea how to solve this surprisingly difficult problem? Any relevant references or matlab code links?

采纳的回答

Marcel Goldschen-Ohm
编辑:Marcel Goldschen-Ohm 2021-11-14
smBEVO, a new computer vision-based approach to single-molecule data series baseline drift estimation can solve this problem. smBEVO can identify each of the four levels in the data above and the overall baseline trend. Matlab function and app for smBEVO is available at https://github.com/marcel-goldschen-ohm/smBEVO along with an example of usage. I recommend the app for visualization. A preprint article describing smBEVO is available on bioRxiv at https://doi.org/10.1101/2021.11.12.468397.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Measurements and Feature Extraction 的更多信息

产品


版本

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by