Extract a portion of an accelerometric signal around a maximum

2 次查看(过去 30 天)
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
Hi Amrtanshu,
unfortunately the ASCII file is bigger than 5 mb.
Thank you anyway!

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by