I have a data set from an ORAS analyzer. It gives a cyclic pattern. i want to take each cycle and plot on top it ?

조회 수: 3 (최근 30일)
my dataset plots like this
i want to take each repeating cycle and plot on top of other.
like this below
  댓글 수: 1
Mathieu NOE
Mathieu NOE 2022년 3월 8일
hello
you can use findpeaks to locate the peaks of your signal
then define the buffer length around the peaks (like a mean value of the time difference between peaks)
and extract each individual buffer according to peak location and buffer length

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

답변 (1개)

Mathieu NOE
Mathieu NOE 2022년 3월 8일
hello again
a demo code below (data file in attachement)
hope it helps
clc
clearvars
data = readmatrix('data.txt');
time = data(:,1);
data = data(:,2);
figure(1);
plot(time,data);
[pks,loc] = findpeaks(data,'MinPeakHeight',5);
text(time(loc)+.2,pks,num2str((1:numel(pks))'));
% overlay individual peaks data
data_half_length = floor(0.5*mean(diff(loc)));
figure(2);
hold on
for ci = 1:numel(loc)
ind_start = max(1,loc(ci)-data_half_length);
ind_stop = min(length(data),loc(ci)+data_half_length);
plot(data(ind_start:ind_stop));
end
xlabel('samples');
ylabel('Amplitude');
title('Overlayed data plot');
hold off

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by