One additional option here is to hold the last valid value until a new one appears. The formula below allows you to mix in step interpolation characteristics for gaps into a linearly interpolated signal.
$gaps = $signal.isNotValid().removeLongerThan(30d).move(-1ns,0)
$holdSignal = $signal.aggregate(startValue(),$gaps,durationkey())
$signal.validValues().splice($holdSignal,$gaps)