help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Matlab Convolution and Deconvolution Error


From: Francesco Potorti`
Subject: Re: Matlab Convolution and Deconvolution Error
Date: Thu, 16 Oct 2008 09:54:55 +0200

>I am using Matlab to perform convolution and deconvolution to discrete time
>signals.  

Maybe you meant Octave?

>          There seems to be an error when one of the signals is long(ie
>there are many numbers in the array) and the first number in the other's
>array is near to zero.
>
>This is a simple example of my problem(the actual numbers I am using are
>more complicated)-
>A = 0:100;
>B = [0.01 1];
>C = conv(A,B);
>D = deconv(C,B);
>subplot(2,1,1)
>plot(A)
>subplot(2,1,2)
>plot(D)
>
>The two plots should be the same but they arent.  If you change A to a
>smaller signal, ie maybe only 10 numbers long, then it works and if you
>change the first number of B to something larger ie 1 then it also works. 
>How can I fix this problem, as I have been given set formulas to work with. 
>The numbers I am trying to convolve and deconvolve are both long and begin
>with very small numbers.

I did not get to understand why.  I should look more deeply into the
deconv function.  However, it is not, as I had initially suspected, a
problem with ill-conditioned deconvolution.  In Octave 3.0, if you do
the deconvolution "by hand", it works:

octave> A = 0:100; B = [.01 1]; C = conv(A,B); D = deconv(C,B);
octave> la=length(A);lb=length(B);
octave> D1=real(ifft(fft(conv(A,B))./fft(postpad(B,la+lb-1))))(1:la)

Maybe the method used by deconv (which calls filter) makes the problem
ill-conditioned somehow?

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
(entrance 20, 1st floor, room C71)     Web:   http://fly.isti.cnr.it/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]