Numerical Dispersion in SHO: u'' = -ω₀² u

Replace the time derivative by a finite difference and step forward one sample at a time. Raise f0 or lower the sample rate and compare the simulation with the exact cosine, by eye and by ear. Then switch the scheme. More info: [dispersion] [scheme]

Displacement u over time

Gray: exact cos(ω0 t). Dots: one value per time step from the scheme (first 64 steps).

One step = multiply by z

Try uⁿ = zⁿ. Angle of z: pitch. Distance from the circle: growth or decay. Gray: exact.