current_fn = fn(ifile).name;
cm = readtable(current_fn, 'VariableNamingRule','preserve');
cmVar = cm.Properties.VariableNames;
plot(cm{:,1},cm{:,[2 3]})
legend(cmVar{[2 3]}, 'Location','best')
env1 = envelope(cm{:,2}, 250, 'peak');
plot(cm{:,1},cm{:,[2 3]})
plot(cm{:,1},env1,'LineWidth',2)
legend(cmVar{[2 3]},'Envelope','Location','best')
title('Original Signal with Envelope')
plot(cm{Lv,1},cm{Lv,[2 3]})
legend(cmVar{[2 3]},'Location','best')
findpeaks(cm{Lv,2},Fs,'MinPeakDistance',0.016,'MinPeakProminence',15,'MinPeakHeight',15);
[pksRT,locsRT] = findpeaks(cm{Lv,2},Fs,'MinPeakDistance',0.016,'MinPeakProminence',15,'MinPeakHeight',15);
pksRT1 = num2cell(pksRT);
legend(cmVar{2},'Location','bestoutside')
text(locsRT,pksRT+5,pksRT1,'FontSize',8,'Rotation',90)
Period_mean = mean(Period);
Period_max = max(Period);
impact.Frequency = (1./Period)*60;
torque_rms = rms(cm{Lv,"Reaction Torque [Nm]"});
current_rms = rms(cm{Lv,"Current RMS [amp]"});
Step_res=stepinfo(cm.("Reaction Torque [Nm]"),cm.("Time [s]"))
Area_torque=cumtrapz(cm{Lv,"Time [s]"},cm{Lv,"Reaction Torque [Nm]"});
Overall_data = table(torque_rms,current_rms, Period_max, Period_min, Period_mean);
Overall_data.Area_torque = Area_torque(end);
end
Step_res =
RiseTime: 2.9760e-04
TransientTime: 1.6248
SettlingTime: 5.0122
SettlingMin: -62.5159
SettlingMax: 89.4734
Overshoot: 8.6106e+04
Undershoot: 6.0233e+04
Peak: 89.4734
PeakTime: 1.5416
Step_res =
RiseTime: 1.3524e-04
TransientTime: 1.4950
SettlingTime: 5.0122
SettlingMin: -67.2468
SettlingMax: 85.3903
Overshoot: 9.6159e+04
Undershoot: 1.2223e+05
Peak: 85.3903
PeakTime: 1.3180
Step_res =
RiseTime: 6.5838e-04
TransientTime: 1.7612
SettlingTime: 5.0122
SettlingMin: -67.9828
SettlingMax: 81.1703
Overshoot: 1.6333e+05
Undershoot: 1.9514e+05
Peak: 81.1703
PeakTime: 1.3112