Short lowpass filter that also extrapolates lines I'm looking for a short lowpass filter that also extrapolates lines,
[0 1 2 3] --> 4,
so I need (correct me) $H([\ 0\ \ 0.25\ \ 0.5\ ]) \approx [ 1\ \ 2\ \ 0 ]$ .
How close can one get to this with 2 to 4 FIR and 1 IIR coefficient ?

Added: for a 3-term FIR, I want

Input     -&gt; output
 1  1  1  -&gt; 1  # const -&gt; const
-1  0  1  -&gt; 2  # extrapolate lines
 1 -1  1  -&gt; 0  # low-pass


Solving these 3 equations gives the FIR [1.25 .5 -.75] .
I can do longer FIRs by least squares + fiddling. But how do I do FIR x 1-term IIR ?
Is there a general approach to filters that extrapolate lines ?
The most straight-forward solution is a length $N$ FIR filter with impulse response

$$h[n]=\begin{cases}\frac{N}{N-1},&amp;\quad n=0\\
-\frac{1}{N-1},&amp;\quad n=N-1\\0,&amp;\quad\text{otherwise}\end{cases}$$

For $N=3$, the output sample computed from three input samples x = [1 3 5] is $\frac32\cdot 5 - \frac12\cdot 1 =7$, as it should be. Note that this filter is very cheap, it has only two non-zero taps regardless of the value $N$.