Extract a portion of an accelerometric signal around a maximum

2 visualizaciones (últimos 30 días)
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 comentarios
Amrtanshu Raj
Amrtanshu Raj el 10 de Sept. de 2020
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 el 18 de Sept. de 2020
Hi Amrtanshu,
unfortunately the ASCII file is bigger than 5 mb.
Thank you anyway!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by