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!



