Pad smaller matrix with zeros to the given size before transformation.
y = fft2pad(x,r,c)
Source matrix
Number of rows for the output image
Number of columns for the output image
Output matric with rxc size
FFT2PAD will pad the input matrix to the given r x c size, and perform fft2 after the padding. This will yield the output matrix at the same size given. This is useful in the frequency domain filtering.
x = testmatrix('magic',5); y = fft2pad(x,8,8); | ![]() | ![]() |