I'm working on a personal project, where I'm trying to make a touch screen that uses force sensors as the basis of the technology. The rig I've made has have three transducers underneath a square platform, with the goal of identifying touch events on the platform (with both the force and location) via triangulation.

I've got the simple "single event" case working fine, but I'm having trouble when there are two overlapping touch events. This would be the basis of a multi-touch function.

Below is a reference graph to help me explain what I'm trying to achieve:

enter image description here

We have three input signals (A, B & C) shown in green, with their summed signal in black. These signals contain two touch events, which overlap.

What I need to do is generate two "clean" 3-channel signals, each with only touch event inside.

The ideal output signals are shown with: - the first "touch" event signals (A-1, B-1 & C-1) coloured in blue - the second "touch" event signals (A-2, B-2 & C-2) coloured in red

I'm pretty sure this is possible, as I can at least identify when there are two overlapping signals; by using the algorithm below:

  1. identifying the activity period between settles
  2. scan over the activity period
  3. measure the ratio between each signals gradient and the gradient of the sum each signal
  4. If the ratio is off by more than a set threshold then there's more than one event

Does anyone have an idea on how to accomplish this or something similar?

Any advice or steers would be appreciated (especially in layman terms) as I'm self taught in this area.

Thanks a lot!


1 Answer 1


I understand that you receive A, B, and C and you want to separate it into A1, A2; B1, B2; C1, C2.

From this, you can do the following: Model your expected signal A1 as some pulse shape (here, I assume its a tanh function, which is close to your example). Then, normally you can perform matched filtering on the received signal to find peaks at the position of your two pulses. However, since your pulses are non-finite (i.e. they remain constant non-zero), I decided to use their derivative as the signal of interest. Then, you can find something like this:

n = -10:0.01:40;

noise = 0.5;

ntest = -5:0.01:5;
testpulse = tanh(ntest);
testpulse_diff = diff(testpulse);

% Amplitude of first pulse
A1 = -4;
start1 = 0;
% Amplitude of second pulse
A2 = 11;
start2 = 3;
% The input signal (sum + some noise)
sumOfBoth = A1*tanh(n-start1) + A2*tanh(n-start2) + sqrt(noise)*randn(1, length(n));

plot(n, sumOfBoth)
title('sum signal');

title('Diff of required pulse');

title('1st derivative of input');

metric = xcorr(diff(sumOfBoth), testpulse_diff);
hold on;
[peaks,locs] = findpeaks(abs(metric),'MinPeakHeight',0.01,'MinPeakDistance',100);

plot(locs, metric(locs), 'or');
hold off;

title('Metric with the detected peaks that correspond to the two signals');

Which gives you the following output:

program output

From the two detected peaks you can derive both the amplitude and the time position of the both peaks. Note that, even though the first derivative of your input signal looks like pure noise, it contains all the information that is needed. This information is extracted by means of the cross-correlation between the expected and the received peak.

  • $\begingroup$ Hi Maxi, Thanks for the reply, the techniques you mentioned and the approach looks pretty solid. Is there a way to enhance this method to account for more complex signal "shapes"? As each "touch event" will have the same "shape" on the A,B & C channels, but with different scaling, would it be possible to perform a "match filter" based on a common shape in the three input signals? The derivative A,B,C should hold a similar ratio thoughout each "touch event period". The only time this ratio will become splurious is though noise, or when two touch events overlap. $\endgroup$ Nov 24, 2016 at 0:16
  • $\begingroup$ Can you clarify a bit more? Do you mean that the signal shapes can be different for each touch event, but will be similar among the 3 signals? If you have no information about how a "single" touch event looks like, then it will be quite hard to find these events. $\endgroup$ Nov 24, 2016 at 5:20
  • $\begingroup$ I'm sorry I dont get it. Maybe you elaborate more about your prior knowledge, what you mean by ratio of derivatives. Please also define exactly, what a "touch event" is, and how several touch events generate the overall signals A, B, C. $\endgroup$ Nov 24, 2016 at 18:27

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.