If your physics department's damped harmonic oscillator happens to be linear and time-invariant with a defined input and output, and if there's only one oscillator rather than a chain of them coupled together, then it can be described with a Laplace-domain transfer function of the form
$$H(s) = \frac{N(s)}{s^2 + 2 \zeta \omega_0s + \omega_0^2} \tag 1$$
where $N(s)$ isn't arbitrary, but, depending on what the input is driving and the output is sampling, will be no more than a second-order polynomial in $s$.
The plots that you give are for a lowpass filter with a transfer function
$$H(s) = \frac{\omega_0^2}{s^2 + 2 \zeta \omega_0s + \omega_0^2} \tag 2$$
Is it possible to come up with some digital IIR filter that exactly corresponds to a damped harmonic oscillator, i.e., where the frequency response matches the harmonic oscillator spectrum exactly?
(Note that I'm taking "digital filter" here to be synonymous with "sampled-time filter" -- the terms aren't exactly the same, but the colloquial meaning of "digital filter" comes close).
No and yes.
Can you make a sampled-time system* that takes a continuous signal, samples it, processes it, and emits the processed version, that will replicate the continuous-time prototype?
No. No you can't. Because aliasing will kill you.
Can you put that sampled-time system in between a continuous-time anti-alias filter at its input and a continuous-time reconstruction filter at its output** and replicate the spectrum of the continuous-time prototype?
No. No you can't -- but you can come arbitrarily close. You can't get there entirely because your continuous-time prototype has a non-zero response that extends to infinite frequencies, and your as-built system will still have aliasing. So your "comes close" will involve too much attenuation (hopefully) above your frequency of interest, and at least some aliasing of higher-frequency content into your frequency of interest.
Can you make a model of a continuous-time linear system in sampled time that will exactly replicate the observed behavior of that continuous-time linear system as it is stimulated by a signal from your sampled-time system, with the output observed at the sampler?
Yes, yes you can. It's been discussed here on this Stackexchange, but I can't find it -- here's the Wikipedia link for how you do it assuming a zero-order hold at the output of your sampled-time system, and no additional delay anywhere.
* I'm sticking to strict math-theory land here when I say "sampled-time system"
** This would be a good model of board that has anti-aliasing filtering, an ADC, digital signal processing of some sort, a DAC, and a reconstruction filter.
dx/dt
term (associated with damping) can be approximated by the difference ofy_n
andy_n-1
, which can be associated with "velocity". Thed^2x/dt^2
term may require a second order numerical approximation. $\endgroup$