VE Lua Documentation

Press F to search!

newExponentialSmoothing

Definition


-- @/lua/common/filters.lua:466

function newExponentialSmoothing(window, startingValue, fixedDt)
  local data = {a = 2 / max(window, 2), _startingValue = startingValue or 0, st = startingValue or 0}
  local adt = data.a * (fixedDt or 0.0005)
  data.a = (2000 + data.a) * adt / (1 + adt)
  return setmetatable(data, exponentialSmoothing)
end

Callers

@/lua/vehicle/powertrain/hydraulicCylinder.lua
  cylinder.virtualMass = cylinderData.virtualMass or cylinder.virtualMassOut
  cylinder.cylinderForceSmoother = newExponentialSmoothing(cylinder.cylinderForceSmoothing)
  cylinder.bypassSmoother = newExponentialSmoothing(50)
  cylinder.cylinderForceSmoother = newExponentialSmoothing(cylinder.cylinderForceSmoothing)
  cylinder.bypassSmoother = newExponentialSmoothing(50)
  cylinder.maxBypassSpeed = cylinderData.maxBypassSpeed or cylinder.cylinderReliefSlipSpeedLimit
        table.insert(cylinder.beamCids, cid)
        cylinder.beamVelocitySmoothers[cid] = newExponentialSmoothing(cylinder.cylinderVelocitySmoothing)
        cylinder.previousBeamVelocities[cid] = 0
@/lua/vehicle/powertrain/viscousClutch.lua

  device.torqueDiffSmoother = newExponentialSmoothing(jbeamData.viscousSmoothing or 25)
  device.viscousCoef = jbeamData.viscousCoef or 10 --Nm/rad/s
@/lua/vehicle/powertrain/manualGearbox.lua

  device.gearWhineInputTorqueSmoother = newExponentialSmoothing(inputTorqueSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputTorqueSmoother = newExponentialSmoothing(inputTorqueSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputAVSmoother = newExponentialSmoothing(outputAVSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputAVSmoother = newExponentialSmoothing(outputAVSmoothing)
@/lua/vehicle/controller/gauges/customModules/electricMotorData.lua
local averagePower = 0
local avgPowerSmoother = newExponentialSmoothing(1000)

local currentConsumptionSmoother = newExponentialSmoothing(50)
local currentPowerSmoother = newExponentialSmoothing(30)
local currentConsumptionSmoother = newExponentialSmoothing(50)
local currentPowerSmoother = newExponentialSmoothing(30)
local currentTorqueSmoother = newExponentialSmoothing(30)
local currentPowerSmoother = newExponentialSmoothing(30)
local currentTorqueSmoother = newExponentialSmoothing(30)
local avgConsumptionSmoother = newExponentialSmoothing(1000)
local currentTorqueSmoother = newExponentialSmoothing(30)
local avgConsumptionSmoother = newExponentialSmoothing(1000)
@/lua/vehicle/powertrain/splitShaft.lua
  device.viscousExponent = jbeamData.viscousExponent or 1
  device.torqueSmoother = newExponentialSmoothing(jbeamData.viscousSmoothing or 25)
@/lua/vehicle/powertrain/sequentialGearbox.lua

  device.gearWhineInputTorqueSmoother = newExponentialSmoothing(inputTorqueSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputTorqueSmoother = newExponentialSmoothing(inputTorqueSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputAVSmoother = newExponentialSmoothing(outputAVSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputAVSmoother = newExponentialSmoothing(outputAVSmoothing)
@/lua/vehicle/powertrain/multiShaft.lua
    device.torqueDiff[i] = 0
    device.torqueDiffSmoother[i] = newExponentialSmoothing(jbeamData.viscousSmoothing or 25)
    device.outputPorts[i] = true
@/lua/ge/extensions/core/cameraModes/topDown.lua
  self.disabledByDefault = true
  self.veloSmoother = newExponentialSmoothing(50, 1)
  self.vel = 0
@/lua/ge/extensions/editor/flowgraph/main.lua
  self.quickAccessTextfield = im.ArrayChar(64, "")
  self.fpsSmoother = newExponentialSmoothing(50, 1)
  self.restoreView = nil
@/lua/vehicle/electrics.lua
  if smootherType == "exponential" then
    return newExponentialSmoothing(unpack(params))
  elseif smootherType == "temporal" then
@/lua/vehicle/controller/drivingDynamics/supervisors/tractionControl.lua
          lastSlip = 0,
          slipSmoother = newExponentialSmoothing(10)
        }
@/lua/vehicle/powertrain/cvtGearbox.lua
  device.oneWayViscousTorque = jbeamData.oneWayViscousTorque or device.oneWayViscousCoef * 25
  device.oneWayTorqueSmoother = newExponentialSmoothing(jbeamData.oneWayViscousSmoothing or 50)
@/lua/vehicle/powertrain/automaticGearbox.lua

  device.gearWhineInputTorqueSmoother = newExponentialSmoothing(inputTorqueSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputTorqueSmoother = newExponentialSmoothing(inputTorqueSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputAVSmoother = newExponentialSmoothing(outputAVSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputAVSmoother = newExponentialSmoothing(outputAVSmoothing)
  device.oneWayViscousTorque = jbeamData.oneWayViscousTorque or device.oneWayViscousCoef * 25
  device.oneWayTorqueSmoother = newExponentialSmoothing(jbeamData.oneWayViscousSmoothing or 50)
@/lua/vehicle/powertrain/hydraulicPump.lua
  device.pumpWorkingPressure = jbeamData.pumpWorkingPressure or 25000000
  device.pumpSmoother = newExponentialSmoothing(5)
@/lua/vehicle/controller/playerController.lua
local ballDesiredTorque = 0
local ballAVSmoother = newExponentialSmoothing(25)
@/lua/vehicle/controller/sbrGauges.lua
local updateFPS = 30
local avgConsumptionSmoother = newExponentialSmoothing(1000)
local avgPowerSmoother = newExponentialSmoothing(1000)
local avgConsumptionSmoother = newExponentialSmoothing(1000)
local avgPowerSmoother = newExponentialSmoothing(1000)
local currentConsumptionSmoother = newExponentialSmoothing(50)
local avgPowerSmoother = newExponentialSmoothing(1000)
local currentConsumptionSmoother = newExponentialSmoothing(50)
local currentPowerSmoother = newExponentialSmoothing(30)
local currentConsumptionSmoother = newExponentialSmoothing(50)
local currentPowerSmoother = newExponentialSmoothing(30)
local lastEnergyAvailable = 0
@/lua/vehicle/controller/gauges/customModules/combustionEngineData.lua
local averagePower = 0
local avgPowerSmoother = newExponentialSmoothing(1000)

local currentPowerSmoother = newExponentialSmoothing(30)
local currentTorqueSmoother = newExponentialSmoothing(30)
local currentPowerSmoother = newExponentialSmoothing(30)
local currentTorqueSmoother = newExponentialSmoothing(30)
local avgConsumptionSmoother = newExponentialSmoothing(1800) --update every 0.5 seconds, use values of last 10 minutes
local currentTorqueSmoother = newExponentialSmoothing(30)
local avgConsumptionSmoother = newExponentialSmoothing(1800) --update every 0.5 seconds, use values of last 10 minutes
local fuelDisplaySmoother = newTemporalSmoothing(5, 3)
@/lua/vehicle/powertrain/differential.lua
  device.viscousExponent = jbeamData.viscousExponent or 1
  device.viscousTorque1Smoother = newExponentialSmoothing(jbeamData.viscousSmoothing or 25)
  device.viscousTorque2Smoother = newExponentialSmoothing(jbeamData.viscousSmoothing or 25)
  device.viscousTorque1Smoother = newExponentialSmoothing(jbeamData.viscousSmoothing or 25)
  device.viscousTorque2Smoother = newExponentialSmoothing(jbeamData.viscousSmoothing or 25)
@/lua/vehicle/powertrain/torqueConverter.lua
  device.fluidDensity = 844
  device.kFactorSmoother = newExponentialSmoothing(jbeamData.kFactorSmoothing or 75)
  device.kFactorCoef = device.fluidDensity * device.converterDiameter * device.converterDiameter * device.converterDiameter * device.converterDiameter * device.converterDiameter
@/lua/vehicle/controller/drivingDynamics/actuators/activeCenterDiffLock.lua

local outputAV1Smoother = newExponentialSmoothing(500)
local outputAV2Smoother = newExponentialSmoothing(500)
local outputAV1Smoother = newExponentialSmoothing(500)
local outputAV2Smoother = newExponentialSmoothing(500)
local lockCoefSmoother = newTemporalSmoothingNonLinear(8, 20)
@/lua/vehicle/powertrain/frictionClutch.lua

    lockDampAVSmoother = newExponentialSmoothing(jbeamData.lockDampSmoothing or 0),
    clutchAngleSmoother = newExponentialSmoothing(jbeamData.clutchAngleSmoothing or 0),
    lockDampAVSmoother = newExponentialSmoothing(jbeamData.lockDampSmoothing or 0),
    clutchAngleSmoother = newExponentialSmoothing(jbeamData.clutchAngleSmoothing or 0),
@/lua/ge/extensions/editor/mainMenu.lua
local showRevertLevelToOriginalButton = false
local fpsSmoother = newExponentialSmoothing(50, 1)
local windowSearch = require('/lua/ge/extensions/editor/util/searchUtil')()
@/lua/vehicle/powertrain/dctGearbox.lua

  device.gearWhineInputTorqueSmoother = newExponentialSmoothing(inputTorqueSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputTorqueSmoother = newExponentialSmoothing(inputTorqueSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputTorqueSmoother = newExponentialSmoothing(outputTorqueSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputAVSmoother = newExponentialSmoothing(outputAVSmoothing)
  device.gearWhineInputAVSmoother = newExponentialSmoothing(inputAVSmoothing)
  device.gearWhineOutputAVSmoother = newExponentialSmoothing(outputAVSmoothing)
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffBias.lua

local inputAVSmoother = newExponentialSmoothing(50)
local outputAV1Smoother = newExponentialSmoothing(50)
local inputAVSmoother = newExponentialSmoothing(50)
local outputAV1Smoother = newExponentialSmoothing(50)
local outputAV2Smoother = newExponentialSmoothing(50)
local outputAV1Smoother = newExponentialSmoothing(50)
local outputAV2Smoother = newExponentialSmoothing(50)
@/lua/ge/extensions/editor/veMain.lua
local imgui_true, imgui_false = im.BoolTrue(), im.BoolFalse()
local fpsSmoother = newExponentialSmoothing(50, 1)
@/lua/vehicle/extensions/test/ffbCalibration.lua
local data
local FFBSmoother = newExponentialSmoothing(150)
local FFBMaxValue
@/lua/vehicle/controller/drivingDynamics/actuators/electronicSplitShaftLock.lua

local inputAVSmoother = newExponentialSmoothing(200)
local outputAVSmoother = newExponentialSmoothing(500)
local inputAVSmoother = newExponentialSmoothing(200)
local outputAVSmoother = newExponentialSmoothing(500)
local clutchRatioSmoother = newTemporalSmoothingNonLinear(20, 5)
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffLock.lua

local inputAVSmoother = newExponentialSmoothing(50)
local outputAV1Smoother = newExponentialSmoothing(50)
local inputAVSmoother = newExponentialSmoothing(50)
local outputAV1Smoother = newExponentialSmoothing(50)
local outputAV2Smoother = newExponentialSmoothing(50)
local outputAV1Smoother = newExponentialSmoothing(50)
local outputAV2Smoother = newExponentialSmoothing(50)
@/lua/ge/extensions/ui/uiNavi.lua

local objSpeed_smooth = newExponentialSmoothing(60)
@/lua/vehicle/controller/esc.lua
      local wheelCacheEntry = wd
      wheelCacheEntry.speedSmoother = newExponentialSmoothing(100)
      wheelCacheEntry.stabilityControlBrakeIntegral = 0

  yawSmooth = newExponentialSmoothing(50) --windows of 50 frames

  desiredYawSmooth = newExponentialSmoothing(currentESCConfiguration.desiredYawRateSmoothing)
  lateralAccSmoother = newTemporalSmoothing(100, 100)
@/lua/vehicle/powertrain/centrifugalClutch.lua
    lockDampRatio = jbeamData.lockDampRatio or 0.15, --1 is critically damped
    lockDampAVSmoother = newExponentialSmoothing(jbeamData.lockDampSmoothing or 0),
    clutchAngleSmoother = newExponentialSmoothing(jbeamData.clutchAngleSmoothing or 0),
    lockDampAVSmoother = newExponentialSmoothing(jbeamData.lockDampSmoothing or 0),
    clutchAngleSmoother = newExponentialSmoothing(jbeamData.clutchAngleSmoothing or 0),
    clutchStiffness = jbeamData.clutchStiffness or 1,
@/gameplay/missionTypes/hypermiling/fluidConsumptionToGraph.lua
        gFuelSmoother = newTemporalSmoothing(50, 50),
        avgConsumptionSmoother = newExponentialSmoothing(2000),
        lpsConsumption = newTemporalSmoothing(0.05, 0.08),
@/lua/vehicle/hydros.lua
local responseCorrected = false
-- local FFBsmooth = newExponentialSmoothing(wheelFFBSmoothing)
local FFBsmooth = newExponentialSmoothingT(wheelFFBSmoothing, wheelFFBSmoothing2)
@/lua/vehicle/controller/drivingDynamics/actuators/electronicDiffLock.lua

local inputAVSmoother = newExponentialSmoothing(50)
local outputAV1Smoother = newExponentialSmoothing(50)
local inputAVSmoother = newExponentialSmoothing(50)
local outputAV1Smoother = newExponentialSmoothing(50)
local outputAV2Smoother = newExponentialSmoothing(50)
local outputAV1Smoother = newExponentialSmoothing(50)
local outputAV2Smoother = newExponentialSmoothing(50)
@/lua/vehicle/extensions/perfectLaunch.lua
  M.launchFailed = false
  yawSmoother = newExponentialSmoothing(30)
  if drivetrain.esc.isExisting then