Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
help with special deconvolution

Subject: help with special deconvolution

From: Jonathon Cheah

Date: 6 Jan, 2013 06:39:08

Message: 1 of 5

Below is a code for special convolution of (32 bits) x, (50 bits) h giving (82 + 6 padded zeros )Y. I cannot find a way to de-conv Y and x to get back h exactly. The code below gives a slightly different value than Matlab conv(x,h) so Matlab deconv does not return h. Tried ifft(fft(Y)*1./fft(x)) and other common methods with no luck. Any suggestions?
------------
clc
clear all
% filter:
x=dec2bin(4073739089.0);
% signal:
h=dec2bin( 60036946411689664.0);
%convolution:
m=length(x);
n=length(h);
X=[x,zeros(1,m)];
H=[h,zeros(1,(n+m))];
T=zeros(1,m);
Y=zeros(1,(n+m));
% shift H into 32-bit T, a bit at a time.
for i=1:m+n
      T=[T(2:end) 0];
    if str2num(H(i))>0
        T(m)=1;
    else
        T(m)=0;
    end
    for j=1:m
         Y(i)=Y(i)+sum(str2num(X(j))& T(j));
    end
    Y(i)=mod(Y(i),2);
end
 dec2hex(bi2de(fliplr(Y)))
 % Answer Y='DBFB31F057E34000000000';

Subject: help with special deconvolution

From: Ambroise WALLYN

Date: 16 Jan, 2013 15:52:08

Message: 2 of 5

Hi,

I have pretty much the same problem since ifft( fft(h1) / fft(h2) ) returns a matrix with only zeros...

please keep in touch if you found an answer to your problem.

Thanks

Subject: help with special deconvolution

From: Jonathon Cheah

Date: 16 Jan, 2013 22:45:09

Message: 3 of 5

"Ambroise WALLYN" <a.wallyn@sheffield.ac.uk> wrote in message <kd6ib8$l5i$1@newscl01ah.mathworks.com>...
> Hi,
>
> I have pretty much the same problem since ifft( fft(h1) / fft(h2) ) returns a matrix with only zeros...
>
> please keep in touch if you found an answer to your problem.
>
> Thanks
Hi,

The key element in this problem is the mod 2 statement after element convolution add. So, the element answer is clipped to 1. Standard conv does not do that, so the matlab deconv function, which is merely a Y/x answer does not work. However, it appears to me that it should at least gives a useful xcorr peak of x in Y in frequency domain, but it doesnt. If you are interested, you can port Numerical Recipes convlv to matlab, and play with it. It does not give you the correct answer, but at least it does not = all zeros..

Subject: help with special deconvolution

From: Bruno Luong

Date: 17 Jan, 2013 08:44:17

Message: 4 of 5

"Ambroise WALLYN" <a.wallyn@sheffield.ac.uk> wrote in message <kd6ib8$l5i$1@newscl01ah.mathworks.com>...
> Hi,
>
> I have pretty much the same problem since ifft( fft(h1) / fft(h2) ) returns a matrix with only zeros...

 fft(h1) / fft(h2) is matrix division. Deconvolution is pointwise division in fourier space.

Bruno

Subject: help with special deconvolution

From: Jonathon Cheah

Date: 18 Jan, 2013 01:06:09

Message: 5 of 5

I guess Ambroise did see my ifft(fft(Y)*1./fft(x)) part in my post....-jc

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us