2
$\begingroup$

I was looking at the question from a textbook of mine and it doesn't make too much sense to me:

Design a first-order filter, linearly extrapolating the current and previous measurement. This is equivalent to the assumption that the upcoming measurement will be on a straight line connecting the current and previous measurement. The output of the filter shall anticipate this by giving this output now.

The coefficients (2 and -1) are given in the answer, but I still don't understand how they were found.

I know that the general equation of a digital filter is given as:

\begin{equation} y[k] = \sum_{i=0}^{N} b_i u[k-i] - \sum_{j=1}^{N} a_i y[k-j] \end{equation}

How does one go from that, using the description of the problem, to:

\begin{equation} y[k] = 2 x[k] - x[k-1] \end{equation}

This is the answer given in the book:

enter image description here

$\endgroup$
1
  • $\begingroup$ Hint : think about y = m*x+b $\endgroup$
    – Ben
    Sep 16, 2020 at 19:06

2 Answers 2

2
$\begingroup$

Basically, there are 2 parts to this problem

Step 1 :

Find the slope between the last 2 samples. The slope is simply the difference between the last 2 samples.

$$ m = x[n]-x[n-1]; $$

Step 2 :

You need to extrapolate to find the next sample based on the hypothesis that the next sample will be colinear with the 2 previous samples.

$ x[n+1] = x[n] + m $

$ x[n+1] = x[n] + x[n] - x[n-1] = 2x[n] - x[n-1]$

$\endgroup$
2
$\begingroup$

If you assume that the samples lie on a line then the current sample is related to the previous sample by

$$x[n]=x[n-1]+c\tag{1}$$

with some unknown constant $c$. If there are two past samples given, then $c$ is simply determined by the difference between these two samples:

$$c= x[n-1]-x[n-2]\tag{2}$$

Combining $(1)$ and $(2)$ gives

$$x[n]=2x[n-1]-x[n-2]\tag{3}$$

$\endgroup$
2
  • $\begingroup$ you beat me to it. I will delete my answer! $\endgroup$
    – Ben
    Sep 16, 2020 at 19:11
  • $\begingroup$ @Ben: same thought at the same time :) $\endgroup$
    – Matt L.
    Sep 16, 2020 at 19:12

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.