* XSPICE filesource as a quadrature (cos/sin) generator via a DIFFERENTIAL port.
* %vd([a b ...]) pairs nodes into differential ports; here each ref is ground (0),
* so the two channels act single-ended: c = cos, s = sin (columns 2 and 3).
a1 %vd([c 0 s 0]) sincos
.model sincos filesource (file="sincos.dat"
+ amploffset=[0 0] amplscale=[1 1]
+ timeoffset=0 timescale=1 timerelative=false amplstep=false)
rc c 0 1meg
rs s 0 1meg
.tran 2u 2m
.control
  run
  meas tran c_0   FIND v(c) AT=0       $ cos(0)   = 1
  meas tran s_0   FIND v(s) AT=0       $ sin(0)   = 0
  meas tran c_q   FIND v(c) AT=250u    $ cos(90d) = 0
  meas tran s_q   FIND v(s) AT=250u    $ sin(90d) = 1
.endc
.end
