I have 3 sensor inputs: $a(t)$, $b(t)$ and $c(t)$. I want to design a filter such that the weighted linear combination of the three is always a constant. Kind of like:

$$w_1(t)a(t) + w_2(t)b(t) + w_3(t)c(t) = k$$

So from my undergrad modules I think I need a adaptive filters. I can perform training to find $k$ and filter weights at initialization.

May I know what is the best filter to implement in my case? $a(t)$, $b(t)$ and $c(t)$ are not independent.

Kelvin

• You need more definition of what you're trying to achieve. There are many solutions to your problem. For instance, $w_1(t) = 0, w_2(t) = 0, w_3(t) = \frac{k}{c(t)}$ is a perfectly acceptable solution according to the details you've given thus far, but I doubt it does what you want. – Jason R Aug 4 '14 at 11:12
• Hey Jason thanks alot. How about setting a non zero and non negative constraint on the filter weights? Would that be sufficient? – KelvinIPE Aug 4 '14 at 11:28
• That's not exactly what I had in mind. There are going to be many solutions to your problem, but you need to pick the one that will give you the eventual effect that you need in your system. Adaptive filters typically tune their filter weights to meet some optimization criterion. I think your constraint is a bit weak for that objective. What is your system supposed to do? – Jason R Aug 4 '14 at 11:58
• Ok let me try again. What I want to achieve is to find filter weights $w_1(t), w_2(t), w_3(t)$ such that the linear weighted combination of $a(t)$, $b(t)$ and $c(t)$ is always a constant value $k$. This is part of a bigger system. I have a perfect estimation of the initial filter weights and also the constant. And the filter weights will not swing too much from one time instant to another. The constant $k$ is not time dependent. – KelvinIPE Aug 5 '14 at 1:32
• If you know $k$, look up LMS, Least-Mean-Squares filter, e.g. how-to-apply-an-adaptive-filter-in-python on SO. If you don't, maybe 4 weights(t) with target 0. – denis Jan 17 '16 at 12:12

What I was getting at in the comments above is that the linear system $w_1(t)a(t) + w_2(t)b(t) + w_3(t)c(t) = k$ has an infinite number of solutions, so you need to state some criterion that allows you to choose a unique solution. I think you have pointed out a constraint that is worth examining.

The idea: note that the linear equation I gave above is the equation for a plane in $\mathbb{R}^3$:

$$w_1(t)a(t) + w_2(t)b(t) + w_3(t)c(t) = k$$

• This defines a plane in three-dimensional Euclidean space.

• $\left[a(t), b(t), c(t) \right]$ is a vector that is normal to the plane.

• The collection of all vectors in $\mathbb{R}^3$ of the form $\left[w_1(t),\ w_2(t),\ w_3(t)\right]$that satisfy the above equation are points on the plane.

• Since you said that $w_1(t), w_2(t), w_3(t)$ don't change much over a short time duration, then you can assume that the point $\left[w_1(t+\Delta t),\ w_2(t+\Delta t),\ w_3(t+\Delta t)\right]$ should be geometrically close to the point at the previous time instant, $\left[w_1(t),\ w_2(t),\ w_3(t)\right]$.

So, the algorithm would look something like this:

• Initialize your algorithm by finding $k$, which you said you can do.

• Solve for the initial weights $w_1(t), w_2(t), w_3(t)$, which you said you can do.

• On subsequent time steps, measure $a(t)$, $b(t)$, and $c(t)$. This defines the plane in $\mathbb{R}^3$ that the filter weight vector can possibly lie upon.

• Find the point on the plane that is closest to the filter weights from the previous iteration. Use this point as the new vector of filter weights.

• Repeat.

I'm not sure if this will give the desired effect or not (as your inquiry is light on details), but it has an intuitive geometric explanation. It might be worth a try.

• Hi Jason thanks for answer. Now I understand what you mean by limited detail. The solution is not unique. I will go back to the drawing board again to see what other constraint I can set so that I can get a unique solution. – KelvinIPE Aug 5 '14 at 4:51
• Basically there must be a constraint on the inputs. For a general case as mentioned in the question it seems weights wont converge. For a simple example when the inputs are dc, solution becomes trivial. – learner Aug 5 '14 at 12:15