If you don't mind two runs, you can add a .meas peak max abs(v(x))
directive (v(x)
being the needed voltage, an example), then use the reverse of that measured value as the gain. Otherwise, you'll have to either provide an estimate gain, or export your trace and do the normalizing elsewhere (or even LTspice).
This is just a corollary for @Huisman's answer, to add a picture of what I meant in the comment:
This is just for exemplification. I've let it run for 8s, but the useful signal goes from 0..4s, and the output (V(z)
) starts at 4s. The simulation card can (should) be modified to start saving only after 4s.