how to deconvolute a matrix?
38 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Rabih Sokhen
el 4 de Feb. de 2022
Comentada: Walter Roberson
el 8 de Feb. de 2022
hy guys,
i would like to deconvolute a matrix but i didn't find a 2d deconvolution function , any idea how to do that without using fft or ifft?
thank you in advance
code:
clear all
clc
a=randi(2,3)
b=randi(2,3)
c=conv2(a,b)
% [d,r]=deconv2(c,a) this is what i would like to get
subplot(221)
img(a)
subplot(222)
img(b)
subplot(223)
img(c)
subplot(224)
img(d)
0 comentarios
Respuesta aceptada
Matt J
el 4 de Feb. de 2022
Using
a=randi(2,3);
b=randi(2,3)
c=conv2(a,b);
M=func2mat(@(x) conv2(a,x), zeros(3));
b_recon=reshape(M\c(:), 3,3)
14 comentarios
Matt J
el 8 de Feb. de 2022
Editada: Matt J
el 8 de Feb. de 2022
By generating c in a completely random manner c=rand(2*n-1,2*m-1), there is no gaurantee that it is the result of a convolution. The solution you are getting with M_a\c(:) is, however, the best estimate for b in the least squares sense.
Más respuestas (2)
Walter Roberson
el 8 de Feb. de 2022
Editada: Walter Roberson
el 8 de Feb. de 2022
https://www.mathworks.com/matlabcentral/answers/1620780-convolve-text-with-image#comment_1953810 shows an implementation for the case of it really only being 1d convolution
2 comentarios
Walter Roberson
el 8 de Feb. de 2022
That is Matt's code, not mine; explanation should come from him.
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!