필터 지우기
필터 지우기

Plotting the the acceleration data of the degree of freedom versus the time.

조회 수: 2 (최근 30일)
I am given the data for acceleration (almost 3 pages) and the question says that the sampling rate for all of the experiments was 50 Hz (50 samples per second, or delta_t= 0.02 sec. I am supposed to plot the acceleration data vs time and also find the peaks of acceleration that accurs during the free vibration. I loaded the acceleration data file and extracted data from the column but I am not sure how to specify the time data when I am only given the time step and how to mark the peaks. I appreciate the help! I get the following error:
Code:
clc; clear all; close all;
load VibrationSDOF_Data.txt
acc = VibrationSDOF_Data(:,1);
time =[0: 0.02: 110]
plot (time,acc,'r-');
Error:
error using plot
vectors must be the same length

채택된 답변

Walter Roberson
Walter Roberson 2021년 7월 19일
Change
time =[0: 0.02: 110]
to
dt = 0.02;
time = (0:numel(acc)-1) * dt;
  댓글 수: 5
Walter Roberson
Walter Roberson 2021년 7월 19일
Finding peaks of noisy data is a bit difficult to reliably tell the difference between noise and signal.
Especially with acceleration data (which is notorious for being noisy), it is common to first apply a low-pass filter or moving-median filter. After that, there are a number of different approaches.
One of the approaches is to use max() to find the maximum; that is one peak. Then set that location and a distance on each side of it to NaN, and find the max() again. Keep repeating that until the max value you found is less than some threshold you set .

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Chunru
Chunru 2021년 7월 19일
Make sure time and acc have the same size
time =[0: length(acc)-1]*0.02;
plot (time,acc,'r-');

카테고리

Help CenterFile Exchange에서 Get Started with Signal Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by