show_freq2d.m

来自「A set of C++ and Matlab routines impleme」· M 代码 · 共 23 行

M
23
字号
%% Display the 2-D magnitude frequency response the a 2-D image
%%
%% f: 2-D signal
%% K: resolution of the frequency plot
%% h: axes on which we plot.

function show_freq2D(f, N, h);

L = 2^ceil(log2(max([size(f), 512])));

f = abs(fftshift(fft2(f, L, L)));

ind = fix([1 : N] * L / N);

f = f(ind, ind);

fx = [-1 + 2/N : 2/N : 1];
fy = fx;

val = mesh(h, fx, fy, abs(f)');
axis([-1 1 -1 1 0 max(max(abs(f)))]);
view(0,90);
axis equal;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?