フィルターのクリア

Extract a portion of an accelerometric signal around a maximum

1 回表示 (過去 30 日間)
Guglielmo Giambartolomei
Guglielmo Giambartolomei 2020 年 9 月 8 日
Hello to everyone, I have an accelerometric signal (1st column : time ; 2nd column : acceleration values);
I would like to find the y_max and the corresponding x_max (I am able to do it) and starting from that precise point, extract a portion of the signal, for example 5 seconds before and 5 seconds after that point. I would like to write this new portion of the signal in a new file. This is how I started the code:
clc;
close all;
clear all;
format long
T = readtable('AT4H1X11.ASC','filetype','text','decimal',',');
T(:,3:end) = [];
Fsa=600; %frequenza di acquisizione
Ta=1/Fsa; % periodo di acquisizione
t_acc=T.Var1; %estrapolazione prima colonna (tempi);
s_acc=T.Var2; %estrapolazione seconda colonna (accelerazioni);
%N_s_acc=length(s_acc); % Numeno di valori
%t_s_acc=linspace(0,N_s_acc*Ta,N_s_acc); % Ricostruzione tempi
AT4H1X11_max_acc=max(abs(s_acc(1:end,1)))
T_arr=table2array(T);
[ymax,idy]=max(abs(T_arr(:,2)))
xmax=T_arr(idy,1)
Thank you very much!
  7 件のコメント
Amrtanshu Raj
Amrtanshu Raj 2020 年 9 月 10 日
Hi,
Can you attach the 'AT4H1X11.ASC' file so that we can understand your problem and help you with the exact solution for your case.
Guglielmo Giambartolomei
Guglielmo Giambartolomei 2020 年 9 月 18 日
Hi Amrtanshu,
unfortunately the ASCII file is bigger than 5 mb.
Thank you anyway!

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by