I am trying to understand why 2D FFT is done on a Gaussian process in a particular code. From my understanding from these posts:
It appears that it is used to
- reduce noise
- reduce the sharpness on the edges
I am working with MATLAB, and the code snippet is as follows. Please note the peak has been moved to the top-left in the
gaussian_shaped_label function, with wrap-around:
%window size, taking padding into account window_sz = floor(target_sz * (1 + padding)); % we could choose a size that is a power of two, for better FFT % performance. in practice it is slower, due to the larger window size. % window_sz = 2 .^ nextpow2(window_sz); %create regression labels, gaussian shaped, with a bandwidth proportional to target size output_sigma = sqrt(prod(target_sz)) * output_sigma_factor / cell_size; yf = fft2(gaussian_shaped_labels(output_sigma, floor(window_sz / cell_size)));
I was trying to plot the two results.
- The Gaussian (left) zoomed on the top-left edge(right):
Plotting the code:
gaussian_shaped_labels(output_sigma, floor(window_sz / cell_size)));
- The absolute value of the 2D FFT of the Gaussian mentioned in point 1 (left) zoomed on the top-left(right): Plotting the code-
fft2(gaussian_shaped_labels(output_sigma, floor(window_sz / cell_size)));
The plot of 2D FFT seems sharper than the Gaussian. Shouldn't 2D FFT actually blur the edges and make it smoother or something? I think I am going wrong somewhere and any help will be appreciated.
If you can help me understand the mathematically too, it would extra helpful but not a hard requirement here.