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 ?

2 ビュー (過去 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 Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by