↘ drag the bottom-right corner to resize — content scales with the box

Plot data generation — formula chain

original 14-bit sine → ×1.5 float → −5000 offset → MSB-flip read as 14-bit signed (wrapped) · sampled at fs = 1 Hz (t = n·1 s)
A = 8191 P = 50/1.5 ≈ 33.33 G = 1.5 OFF = 5000 fs = 1 Hz n = 0 … 200
1
original 14-bit signed sine (quantized samples)
x[n] = round( A · sin(2πn / P) )
2
to float, multiply ×1.5, round back to fixed  (→ 15-bit signed)
y[n] = round( G · x[n] ) = round( 1.5 · x[n] )
3
subtract DC offset 5000
z[n] = y[n] − OFF = round(1.5·x[n]) − 5000
4
{ ~z[13], z[12:0] } read as 14-bit signed = wrap into [−8192, +8191]  (plotted value)
a[n] = wrap( z[n] ) = ( ( z[n] + 8192 ) mod 16384 ) − 8192
nonneg modulo:  x mod m = ((x % m) + m) % m
5
overflow flag (red dots = wrapped samples)
folded[n] = ( | z[n] | > 8191 )
~
reference envelope (green dashed) — no round, no wrap
zideal(t) = 1.5·8191·sin(2πt/P) − 5000
xy
data → SVG pixel mapping
xpx = MX + (t / tmax)·PW
ypx = TOP + ((ymax−v)/(ymax−ymin))·PH
tmax=200,  ymin=−17900,  ymax=7900
representative values (envelope extremes)
sinxy=1.5xz=y−5000a=wrap(z)
000−5000−5000
+1819112287+7287+7287
−1−8191−12286−17286−902 (fold)
one-line composite
a[n] = ( ( round(1.5·round(8191·sin(2πn/33.33))) − 5000 + 8192 ) mod 16384 ) − 8192