et-go 20240919重建
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
622 B

package algorithm
import (
"gitea.anxinyun.cn/container/common_calc"
"gitea.anxinyun.cn/container/common_models"
)
func VibCalc(vibData common_models.VibrationData) (result map[string]any, unit map[string]string) {
df, fd := FFTforward(vibData.Data, vibData.SampleFreq)
_min, _max := common_calc.MinMax(vibData.Data)
ppv := _max - _min
pv := common_calc.AbsMax(vibData.Data)
trms := common_calc.MeanSqrt(vibData.Data)
frms := common_calc.MeanSqrt(fd) / 2.0
result = map[string]any{
"df": df,
"pv": pv,
"ppv": ppv,
"trms": trms,
"frms": frms,
}
unit = map[string]string{}
return result, unit
}