In mathematica I can do

Delta[x_, y_] = If[x == y, 1, 0]; M = 100; K = 100; H[s_] = s^2/(2 M K); f[x_] = (1/(2 M)) Sum[ Exp[2 I Pi (x s - H[s])/(2 M)], {s, -M, M - 1}]; rt = Table[{x, K*K*(Re[f[x]] - Delta[x, 0])}, {x, -20, 20}]; st = Table[{x, Re[f[x]] }, {x, -20, 20}]; it = Table[{x, K *Im[f[x]]}, {x, -20, 20}]; ListPlot[{st , it, rt }, Joined -> True, Filling -> Axis, PlotRange -> (1 {-0.6, 1})]

and it yields this graph

which seems to be convergent as I increase M, the number of points in the world, and K, a scaling factor that when bigger makes every momentum count as less energetic. Maybe it is effectively acting like hbar (or its reciprocal) or something? I dunno.

Doing some numerical fiddling, it seems the spikes in the imaginary part (the red graph) just one step away from the origin on either side have the value of exactly 1/π --- not sure what causes that.