Filter löschen
Filter löschen

How to perform 2 dimensional circular convolution

29 Ansichten (letzte 30 Tage)
Palguna Gopireddy
Palguna Gopireddy am 7 Mär. 2022
Kommentiert: Palguna Gopireddy am 10 Mär. 2022
We have 'conv' and 'conv2' functions in matlab to find 1-D and 2-D linear convolution.
But for circular convolution we have only 'cconv' for 1-D convolution. Is there 2-D circular convolution function in matlab or there is any way to acheive 2-D circular convolution in MATLAB.
I tried using 'conv2(A,B,'same'), but it is not same as 2-D circular convolution.

Akzeptierte Antwort

Matt J
Matt J am 7 Mär. 2022
function z=cyconv(x,y)
%Non-Fourier domain cyclic convolution
%
% z=cyconv(x,y)
siz=num2cell(size(x));
subs=cellfun(@(n)[2:n,1:n],siz,'uni',0);
x=x(subs{:});
z=convn(x,y,'valid');

Weitere Antworten (1)

Matt J
Matt J am 7 Mär. 2022
Bearbeitet: Matt J am 7 Mär. 2022
Using FFTs
out = ifft2(fft2(A).*fft2(B));

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by