Linear segmentation of noisy data
古いコメントを表示
Hi,
I would like to divide my noisy data into a set of linear segments.

As seen in the above figure. I can measure the red noisy signal. The signal in its nature should be composed of linear segments.
Is there a robust way to perform this segmentation? I.e. convert the red noisy data into the black lined segments.
Thanks!
Regards,
Omar
採用された回答
その他の回答 (1 件)
Bruno Luong
2020 年 9 月 3 日
編集済み: Bruno Luong
2020 年 9 月 3 日
Similar topic discussed here
Using my solution of BSFK
% Generate random data
N = 5; % number of linear segments + 1
breaks = cumsum([0, 1+rand(1,N)]);
yb = rand(size(breaks));
coefs = zeros(N,2);
for k=1:N
coefs(k,:)= polyfit(breaks([k,k+1])-breaks(k),yb([k,k+1]),1);
end
pp = struct('form', 'pp',...
'breaks', breaks, ...
'pieces', N, ...
'coefs', coefs, ...
'order', 2,...
'dim', 1);
n = 1000; % number of data point
sigma = 0.01; % Gaussian noise std
x = linspace(min(breaks),max(breaks),n);
y = ppval(pp,x) + 0.05*randn(size(x));
%%
close all
BSFK(x,y,2,[],[],struct('annimation',1)); % FEX

カテゴリ
ヘルプ センター および File Exchange で Descriptive Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



