From: sofiyya on
Hi,

I have a problem with vector deconvolution. This is what I do in Matlab:

>> vect1=[1 2 3 4 5 6 7 8 9];
>> vect2=[1 2 3 4 0 0 0 0 0 0 0 0 0 0]; %I want to find w with
conv(w,vect1)=vect2
>> Lx=length(vect2)-length(vect1)+1;
>> Lx2=pow2(nextpow2(Lx));
>> VECT1=fft(vect1,Lx2);
>> VECT2=fft(vect2,Lx2);
>> W=VECT2 ./ VECT1;
>> w=real(ifft(W,Lx2));
>> w=w(1:1:Lx);
>> w=w/max(abs(w));
>> conv(w,vec1) give this result

ans =

Columns 1 through 9

-0.1688 -0.5065 -1.0130 -1.6883 -1.3636 -0.9740 -0.5844 -0.1948 0.1948

Columns 10 through 14

2.2727 4.5195 6.9351 9.5195 0.5844

wich is different to vect2!!

Can you help me?

thx


From: Rune Allnor on
On 23 Sep, 13:24, "sofiyya" <karimae...(a)gmail.com> wrote:
> Hi,
>
> I have a problem with vector deconvolution.
....
> %I want to find w with
> conv(w,vect1)=vect2
....
> wich is different to vect2!!

Do you know that a solution w actually exists that
relates the input data through a convolution?

Rune
From: Dilip Warrier on
On Sep 23, 7:25 am, "sofiyya" <karimae...(a)gmail.com> wrote:
> Hi,
>
> I have a problem with vector deconvolution. This is what I do in Matlab:
>
>
>
> >> vect1=[1 2 3 4 5 6 7 8 9];
> >> vect2=[1 2 3 4 0 0 0 0 0 0 0 0 0 0]; %I want to find w with
> conv(w,vect1)=vect2
> >> Lx=length(vect2)-length(vect1)+1;
> >> Lx2=pow2(nextpow2(Lx));
> >> VECT1=fft(vect1,Lx2);
> >> VECT2=fft(vect2,Lx2);
> >> W=VECT2 ./ VECT1;
> >> w=real(ifft(W,Lx2));
> >> w=w(1:1:Lx);
> >> w=w/max(abs(w));
> >> conv(w,vec1) give this result
>
> ans =
>
> Columns 1 through 9
>
> -0.1688 -0.5065 -1.0130 -1.6883 -1.3636 -0.9740 -0.5844 -0.1948 0.1948
>
> Columns 10 through 14
>
> 2.2727 4.5195 6.9351 9.5195 0.5844
>
> wich is different to vect2!!
>
> Can you help me?
>
> thx

The error is in truncating the length of w in the step:
w=w(1:1:Lx);

Once you truncate it to a smaller length, the expected convolution
result need not hold.
From: sofiyya on
>On Sep 23, 7:25 am, "sofiyya" <karimae...(a)gmail.com> wrote:

This is the result I get when I don't truncate w:

ans =

Columns 1 through 9

-0.0903 -0.2708 -0.5417 -0.9028 -0.7292 -0.5208 -0.2778
-0.0000 0.2778

Columns 10 through 16

1.4583 2.7292 4.0903 5.5417 0.8333 0.5903 0.3125

which is also wrong!
From: Rune Allnor on
On 24 Sep, 09:49, "sofiyya" <karimae...(a)gmail.com> wrote:
> >On Sep 23, 7:25 am, "sofiyya" <karimae...(a)gmail.com> wrote:
>
> This is the result I get when I don't truncate w:
>
> ans =
>
>   Columns 1 through 9
>
>    -0.0903   -0.2708   -0.5417   -0.9028   -0.7292   -0.5208   -0.2778  
> -0.0000    0.2778
>
>   Columns 10 through 16
>
>     1.4583    2.7292    4.0903    5.5417    0.8333    0.5903    0.3125
>
> which is also wrong!

Once again: Are you sure the problem as stated has a solution?

Rune