In physics, a damped harmonic oscillator that is driven by a sinusoidal force has a steady state solution:

$$ x(t) = \frac{F_0}{m Z_m \omega} \sin(\omega t + \varphi) $$


$$ Z_m = \sqrt{\left(2\omega_0\zeta\right)^2 + \frac{1}{\omega^2} (\omega_0^2 - \omega^2)^2} $$

is the absolute value of linear response function. This is also called the harmonic oscillator spectrum. For instance, for a given undamped angular frequency $\omega_0$ and various different damping ratios $\zeta$, the spectrum looks like this:

enter image description here

On first glance this has some resemblance with the frequency response of a linear filter. I'm wondering if there is a deeper connection between these two concepts. In particular:

  • 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?
  • If matching the harmonic oscillator spectrum exactly is not possible, is there e.g. a second order IIR filter that comes close to it?

In both cases I'd be curious if these filter have a name and how one can obtain the filter coefficients when starting from the oscillator parameters $\omega_0$ and $\zeta$?

To be clear, I'm referring to digital / discrete time filters.

  • $\begingroup$ I should mention that I'm referring to digital filters. So of course a key difference between the two concepts is that time is continuous in a harmonic oscillator, but discrete in a digital filter. The connection between the two may actually come down to numerical approximation of the derivative in the differential equation: I'd expect that e.g. the dx/dt term (associated with damping) can be approximated by the difference of y_n and y_n-1, which can be associated with "velocity". The d^2x/dt^2 term may require a second order numerical approximation. $\endgroup$
    – bluenote10
    Commented Dec 28, 2023 at 13:49
  • 1
    $\begingroup$ Absolutely! The usual technique is to transform from a continuous-time, $s$-domain, description of the system into a discrete-time, $z$-domain description of the system. The match won't be exact because of sampling and associated effects, but it can generally get as close as needed. For example, this answer shows how the bi-linear transform works. $\endgroup$
    – Peter K.
    Commented Dec 28, 2023 at 15:11
  • $\begingroup$ You may wish to edit your question to make it clear that you're talking about sampled-time filters. $\endgroup$
    – TimWescott
    Commented Dec 29, 2023 at 22:15
  • $\begingroup$ @TimWescott: I had already done so, but perhaps the edit was too subtle. I've emphasized it now. $\endgroup$
    – bluenote10
    Commented Dec 30, 2023 at 11:11

1 Answer 1


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.