필터 지우기
필터 지우기

find the start point of abrupt change in signal matlab

조회 수: 8 (최근 30일)
Demet
Demet 2022년 8월 19일
댓글: Demet 2022년 8월 22일
Hello,
I have a signal as y = [x y sh oa ahdv ...] and looks like as below:
I need to find the the point where signal increased abruptly and tried diff(), findchangepts(), ischange(), etc but any of them did not help me. I have 100 sample looks like this data so I am looking for a function that can do this job automatically.
I would be very grateful if anyone could help me.
Thanks.
Demet
  댓글 수: 2
Chunru
Chunru 2022년 8월 19일
Attach your data.
Demet
Demet 2022년 8월 19일
Hello,
Here is a data sample attached.
Thanks.

댓글을 달려면 로그인하십시오.

채택된 답변

Chunru
Chunru 2022년 8월 20일
편집: Chunru 2022년 8월 22일
load triggerInput.mat
plot(trigger)
trigger = trigger(1:2e4); % select the 1st part
%xlim([1 1e4])
%xlim([1500 2500])
% low pass the signal
%{
b = fir1(128, 0.001);
y = filtfilt(b, 1, trigger);
ipt = findchangepts(y,'MaxNumChanges',2)
yd = diff(y);
idx = find(yd>3e-3, 1, 'first')
figure
hold on
plot(y)
plot(trigger, 'r:');
xline(ipt, 'g');
grid on; box on
xlim([1 2e4])
fprintf('The change point at %d\n', ipt(2))
%}
Update based on your new explanation:
b = fir1(128, 0.001, 'high');
y = filtfilt(b, 1, trigger);
ipt = findchangepts(y,'Statistic', 'rms', 'MaxNumChanges',2)
ipt = 1×2
1733 7865
figure
hold on
plot(y)
plot(trigger, 'r:');
xline(ipt, 'g');
grid on; box on
xlim([1 2e4])
  댓글 수: 3
Chunru
Chunru 2022년 8월 22일
See the update
Demet
Demet 2022년 8월 22일
Hello,
I have checked the update and it works almost well. I have checked for each data and I decide to continue with this program as the maximum error is 30 for the sampling frequency is 512 (30/512=0.57 s).
Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by