Effacer les filtres
Effacer les filtres

Extract a portion of an accelerometric signal around a maximum

1 vue (au cours des 30 derniers jours)
Guglielmo Giambartolomei
Guglielmo Giambartolomei le 8 Sep 2020
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 commentaires
Amrtanshu Raj
Amrtanshu Raj le 10 Sep 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 le 18 Sep 2020
Hi Amrtanshu,
unfortunately the ASCII file is bigger than 5 mb.
Thank you anyway!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by