필터 지우기
필터 지우기

Extract a portion of an accelerometric signal around a maximum

조회 수: 1 (최근 30일)
Guglielmo Giambartolomei
Guglielmo Giambartolomei 2020년 9월 8일
댓글: Guglielmo Giambartolomei 2020년 9월 18일
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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by