* spec: two-tone spectrum, 1 kHz (amp 1) + 3 kHz (amp 0.5)
B1 s 0 V = sin(2*3.14159*1k*time) + 0.5*sin(2*3.14159*3k*time)
R1 s 0 1k
.tran 5u 20m
.control
  run
  linearize
  spec 0 5k 100 v(s)
  let m = mag(v(s))
  meas sp a1k MAX m FROM=0.9k TO=1.1k
  meas sp a3k MAX m FROM=2.9k TO=3.1k
.endc
.end
