Valid Shape FFT Deconvolution
Show older comments
Hi MathWorks community,
I am trying to wrap my head around FFT convolution and deconvolution, and the effect of different "shape" (full, valid, and same). I have sample code displaying my problem. I'd like to reconstruct the input, x, in both deconvolutions. I got it for full conv/deconv, but not for valid conv/deconv. I didn't even try it for same conv/deconv yet since I don't even know if it is possible for valid conv/deconv. I hope it is possible. I may be missing some theory!
Thank you for any help,
~BH
Accepted Answer
More Answers (1)
Bruno Luong
on 7 Oct 2023
Edited: Bruno Luong
on 7 Oct 2023
You just do something that is obviously impossible. By FFT with truncation
X = fft(x,L)
You don't use the n-1 last elements so The (n-1) last elements of X is not used to get y.
There is then no way to get back X from Y and h2/H2
%% Valid conv and deconv:
x = 1:7;
h = 1:3;
m = length(x);
n = length(h);
L = m-n+1
X = fft(x,L);
H = fft(h,L);
Y = X.*H;
y = ifft(Y,L)
% This x3/h will give the same vector in Fourier domain as x/h
x3 = x; x3([6 7]) = 0;
X3 = fft(x3,L);
Y3 = X3.*H;
y3 = ifft(Y3,L)
AFAIK the discrete FFT theorem applies for circular convolution. Only FULL convolution is can be convert to FT by Padding 0s and make pb circular without interfering the head and the tail of the original data.
One cannot do that with 'SAME' and 'VALID' convolution. This is impossible, period.
Another way to conceive that only FULL convolution is invertible (interm of x as unknown) is to write down the convolution matrix (in term of flip(h) as band diagonal). You'll see that the simple analysis is matrix size that only FULL convolution makes sense of possibme inversion.
But SAME and VALID convolution are simply truncations of the FULL convolution (that is how @Paul did in his reply).
1 Comment
Benjamin Hezrony
on 18 Oct 2023
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!