Hello,
I tried to convert a recorded time vs accele data from an accelerometer to generate a random vibration PSD plot, and then calculate Grms. There are some Matlab and Python scripts available online to do this kind of thing, but it seems no Mathematica codes. I'm new to Mathematica and tried the following codes, however, the output seems to be not right as it is different from Matlab/Python. Also I don't know how to get Grms.
Can anyone help and provide some insights on how to do this? A sample raw accelerometer data file is attached. Thanks in advance!
My codes:
tempdata =
N[Import["UPS_freight_impact.csv", "Table",
"FieldSeparators" -> {","}]];
myseries = tempdata[[1 ;; 2^IntegerPart[13.2874], All]];
Length[myseries]
tsamp = myseries[[2, 1]] - myseries[[1, 1]];
psddata =
Abs[Fourier[myseries, FourierParameters -> {1, -1}]]^2/
Length[myseries];
ListLogLogPlot[tsamp*psddata[[All, 2]], Frame -> True, Joined -> True,
PlotRange -> All,
FrameLabel -> {"Frequency (Hz)", "Accelerometer PSD G^2/Hz"},
FrameStyle ->
Directive[Black, 14, FontFamily -> "Arial", AbsoluteThickness[2]]]
Attachments: