0
$\begingroup$

While reading about 1st order low pass discrete implementations I found out, the following 2 equations achieve similar results, but apparently not identical, but I thought they had the same origin. One way is to derive from a filter transfer function and end up with something in the form:

$$y[n] = -a_1y[n-1] + b_0x[n] + b_1x[n-1]$$

and the other would be deriving from a differential equation and ending up with something like:

$$y[n] = (1-T)\cdot y[n-1] + T\cdot x[n-1]$$ for a given $T$ constant.

They seem to achieve very similar results (even though not identical) and I've noticed of course the absence of the second delayed $x$ element on the second equation. However, I thought both should originate from the same differential equation, since the first one I've seen in explanations about 1st order butterworth and the second one I've seen in some 1st order RC or general IIR low pass filters, but I thought they should be essentially identical from the mathematics point of view.

What am I missing here? Besides, is there any transformation $f(a_1, b_0, b_1) = T$ such as the second filter would give the exact same response as the first one, even though lacking the second delayed input?


EDIT: So starting with a continuous generic transfer function, I think it would look something like this:

$$H(s) = K\frac{ 1 }{s-a}$$

where $K$ is my gain and $a$ is the position of my pole. In this case I would have a single pole, no zeros, and should represent a low-pass 1st order filter.

Now going to the discrete world, one usually finds something like:

$$H(z) = \frac{b_0 + b_1z^{-1} + ... + b_Nz^{-N} }{1 + a_1z^{-1} + ... + a_Nz^{-N}}$$

which in our case (first order filter) would mean:

$$H(z) = \frac{b_0 + b_1z^{-1} }{1 + a_1z^{-1} }$$

which means having one pole and one zero. And here it starts getting confused. I do not remember anymore how to go from continuous to discrete, but I do remember that if we put a zero at origin on the continuous world, we would have such a transfer function:

$$H(s) = K\frac{s}{s-a}$$

which I suppose would be a high-pass filter instead, since we block 0Hz, right? On the other hand, we do have a zero on the discrete equation... I do remember they have different meanings on both worlds, but not anymore how.

So getting back to the time discrete equations above, I guess one would originate from:

$$\begin{align} H(z) &= \frac{b_0 + b_1z^{-1}}{1 + a_1z^{-1} } \\ \\ &= \frac{b_0z + b_1}{z + a_1} \\ \end{align}$$

and the other from:

$$\begin{align} H(z) &= \frac{b_1z^{-1}}{1 + a_1z^{-1} } \\ \\ &= \frac{b_1}{z + a_1} \\ \end{align}$$

where $b_1=T$ and $-a_1=(1-T)$

right? If so, I just still don't get what is the difference on the continuous world that imples one less zero on the discrete world (therefore my question was focused on $H(s)$ instead of $H(z)$) and what exactly this zero is causing on the discrete world.


EDIT2: I do remember slowly that poles and zeros on continuous world are this normal 3D plot with Imaginary and Real axis for the position of the poles and zeros, and the Gain or Frequency response axis as the third axis. And, if I'm not mistaken, poles should rather be on the left (negative) side of the Imaginary axis to reach stability, on w=0 for infint oscilation and positive for instability. On the discrete world that was something like a unit circle, where ROC was inside the circle and instability on the outside... still, not sure if same meaning applies from zeros and poles there, because otherwise a zero at origin on the discrete equation would mean blocking DC, or, making a high-pass filter out of it (which is clearly not the case).

$\endgroup$
5
  • $\begingroup$ I think part of the confusion comes from your idea that there is one single way of mapping a continuous-time transfer function to a discrete-time transfer function. There isn't. There are many such transformations, all with different advantages and drawbacks. Depending on the method, one might introduce a different number of finite zeros away from the origin. Browse this site and maybe start with looking at this question and its answers. $\endgroup$
    – Matt L.
    Commented Mar 7 at 17:01
  • $\begingroup$ One more thing, a zero at $z=0$ of a discrete-time transfer function does NOT block DC. DC corresponds to $z=1$, because the unit circle is what in continuous time would be your frequency axis. $\endgroup$
    – Matt L.
    Commented Mar 7 at 17:06
  • $\begingroup$ So @MattL. hit it. There are multiple ways of going from continuous time ($s$-plane) to discrete time ($z$-plane). They have different characteristics. I think the most commonly-used method is the Bilinear Transform: $$s \leftarrow 2 f_\mathrm{s} \frac{z-1}{z+1}$$ where $f_\mathrm{s}$ is the sample rate. The cool thing about the Bilinear transform is that filter order is preserved and there is a direct mapping of frequency response from the continuous-time domain to the discrete-time domain. Every feature you see in one domain will exist in the other but at a slightly different frequency. $\endgroup$ Commented Mar 7 at 19:27
  • $\begingroup$ Can I assume from what you guys are saying, that perhaps the first form (with $b_0$ and $b_1$) was a billinear transformation from the continuous to discrete time whereas the second form (with only $b_0$) was achieved from the same continuous transfer function but using a different mapping function? $\endgroup$ Commented Mar 8 at 9:09
  • $\begingroup$ The Bilinear Transform applied to $$H(s) = K\frac{ 1 }{s-a}$$ will result in a zero placed at $z=-1$. But a simpler LPF would have either no zero (use $x[n-1]$ for input) or a zero at the origin $z=0$ (use $x[n]$ for input). But in the simpler LPF, the gain will not dive to $-\infty$ dB at the Nyquist frequency, which is what the Bilinear Transform LPF will do. $\endgroup$ Commented Mar 8 at 17:26

1 Answer 1

1
$\begingroup$

The first equation has both a pole and a zero. The second equation has only a pole. If the $x[n-1]$ was replaced by $x[n]$ in the second equation, the frequency response would be the same except the phase shift is less because there is one less sample delay. There would also be a zero at the origin which does nothing except make less phase lag.

The second equation is the simplest non-trivial 1st-order LPF you can design. The first equation is what you would get if you applied the Bilinear Transform to a simple analog LPF which puts a zero at $z=-1$ which makes the digital filter do at Nyquist what the analog filter does at infinity.

$\endgroup$
6
  • $\begingroup$ Makes sense. Would you mind writing the form of the transfer functions of both cases of the original filter $H(s)$? I thought they both had same amount of poles and zeros $\endgroup$ Commented Mar 7 at 14:59
  • $\begingroup$ $H(z)$ or $H(s)$? $$ $$ And BTW, I'm gonna make you write out the two transfer functions. Ain't hard. I'll hold your hand. But I ain't gonna do it. @PeterK. since the OP's rep is low, can they start an answer, where we can work together? Or does the chalkboard have to be their question? $\endgroup$ Commented Mar 7 at 15:28
  • $\begingroup$ I will start editing my own post then and if guidelines say otherwise, I put as an answer. At least so we can start elaborating (I was very familiar with those concepts but more than 15 years ago, so let's see how it goes) $\endgroup$ Commented Mar 7 at 15:37
  • $\begingroup$ Added some extra info $\endgroup$ Commented Mar 7 at 16:14
  • $\begingroup$ I am still a bit confused by your sentence "If the x[n−1] was replaced by x[n]... is one less sample delay.". Now analyzing my equations again, shouldn't both of them have a zero, since both of them contain a $x[n-1]$ element? Which means my last $H(z)$ equation should rather have a $b_1 z^{-1}$ at numerator instead of a $b_0$, so it could originate the $x[n-1]$? Also means, by replacing $x[n-1]$ by a $x[n]$ I would be rather eliminating a zero instead of adding one. No? $\endgroup$ Commented Mar 8 at 9:32

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.