# Estimating the period and the damping of the system

4 views (last 30 days)
Obsidian on 19 Jul 2021
Commented: Obsidian on 19 Jul 2021
Hello,
I am new with MatLab. I want to Estimate the period and the damping of the system from a set of data using three values of j cycles:
j = 10 cycles, 20 cycles, 30 cycles
For each case c.I, c.II, and c.III I am supposed to use different starting peak (i.e., moving window of peaks) and calculate the median value of damping ratio and natural period for each case C.I, C.II, and C.III. and also tabulate the results.
I appreciate the help!
I used following code to extract and plot data and I am stuck on how to find period and damping:
code:
clc; clear all; close all
acc = Vibration_Data(:,2);
dt = 0.02;
time = (0:numel(acc)-1) * dt;
plot (time,acc,'b-');
findpeaks(acc,time)
peaks=findpeaks(acc,time)
period=time(peaks)-time(peaks(0:size(peaks)-1))
error:
last line: array indices must be positive integers or logical values.
##### 2 CommentsShowHide 1 older comment
Obsidian on 19 Jul 2021
Thanks! it worked.

Simon Chan on 19 Jul 2021
This line will give an error:
period=time(peaks)-time(peaks(0:size(peaks)-1))
So just try the following:
period=time(peaks)-time(peaks-1)
Obsidian on 19 Jul 2021
still gives me the same error.