# Does it make sense for my filter to depend on the discrete sample variable n?

I feel a little nervous asking this question as I am not sure if know what exactly I am trying to ask. But please see if you can help.

Ok, I have a filter whose output grows as long as the input is larger than a decay process:

$$I(n)=\beta I(n-1,a)+q(P,t,n)+(1-\beta)I(n-1)$$ Where $$n$$ is the discrete sample step, $$q(P,t)$$ is a function that transforms the current input for sample $$n$$ and $$\beta$$ is a problem specific parameter which is essentially similar to the $$\alpha$$ in the exponentially weighted moving average filter.

For simplicity I am going to presume the transformation of the input and write thus: $$I(n)=\beta I(n-1,a)+q(n)+(1-\beta)I(n-1)$$

An interesting assumption is that when the input to the filter is stationary e.g. step input, the filter becomes:

$$I(n)=(n\beta +1)q(n)+(1-\beta)I(n-1)$$

This assumption is useful because it helps to eliminate $$I(n-1,a)$$ which we do not want to deal with since it is strange. So this 3rd equation is the equation I am working with and interested in; you can forget about the previous two as I have just used them for some context.

The diagram of this third filter is as shown: (1) This 3rd filter works as expected but I need to be able to describe it. I have never worked with time-varying filters which I believe this filter is given the $$n$$ that multiplies $$\beta$$. Unless I am mistaken? If I try to get the transfer function, I get stuck at:

$$I(z)-(1-\beta) I(z)z^{-1}= -\beta z\frac{dQ(z)}{dz}+Q(z)$$ $$I(z)[1-(1-\beta)z^{-1}] = ???$$

I can't really get the $$Q(z)$$ out from the right hand side to form $$H(z)= \frac{I(z)}{Q(z)}$$. Am I doing it wrong or a transfer function is not possible here?

(2) The $$n$$ that multiplies $$\beta$$ in the 3rd equation only has a significant impact after a long period of time. For example dropping $$n$$ does not affect the impulse response, well clearly, and the step response seems to be affected only in amplitude; also the transfer function is then easily derived as: $$H(z)=\frac{\beta + 1}{1-(1-\beta)z^{-1}}$$

This $$H(z)$$ agrees with data but I am struggling to find where such a filter that depends on the discrete sample time variable has been studied. I just want to see someone else dealing with such a filter so that I can see how it is treated or even if it makes sense as a traditional filter. So I am worried that I am doing something silly. So please tell me if you think this 3rd filter should not be called a digital filter and why? Also is it so bad that I dropped the $$n$$ because I could not get the transfer function of the 3rd filter.

• What does $I(n,a)$ mean? What's $a$ ? Why does $I()$ sometimes has one argument and sometimes two.? Aug 13 at 12:11
• $I$ values were in different bins indexed by $a$ which are positive real numbers. Perhaps we can ignore it as later in the question I made an assumption that got rid of it such that indexing by $a$ is no more required. Aug 13 at 13:13
• If you drop $a$ from your first equation, it simply becomes $I(n) = I(n-1) + q(n)$. That's a really simple LTI f(if marginally stable) filter with $I(n)$ as the output and $q(n)$ as the input. I can't follow how you derived your third equation. How does $n\beta$ end up as a multiplier for $q(n)$ Aug 14 at 13:22
• Sorry about the confusion: I arrived at the 3rd equation using the following approximation: $I(n-1,a)$ $\approx$ $nq(n)$. This approximation works as long as the input signal $q(n)$ is stationary. The proof for it will not fit in here. So I did not just drop $a$ since that will lead to a different filter as you have shown. Aug 14 at 14:09
• My interpretation: $I(z)=(1-\beta)I\left(z\right)\cdot z^{-1}-\frac{b}{\triangle s}\cdot(Q\left(z\right)-Q\left(z\right)\cdot z^{-1})+Q(z)\cdot z^{-1}$ Where $\triangle s$ is the real time between samples. Notice I moved the $z$ in $\frac{b}{\triangle s}\cdot z\cdot(Q\left(z\right)-Q\left(z\right)\cdot z^{-1})+Q(z)$ to $\frac{b}{\triangle s}\cdot(Q\left(z\right)-Q\left(z\right)\cdot z^{-1})+Q(z)\cdot z^{-1}$ To preserve causality. I can draw the circuit or flow diagram if you need. Aug 20 at 15:18

• Regarding the notation, the filter was derived from operations that occurred in different bins. Say there are 3 bins $a=0,1,2$. If an input $x$ is judged to fall in the bin $a=0$, then the process will accumulate $x$ in the bin $a=0$ and at the same time will start emptying bins $a=1,2$ according to a decay rate $\beta$. The output of the process is the sum of the latest values in each bin. The filter I present is basically an approximation of this process. I did not include this detail as I thought it was not relevant. Aug 13 at 14:12
• An LTI impulse response is just a function of the time "lag", i.e. $h(\tau)$. A time variant impulse response, it's also a function of absolute time, so it becomes a function of two variables, i.e. $h(\tau,t)$ Aug 14 at 13:24