Implementing a Matlab filter to cancel cross talk between two sensors I have two sensors that have a cross talk between them. I would like to cancel the cross talk. For this I recorded two tracks, where sensor no.1 (called x1) has some input, and sensor no.2 (called x2) is zero.

I was told to make the following operations:


  Since your cross talk is small:
  
  1) Simply measure the transfer function $H_{ba}(\omega)$ directly.
  
  2) Subtract it out as follows: 
  
  2.1) Measure the transfer function from signal A to sensor B when signal B is 0. 
  
  2.2) Create a filter from this transfer function (FIR or IIR, depending on it's shape). 
  
  2.3) Now you can measure and subtract a filtered version from sensor signal A from sensor signal B: 
  
  $y_b'(t) = y_b(t)-h_{ab}(t)*y_a(t)$. Where $h_{ab}(t)$ is the impulse
  response of your cross talk filter and $*$ the convolution operator.


Here is a Matlab code that I wrote for this purpose, but its performance is really bad. If someone has a suggestion what I did wrong, or can suggest a new code I will be grateful. If I may say, a friend helped me to implement this, and I think that we did not implement the filter part, but maybe I am wrong.

% The files designated to measure the transfer function.
% x1 has some input. x2 is is zero, and affected by the x1.

x1 = wavread(file1); 
x2 = wavread(file2);

%The transfer function. 

Hab = fft(x2)./fft(x1);

hab=ifft(Hab);

% Some new tracks, where x3 is recorded from sensor no.1 and x4 from sensor no.2.
% All the files have the same length.

x3 = wavread(file3); 
x4 = wavread(file4);

c=conv(hab,x3);

% Subtracted signal 

x4 = x4 - c(1:length(x4));


The following code did not subtract the cross talk on x4.
Here are some images explaining the problem. For some frequencies the above code actually did a good job and subtracted the cross talk, and for some it did the opposite and increased the energy. plot(abs(fft(x4))):

Good - Frequency energy subtracted:


Bad - Frequency energy increased (!):


Thank you!
Try using other Blind source  separation(BSS) algorithms,even Kernel BSS could be applied to remove if it is nonlinearly mixed.